diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-26 22:07:16 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-26 22:07:16 -0400 |
| commit | 8de23ca36173cfdb3c609074496115ebd9045887 (patch) | |
| tree | c70fe6c0ce229b7b87365a4b0f058e58d901c130 /arch/x86_64/sys/syscall.c | |
| parent | 5f813d49a08cf3c3f8cf6c422cfb6587df575f62 (diff) | |
| download | jove-kernel-8de23ca36173cfdb3c609074496115ebd9045887.tar.gz jove-kernel-8de23ca36173cfdb3c609074496115ebd9045887.tar.bz2 jove-kernel-8de23ca36173cfdb3c609074496115ebd9045887.zip | |
x86_64: make syscall_entry compliant to SYSTEM-V ABI
Diffstat (limited to 'arch/x86_64/sys/syscall.c')
| -rw-r--r-- | arch/x86_64/sys/syscall.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/x86_64/sys/syscall.c b/arch/x86_64/sys/syscall.c index a694674..7c5727f 100644 --- a/arch/x86_64/sys/syscall.c +++ b/arch/x86_64/sys/syscall.c @@ -26,35 +26,28 @@ _syscall_handle_arch(syscall_context_t *ctx) __attribute__((naked)) void _syscall_entry(void) { - __asm__ volatile(" \ + asm volatile(" \ swapgs; \ movq %%gs:%c[pcb], %%rax; \ movq %%rsp, %%rdx; \ movq %c[ksp](%%rax), %%rsp; \ - pushq %%rcx; \ pushq %%rdx; \ pushq %%r11; \ + pushq %%rcx; \ pushq %%rbp; \ callq syscall_handler; \ swapgs; \ - xorq %%r15, %%r15; \ - xorq %%r14, %%r14; \ - xorq %%r13, %%r13; \ - xorq %%r12, %%r12; \ xorq %%r10, %%r10; \ xorq %%r9, %%r9; \ xorq %%r8, %%r8; \ xorq %%rsi, %%rsi; \ xorq %%rdi, %%rdi; \ - xorq %%rbp, %%rbp; \ xorq %%rdx, %%rdx; \ - xorq %%rcx, %%rcx; \ - xorq %%rbx, %%rbx; \ popq %%rbp; \ + popq %%rcx; \ popq %%r11; \ popq %%rsp; \ - popq %%rcx; \ - sysretq;" + sysretq" :: [pcb] "i"(offsetof(processor_t, pcb)), [ksp] "i"(offsetof(pcb_t, ksp))); |
