Kernel: Make sure stack is aligned on interrupts for i686 target

I just realized that only x86_64 aligns stack pointer when interrupt is
triggered.
This commit is contained in:
2024-07-22 00:10:42 +03:00
parent 8fe798de6d
commit 1ee37cb671
2 changed files with 30 additions and 8 deletions

View File

@@ -15,8 +15,14 @@ asm_syscall_handler:
pushl %esi
pushl %ebp
# align stack and push arguments
pushl %esp
# align stack
movl %esp, %ebp
subl $15, %esp
andl $0xFFFFFFF0, %esp
# push arguments
subl $4, %esp
pushl %ebp
addl $32, (%esp)
pushl %edi
pushl %esi
@@ -34,7 +40,8 @@ asm_syscall_handler:
movw %ax, %gs
call cpp_syscall_handler
addl $28, %esp
movl %ebp, %esp
# restore general purpose registers
popl %ebp