From da30b95e9d48f80a5fed97fc6525e894847246fe Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 10 Sep 2012 05:34:18 -0700 Subject: [PATCH] minor optimizations and code cleanups --- arch/x86/kernel/entry32.asm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/entry32.asm b/arch/x86/kernel/entry32.asm index 276b02b8..eb4d8393 100644 --- a/arch/x86/kernel/entry32.asm +++ b/arch/x86/kernel/entry32.asm @@ -436,9 +436,11 @@ isr31: extern syscall_handler ; used to realize system calls +; by entering the handler, the interrupt flag is not cleared isrsyscall: - push ds + cli push es + push ds push ebp push edi push esi @@ -446,21 +448,27 @@ isrsyscall: push ecx push ebx push eax + + ; set kernel data segmenets mov ax, 0x10 mov ds, ax mov es, ax mov eax, [esp] + sti + call syscall_handler + + cli add esp, 4 ; eax contains the return value - ; => we did not restore eax + ; => we did not restore eax pop ebx pop ecx pop edx pop esi pop edi pop ebp - pop es pop ds + pop es iret global irq0 @@ -766,8 +774,8 @@ switch_context: push DWORD 0x0 ; Interrupt number push DWORD 0x00edbabe ; Error code pusha ; Registers... - push es - push ds + push 0x10 ; kernel data segment + push 0x10 ; kernel data segment jmp common_switch