summaryrefslogtreecommitdiff
path: root/kernel/traps.s
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/traps.s')
-rw-r--r--kernel/traps.s13
1 files changed, 3 insertions, 10 deletions
diff --git a/kernel/traps.s b/kernel/traps.s
index ca083dd..475495b 100644
--- a/kernel/traps.s
+++ b/kernel/traps.s
@@ -117,10 +117,7 @@ traps_init:
mov ecx, 0
mov edx, idt
.loop:
- mov eax, ecx
- shl eax, 2
- add eax, traps
- mov eax, [eax]
+ mov eax, [ecx*4+traps]
mov [edx], ax
shr eax, 16
mov [edx+6], ax
@@ -279,9 +276,7 @@ syscall_handler:
push ecx
push ebx
and eax, 0xFF
- shl eax, 2
- add eax, call_table
- call [eax]
+ call [eax*4+call_table]
add esp, 12
; preserve the syscall's return value
mov [esp+30], eax
@@ -326,9 +321,7 @@ check_signals:
inc ecx
mov ebx, ecx
; calculate offset to the handler function
- shl ecx, 2
- add ecx, eax
- add ecx, ts_sig_handlers
+ lea ecx, [ecx*4+eax+ts_sig_handlers]
cmp dword [ecx], 0
jne .custom_handler
; call the default handler