Luna/kernel/src/arch/x86_64/CPU.asm

17 lines
424 B
NASM
Raw Normal View History

2022-11-15 18:10:32 +00:00
global enable_sse
enable_sse:
mov rax, cr0
and ax, 0xFFFB ;clear coprocessor emulation CR0.EM
or ax, 0x2 ;set coprocessor monitoring CR0.MP
mov cr0, rax
mov rax, cr4
or ax, 3 << 9 ;set CR4.OSFXSR and CR4.OSXMMEXCPT at the same time
mov cr4, rax
ret
global enable_write_protect
enable_write_protect:
mov rax, cr0
or eax, 0x80000 ;set write-protect CR0.WP
mov cr0, rax
ret