mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-21 02:23:50 -04:00
Fix interruptions
This commit is contained in:
parent
551dd10dc2
commit
ed91c5ce5a
@ -111,20 +111,40 @@ _isr%1:
|
||||
|
||||
%macro CREATE_IRQ 1
|
||||
_irq%1:
|
||||
push rax
|
||||
|
||||
; Disable interruptions to avoid being interrupted
|
||||
cli
|
||||
|
||||
push rax
|
||||
|
||||
mov rax, [irq_handlers + 8 *%1]
|
||||
|
||||
; If there are no handler, just send EOI
|
||||
test rax, rax
|
||||
je .eoi
|
||||
|
||||
push rax
|
||||
push rcx
|
||||
push rdx
|
||||
push rsi
|
||||
push rdi
|
||||
push r8
|
||||
push r9
|
||||
push r10
|
||||
push r11
|
||||
|
||||
; Call the handler
|
||||
call rax
|
||||
|
||||
pop r11
|
||||
pop r10
|
||||
pop r9
|
||||
pop r8
|
||||
pop rdi
|
||||
pop rsi
|
||||
pop rdx
|
||||
pop rcx
|
||||
pop rax
|
||||
|
||||
.eoi:
|
||||
|
||||
mov rax, %1 ; IRQ number
|
||||
|
Loading…
x
Reference in New Issue
Block a user