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

28 lines
377 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:
push rax
mov rax, rdi
mov cr3, rax
pop rax
ret