x86_64: implement bootstrap function for pmap interface

This commit is contained in:
2023-02-06 20:50:28 +00:00
parent 52b3a5d6a5
commit 625eac9ca7
8 changed files with 423 additions and 4 deletions

31
arch/x86_64/pmap_ctrl.S Normal file
View 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