Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
void *irq_routines[16] =
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
void irq_handler(struct regs *r)
{
/* 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);
}
/* 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 (r->int_no >= 40)
{
outportb(0xA0, 0x20);
}
/* In either case, we need to send an EOI to the master
* interrupt controller too */
outportb(0x20, 0x20);
}
/* This is a blank function pointer */
void (*handler)(struct regs *r);
and though i not very good at conversion in C as of yet... it clearly reads the first part as void* and it u are converting to a pointer of handle i think it should be handler*... if that conversion is possible.. i am not sure struct can become function pointers.
Then again how can you declare somethign a void and then conver it to a handler... i don't understand that line so you are best ignoring my advice.... except the bit about trying to change it to handler* then some better programmer can come and correct us both