Skip to content

Instantly share code, notes, and snippets.

@duckinator
Created November 1, 2009 02:31
Show Gist options
  • Save duckinator/223367 to your computer and use it in GitHub Desktop.
Save duckinator/223367 to your computer and use it in GitHub Desktop.
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