diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-28 20:57:44 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-28 22:29:28 +0200 |
commit | b6435372cc91a9ce2c3f70a6d12c7f7869dfb2f0 (patch) | |
tree | e290f9ef91ad260c6b8dff2a3af61f573f34d83c /Kernel | |
parent | 732dc72c58d4b2a135e5b302dff08571f170465e (diff) | |
download | serenity-b6435372cc91a9ce2c3f70a6d12c7f7869dfb2f0.zip |
Kernel: Implement syscall entry for x86_64
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Syscall.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 5912986b66..d316af2dd3 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -55,8 +55,33 @@ NEVER_INLINE void syscall_asm_entry_dummy() asm( ".globl syscall_asm_entry\n" "syscall_asm_entry:\n" - " cli\n" - " hlt\n"); + " pushq $0x0\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 // clang-format on } |