From bd426199f81b470733eac81f0e7d19c050985ef2 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sun, 28 Dec 2025 03:53:17 +0200 Subject: [PATCH] Kernel: Remove unused (and broken) code from signal trampoline --- kernel/arch/i686/Signal.S | 14 ++++---------- kernel/arch/x86_64/Signal.S | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/kernel/arch/i686/Signal.S b/kernel/arch/i686/Signal.S index 6059608d..38c84369 100644 --- a/kernel/arch/i686/Signal.S +++ b/kernel/arch/i686/Signal.S @@ -18,12 +18,6 @@ signal_trampoline: pushl %eax pushl %ebp - movl 76(%esp), %eax // return sp - addl $4, %eax // return address - movl 80(%esp), %ebx // return ip - pushl %eax; - pushl %ebx - // FIXME: populate these xorl %eax, %eax pushl %eax // stack @@ -34,9 +28,9 @@ signal_trampoline: pushl %eax // link movl %esp, %edx // ucontext - leal 68(%esp), %esi // siginfo - movl 64(%esp), %edi // signal number - movl 60(%esp), %eax // handlers + leal 60(%esp), %esi // siginfo + movl 56(%esp), %edi // signal number + movl 52(%esp), %eax // handlers // align stack to 16 bytes movl %esp, %ebp @@ -57,7 +51,7 @@ signal_trampoline: // restore stack movl %ebp, %esp - addl $32, %esp + addl $24, %esp // restore registers popl %ebp diff --git a/kernel/arch/x86_64/Signal.S b/kernel/arch/x86_64/Signal.S index dc815e33..d66b0e51 100644 --- a/kernel/arch/x86_64/Signal.S +++ b/kernel/arch/x86_64/Signal.S @@ -26,12 +26,6 @@ signal_trampoline: pushq %rax pushq %rbp - movq 200(%rsp), %rax // return sp - addq $(128 + 8), %rax // red-zone and return address - movq 208(%rsp), %rbx // return ip - pushq %rax; - pushq %rbx - // FIXME: populate these xorq %rax, %rax pushq %rax // stack @@ -41,9 +35,9 @@ signal_trampoline: pushq %rax // link movq %rsp, %rdx // ucontext - leaq 192(%rsp), %rsi // siginfo - movq 184(%rsp), %rdi // signal number - movq 176(%rsp), %rax // handler + leaq 176(%rsp), %rsi // siginfo + movq 168(%rsp), %rdi // signal number + movq 160(%rsp), %rax // handler // align stack to 16 bytes movq %rsp, %rbp @@ -59,7 +53,7 @@ signal_trampoline: // restore stack movq %rbp, %rsp - addq $56, %rsp + addq $40, %rsp // restore registers popq %rbp