diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-03-02 17:55:31 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-03-02 17:55:31 +0100 |
commit | b68881abc4c50bbc8ee9e81b4e18b0ea011b83b7 (patch) | |
tree | 56af7d51db555183d62c3c50c614c8775efc6aa7 /src/kernel/core/idt.c | |
parent | f610cb7baa26b2803fce8b6e4604e8639c71d1d3 (diff) | |
download | kogata-b68881abc4c50bbc8ee9e81b4e18b0ea011b83b7.tar.gz kogata-b68881abc4c50bbc8ee9e81b4e18b0ea011b83b7.zip |
Setup critical section management for parts that must not be interrupted.
Diffstat (limited to 'src/kernel/core/idt.c')
-rw-r--r-- | src/kernel/core/idt.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 */ |