Created
November 1, 2009 02:31
-
-
Save duckinator/223367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void HalIrqHandler(struct regs *r) | |
{ | |
printf("Irqs triggered so far: %i; Current IRQ: Irq %i...", foo, (r->int_no-32)); | |
foo++; | |
/* This is a blank function pointer */ | |
void (*handler)(struct regs *r); | |
/* Find out if we have a custom handler to run for this | |
* IRQ, and then finally, run it */ | |
handler = irq_routines[r->int_no - 32]; | |
if (handler) | |
{ | |
handler(r); | |
} | |
/* We need to send an EOI to the | |
* interrupt controllers too */ | |
if(r->int_no > 8){ /* Only send EOI to slave controller if it's involved (irqs 9 and up) */ | |
HalOutPort(0xA0, 0x20); | |
} | |
HalOutPort(0x20, 0x20); | |
printf("Done\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment