MCPcopy Create free account
hub / github.com/F-Stack/f-stack / disable_wp

Function disable_wp

freebsd/x86/x86/cpu_machdep.c:1432–1442  ·  view source on GitHub ↗

* Enable and restore kernel text write permissions. * Callers must ensure that disable_wp()/restore_wp() are executed * without rescheduling on the same core. */

Source from the content-addressed store, hash-verified

1430 * without rescheduling on the same core.
1431 */
1432bool
1433disable_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
1444void
1445restore_wp(bool old_wp)

Callers 3

db_write_bytesFunction · 0.85
fpuinit_bsp1Function · 0.85
gdb_begin_writeFunction · 0.85

Calls 2

rcr0Function · 0.50
load_cr0Function · 0.50

Tested by

no test coverage detected