From 7feac2d2f283831be6b8dcca9fc3851133fdb3f3 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Fri, 16 Feb 2024 12:45:36 -0600 Subject: arch: i386: boot: ISR frame should not include ESP The code that constructs an isr_frame struct should not push ESP to the stack. In addition, the kernel should set its own copy of ESP into a function defined elsewhere for scheduling purposes. Signed-off-by: Danny Holman --- arch/i386/boot/isr.s | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/i386/boot/isr.s b/arch/i386/boot/isr.s index 5bd63ed..55db35e 100644 --- a/arch/i386/boot/isr.s +++ b/arch/i386/boot/isr.s @@ -30,6 +30,7 @@ irq_stub_\num: .global syscall_stub syscall_stub: + cli pushl $0 pushl $0x80 jmp isr_frame_asm @@ -41,7 +42,6 @@ isr_frame_asm: pushl %edx pushl %esi pushl %edi - pushl %esp movl %cr0, %eax pushl %eax @@ -52,6 +52,10 @@ isr_frame_asm: movl %cr4, %eax pushl %eax + pushl %esp + call set_kernel_esp + addl $4, %esp + cld call interrupt_handler @@ -64,13 +68,13 @@ isr_frame_asm: popl %eax movl %eax, %cr0 - popl %esp popl %edi popl %esi popl %edx popl %ecx popl %ebx popl %eax + addl $8, %esp iret -- cgit v1.2.3