mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Kernel: Add SysV stack alignment to signal trampoline
In both dispatch signal and asm_signal_trampoline we now ensure that the stack is 16 byte aligned, as per the System V ABI.
This commit is contained in:
parent
81d0f96f20
commit
95fe775d81
Notes:
sideshowbarker
2024-07-19 12:16:32 +09:00
Author: https://github.com/DrewStratford
Commit: 95fe775d81
Pull-request: https://github.com/SerenityOS/serenity/pull/518
Reviewed-by: https://github.com/awesomekling
2 changed files with 9 additions and 2 deletions
|
@ -746,10 +746,11 @@ asm(
|
|||
"push ebp\n"
|
||||
"mov ebp, esp\n"
|
||||
"push eax\n" // we have to store eax 'cause it might be the return value from a syscall
|
||||
"sub esp, 4\n" // align the stack to 16 bytes
|
||||
"mov eax, [ebp+12]\n" // push the signal code
|
||||
"push eax\n"
|
||||
"call [ebp+8]\n" // call the signal handler
|
||||
"add esp, 4\n"
|
||||
"add esp, 8\n"
|
||||
"mov eax, 0x2d\n" // FIXME: We shouldn't be hardcoding this.
|
||||
"int 0x82\n" // sigreturn syscall
|
||||
"asm_signal_trampoline_end:\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue