Kernel: Cleanup stack alignment assembly

This commit is contained in:
Bananymous 2025-04-20 16:55:18 +03:00
parent 265b4c2b22
commit 99fc7817c6
2 changed files with 6 additions and 8 deletions

View File

@ -16,9 +16,8 @@ signal_trampoline:
movl 36(%esp), %eax
// align stack to 16 bytes
movl %esp, %ebx
andl $0x0F, %ebx
subl %ebx, %esp
movl %esp, %ebp
andl $-16, %esp
subl $12, %esp
pushl %edi
@ -26,7 +25,7 @@ signal_trampoline:
addl $16, %esp
// restore stack
addl %ebx, %esp
movl %ebp, %esp
popa
leave

View File

@ -27,14 +27,13 @@ signal_trampoline:
movq 120(%rsp), %rax
// align stack to 16 bytes
movq %rsp, %rbx
andq $0x0F, %rbx
subq %rbx, %rsp
movq %rsp, %rbp
andq $-16, %rsp
call *%rax
// restore stack
addq %rbx, %rsp
movq %rbp, %rsp
popq %r15
popq %r14
popq %r13