增加一个从c语言使用x86_64中sysret指令的接口
This commit is contained in:
parent
5bd549328f
commit
0613dadeaf
|
@ -26,6 +26,9 @@ init64:
|
||||||
lea rax, [systemcall_procedure]
|
lea rax, [systemcall_procedure]
|
||||||
wrmsr
|
wrmsr
|
||||||
|
|
||||||
|
; 加载中断相关寄存器
|
||||||
|
; 需要加载寄存器IA32_INTERRUPT_SSP_TABLE
|
||||||
|
|
||||||
jmp kmain
|
jmp kmain
|
||||||
|
|
||||||
section .multiboot2 align=8
|
section .multiboot2 align=8
|
||||||
|
|
|
@ -50,6 +50,10 @@ set_kernel_stack_cache:
|
||||||
pop rax
|
pop rax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
; void return_from_systemcall()
|
||||||
|
return_from_systemcall:
|
||||||
|
sysret
|
||||||
|
|
||||||
save_kernel_stack:
|
save_kernel_stack:
|
||||||
endbr64
|
endbr64
|
||||||
lea rbx, [kernel_stack_cache]
|
lea rbx, [kernel_stack_cache]
|
||||||
|
|
Reference in New Issue