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