IRQ and C++ ...
Posted: Sat Nov 25, 2006 7:39 am
Hi guys...
when i was trying to rewrite my os using C++
and at function "void irq_handler(struct regs *r)"
i got this error:
i tryied everything but nothing work.
i'm using DJGPP and nasm
Thanx.
when i was trying to rewrite my os using C++
and at function "void irq_handler(struct regs *r)"
i got this error:
it was working in my c file,and i know its problem about typesinvalid conversion from 'void*' to 'void (*)(regs*)'
i tryied everything but nothing work.
Code: Select all
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);
}
Thanx.