From ed91c5ce5ab18ddf909386ce5845074049a2ddd7 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Mon, 4 Nov 2013 19:14:42 +0100 Subject: [PATCH] Fix interruptions --- micro_kernel/interrupts.asm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/micro_kernel/interrupts.asm b/micro_kernel/interrupts.asm index 9544223b..baf4419b 100644 --- a/micro_kernel/interrupts.asm +++ b/micro_kernel/interrupts.asm @@ -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