* Enable and restore kernel text write permissions. * Callers must ensure that disable_wp()/restore_wp() are executed * without rescheduling on the same core. */
| 1430 | * without rescheduling on the same core. |
| 1431 | */ |
| 1432 | bool |
| 1433 | disable_wp(void) |
| 1434 | { |
| 1435 | u_int cr0; |
| 1436 | |
| 1437 | cr0 = rcr0(); |
| 1438 | if ((cr0 & CR0_WP) == 0) |
| 1439 | return (false); |
| 1440 | load_cr0(cr0 & ~CR0_WP); |
| 1441 | return (true); |
| 1442 | } |
| 1443 | |
| 1444 | void |
| 1445 | restore_wp(bool old_wp) |
no test coverage detected