summaryrefslogtreecommitdiff
path: root/arch/i386/boot
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-02-16 12:45:36 -0600
committerDanny Holman <dholman@gymli.org>2024-02-16 12:45:36 -0600
commit7feac2d2f283831be6b8dcca9fc3851133fdb3f3 (patch)
tree14dabc85b5d94ff9490900e1b41c2ec27cc1a261 /arch/i386/boot
parentc2a6c9a4704c264f70af6cdd71a6e9979d9b87b6 (diff)
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 <dholman@gymli.org>
Diffstat (limited to 'arch/i386/boot')
-rw-r--r--arch/i386/boot/isr.s8
1 files 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