diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2015-02-11 17:13:26 -0500 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2015-02-11 17:13:26 -0500 |
| commit | e3305e8f7c119c83fd04f1995e07ff71a1110887 (patch) | |
| tree | f95921215c215a60d80b1be068b2cccd72459ee2 /kernel/irq.c | |
| parent | 90fda5287e3dae56508a4b31e1bc4e29cd83e377 (diff) | |
| download | kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.zip kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.tar.gz kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.tar.bz2 kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.tar.xz | |
optimize interrupt performance
Diffstat (limited to 'kernel/irq.c')
| -rw-r--r-- | kernel/irq.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/irq.c b/kernel/irq.c index aa726d9..c6652e9 100644 --- a/kernel/irq.c +++ b/kernel/irq.c @@ -5,6 +5,7 @@ #include "io.h" #include "irq.h" #include "isr.h" +#include "panic.h" /* in isr.c */ extern void *int_callbacks[256]; @@ -44,11 +45,11 @@ void irq_init(void) idt_set_gate(47, (uint32_t)_irq15, 0x08, 0x8E); } -void irq_handler(struct regs_t regs) +void irq_handler(struct regs_t *regs) { - void (*handler)(struct regs_t r); + void (*handler)(struct regs_t *r); - handler = int_callbacks[regs.int_no]; + handler = int_callbacks[regs->int_no]; if(handler) { @@ -56,13 +57,13 @@ void irq_handler(struct regs_t regs) } else { - printf("WARNING: Unhandled IRQ: 0x%x!\n", regs.int_no); + printf("WARNING: Unhandled IRQ: 0x%x!\n", regs->int_no); } /* If the IDT entry that was invoked was greater than 40 * (meaning IRQ8 - 15), then we need to send an EOI to * the slave controller */ - if (regs.int_no >= 40) + if (regs->int_no >= 40) { outb(0xA0, 0x20); } |