minor optimizations and code cleanups
This commit is contained in:
parent
cf503426bf
commit
da30b95e9d
1 changed files with 13 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue