Files
banan-os/kernel/arch/x86_64/Syscall.S
Bananymous 9d83424346 Kernel: Remove unnecessary stack pointer loading
Any time I started a thread I was loading the stack pointer which is
already correctly passed :D
2026-04-04 23:48:43 +03:00

50 lines
604 B
ArmAsm

.global asm_syscall_handler
asm_syscall_handler:
swapgs
movq %rsp, %rax
movq %gs:8, %rsp
pushq $(0x20 | 3)
pushq %rax
pushq %r11
pushq $(0x28 | 3)
pushq %rcx
subq $8, %rsp
movq %r10, %rcx
call cpp_syscall_handler
movq 8(%rsp), %rcx
movq 24(%rsp), %r11
movq 32(%rsp), %rsp
swapgs
sysretq
.global sys_fork_trampoline
sys_fork_trampoline:
pushq %rbx
pushq %rbp
pushq %r12
pushq %r13
pushq %r14
pushq %r15
call read_ip
testq %rax, %rax
jz .done
movq %rax, %rsi
movq %rsp, %rdi
call sys_fork
.done:
popq %r15
popq %r14
popq %r13
popq %r12
popq %rbp
popq %rbx
ret