Files
mango/arch/x86_64/pmap_ctrl.S

43 lines
458 B
ArmAsm

.global pmap_switch
.type pmap_switch, @function
pmap_switch:
mov %rdi, %cr3
ret
.global gigabyte_pages
.type gigabyte_pages, @function
gigabyte_pages:
push %rbp
mov %rsp, %rbp
push %rbx
mov $0x80000001, %eax
cpuid
andl $0x4000000, %edx
jz 2f
1: mov $0x1, %rax
jmp 3f
2: mov $0x0, %rax
3: pop %rbx
pop %rbp
ret
.global enable_nx
.type enable_nx, @function
enable_nx:
mov $0xC0000080, %ecx
rdmsr
or $0x800, %eax
wrmsr
ret