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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user