diff options
| author | Jake Mannens <jakem_5@hotmail.com> | 2020-08-02 08:27:25 +1000 |
|---|---|---|
| committer | Jake Mannens <jakem_5@hotmail.com> | 2020-08-02 08:27:25 +1000 |
| commit | 5d29745034c854886fb5988fca65cc3757f69a3e (patch) | |
| tree | 445acaa25ee13b0f2e5dbba1acee6c39aa8c4d0f /kernel/traps.s | |
| parent | 4d6fe1c317f0a541922f4cf945365fd31e608e10 (diff) | |
Diffstat (limited to 'kernel/traps.s')
| -rw-r--r-- | kernel/traps.s | 13 |
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 |
