From b68881abc4c50bbc8ee9e81b4e18b0ea011b83b7 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 2 Mar 2015 17:55:31 +0100 Subject: Setup critical section management for parts that must not be interrupted. --- src/kernel/core/idt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/kernel/core/idt.c') diff --git a/src/kernel/core/idt.c b/src/kernel/core/idt.c index d34d03f..5c77502 100644 --- a/src/kernel/core/idt.c +++ b/src/kernel/core/idt.c @@ -107,6 +107,8 @@ void idt_ex_handler(registers_t *regs) { /* Called in interrupt.s when an IRQ fires (interrupt 32 to 47) */ void idt_irq_handler(registers_t *regs) { + int st = enter_critical(CL_EXCL); // if someone tries to yield(), an assert will fail + if (regs->err_code > 7) { outb(0xA0, 0x20); } @@ -116,6 +118,8 @@ void idt_irq_handler(registers_t *regs) { if (irq_handlers[regs->err_code] != 0) { irq_handlers[regs->err_code](regs); } + + exit_critical(st); } /* Caled in interrupt.s when a syscall is called */ -- cgit v1.2.3