pub fn enable_write_protect_bit() {
    use x86_64::registers::control_regs::{cr0, cr0_write, Cr0};

    // The CR0 register is only allowed in kernel mode
    // But we are in kernel mode. So it's safe.
    unsafe { cr0_write(cr0() | Cr0::WRITE_PROTECT) };
}
/// Enable write protection in kernel mode
Enable write protection in kernel mode
Enable write protection in kernel mode
pub fn enable_write_protect_bit() {
    use x86_64::registers::control_regs::{cr0, cr0_write, Cr0};
    // The CR0 register is only allowed in kernel mode
    // But we are in kernel mode. So it's safe.
    unsafe { cr0_write(cr0() | Cr0::WRITE_PROTECT) };
}
pub fn enable_write_protect_bit ( ) { use x86_64 :: registers :: control_regs :: { cr0 , cr0_write , Cr0 } ; // The CR0 register is only allowed in kernel mode // But we are in kernel mode. So it's safe. unsafe { cr0_write ( cr0 ( ) | Cr0 :: WRITE_PROTECT ) } ; }
Enable write protection in kernel mode
Enable write protection in kernel mode