mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 20:25:07 +00:00
Kernel: Implement syscall entry for x86_64
This commit is contained in:
parent
732dc72c58
commit
b6435372cc
1 changed files with 27 additions and 2 deletions
|
@ -55,8 +55,33 @@ NEVER_INLINE void syscall_asm_entry_dummy()
|
||||||
asm(
|
asm(
|
||||||
".globl syscall_asm_entry\n"
|
".globl syscall_asm_entry\n"
|
||||||
"syscall_asm_entry:\n"
|
"syscall_asm_entry:\n"
|
||||||
" cli\n"
|
" pushq $0x0\n"
|
||||||
" hlt\n");
|
" pushq %r15\n"
|
||||||
|
" pushq %r14\n"
|
||||||
|
" pushq %r13\n"
|
||||||
|
" pushq %r12\n"
|
||||||
|
" pushq %r11\n"
|
||||||
|
" pushq %r10\n"
|
||||||
|
" pushq %r9\n"
|
||||||
|
" pushq %r8\n"
|
||||||
|
" pushq %rax\n"
|
||||||
|
" pushq %rcx\n"
|
||||||
|
" pushq %rdx\n"
|
||||||
|
" pushq %rbx\n"
|
||||||
|
" pushq %rsp\n"
|
||||||
|
" pushq %rbp\n"
|
||||||
|
" pushq %rsi\n"
|
||||||
|
" pushq %rdi\n"
|
||||||
|
" pushq %rsp \n" /* set TrapFrame::regs */
|
||||||
|
" subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n"
|
||||||
|
" subq $0x8, %rsp\n" /* align stack */
|
||||||
|
" lea 0x8(%rsp), %rdi \n"
|
||||||
|
" cld\n"
|
||||||
|
" call enter_trap_no_irq \n"
|
||||||
|
" lea 0x8(%rsp), %rdi \n"
|
||||||
|
" call syscall_handler\n"
|
||||||
|
" addq $0x8, %rsp\n" /* undo alignment */
|
||||||
|
" jmp common_trap_exit \n");
|
||||||
#endif
|
#endif
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue