[okl4-developer] About register IRQ and ISR on Iguana application
Carl van Schaik
carl at ok-labs.com
Mon Feb 4 10:27:58 EST 2008
Hi Kashin,
Interrupts in OKL4 are registered against a handler thread and not a
function. Ie. when an interrupt triggers, the kernel will send the
handler thread an IPC message. Thus you can only register interrupts
with a thread-id and not a function pointer. The message is sent from a
virtual interrupt thread with thread number equal to interrupt number,
eg L4_GlobalId(irq, 1)
After registering for an interrupt, the handler thread can do something
like L4_Wait(&from_tid) and needs to then check if from_tid is the
thread-id of the interrupt source.
eg
L4_Wait(&from_tid)
// check for error here
// check if interrupt recieved
if (L4_ThreadNo(from_tid) == irq)
{
/// do somthing
L4_Reply(from_tid); // ack interrupt
}
regards,
Carl
kashin Lin wrote:
> Hi,
>
> i noticed that there is a function named
> "hardware_register_interrupt" which seems what i need.
> but the first parameter's type is "L4_ThreadId_t" not a function point
> i expect, so i'm confused how to use it.
>
> can anyone show me a simple code snip about how to use it?
> for instance, the ISR "func_A" service the IRQ # "B"
>
> thanks for your help.
>
>
> best,
> kashin lin
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>
More information about the Developer
mailing list