Kernel: Cleanup 32 bit interrupt stack alignment

This commit is contained in:
Bananymous 2025-04-15 21:21:23 +03:00
parent 15045cc486
commit 0f936fc163
1 changed files with 11 additions and 17 deletions

View File

@ -40,8 +40,7 @@ isr_stub:
movl 56(%esp), %edx // isr number
movl %esp, %ebp
subl $15, %esp
andl $0xFFFFFFF0, %esp
andl $-16, %esp
pushl %eax
pushl %ebx
@ -61,14 +60,13 @@ irq_stub:
load_kernel_segments
cld
movl 40(%esp), %eax # interrupt number
movl 40(%esp), %edi # interrupt number
movl %esp, %ebp
subl $15, %esp
andl $0xFFFFFFF0, %esp
andl $-16, %esp
subl $12, %esp
pushl %eax
pushl %edi
call cpp_irq_handler
movl %ebp, %esp
@ -83,16 +81,15 @@ asm_yield_handler:
pushal
cld
movl %esp, %eax # interrupt registers ptr
leal 32(%esp), %ebx # interrupt stack ptr
leal 32(%esp), %edi # interrupt stack ptr
movl %esp, %esi # interrupt registers ptr
movl %esp, %ebp
subl $15, %esp
andl $0xFFFFFFF0, %esp
andl $-16, %esp
subl $8, %esp
pushl %eax
pushl %ebx
pushl %esi
pushl %edi
call cpp_yield_handler
movl %ebp, %esp
@ -107,8 +104,7 @@ asm_ipi_handler:
cld
movl %esp, %ebp
subl $15, %esp
andl $0xFFFFFFF0, %esp
andl $-16, %esp
call cpp_ipi_handler
@ -117,7 +113,6 @@ asm_ipi_handler:
pop_userspace
iret
.global asm_timer_handler
asm_timer_handler:
push_userspace
@ -125,8 +120,7 @@ asm_timer_handler:
cld
movl %esp, %ebp
subl $15, %esp
andl $0xFFFFFFF0, %esp
andl $-16, %esp
call cpp_timer_handler