MCPcopy Create free account
hub / github.com/Infinity-OS/infinity / enable_write_protect_bit

Function enable_write_protect_bit

src/start.rs:19–23  ·  view source on GitHub ↗

This enables the write protect bit in order to enable write protection on kernel mode.

()

Source from the content-addressed store, hash-verified

17
18/// This enables the write protect bit in order to enable write protection on kernel mode.
19fn enable_write_protect_bit() {
20 use x86_64::registers::control_regs::{cr0, cr0_write, Cr0};
21
22 unsafe { cr0_write(cr0() | Cr0::WRITE_PROTECT) };
23}
24
25#[no_mangle]
26/// Entry point for the Rust code

Callers 1

rust_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected