Files
mop3/kernel/amd64/syscallentry.S
2026-01-11 03:45:32 +01:00

47 lines
527 B
ArmAsm

#include <amd64/regsasm.h>
.extern amd64_syscall_dispatch
.global amd64_syscall_entry
amd64_syscall_entry:
cli
movq %rsp, %gs:0
movq %gs:8, %rsp
pushq $0x23
pushq %gs:0
pushq %r11
pushq $0x1b
pushq %rcx
pushq $0
pushq $0
push_regs
cld
movq %rsp, %rdi
movq %cr3, %rax
pushq %rax
movq %rsp, %rbp
subq $8, %rsp
andq $~0xF, %rsp
callq amd64_syscall_dispatch
movq %rbp, %rsp
popq %rax
movq %rax, %cr3
pop_regs_skip_rax
addq $56, %rsp
movq %gs:0, %rsp
sysretq