x86_64: implement bootstrap function for pmap interface
This commit is contained in:
31
arch/x86_64/pmap_ctrl.S
Normal file
31
arch/x86_64/pmap_ctrl.S
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
.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
|
||||
Reference in New Issue
Block a user