os-k/kaleid/kernel/mm/paging.asm

25 lines
335 B
NASM

global MmEnableWriteProtect
global MmDisableWriteProtect
global MmLoadPML4
MmEnableWriteProtect:
push rax
mov rax, cr0
or rax, 1<<16
mov cr0, rax
pop rax
ret
MmDisableWriteProtect:
push rax
mov rax, cr0
and rax, ~(1<<16)
mov cr0, rax
pop rax
ret
MmLoadPML4:
mov cr3, rsi
ret