[okl4-developer] About register IRQ and ISR on Iguana application

kashin Lin kashin08 at gmail.com
Tue Feb 5 19:52:23 EST 2008


Hi Carl,

thanks for your reply.

i still have some questions:
1. something we have to do in ISR (ex: clear interrupt) should be placed in
"//do somthing"
    or when we call "L4_Reply(from_tid)" L4 will take care this?

2. how to create a thread which execute the function we specify?
   (sorry that i'm not familiar with it.)

thanks for your help again

best regards,
kashin lin

2008/2/4, Carl van Schaik <carl at ok-labs.com>:
>
> 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
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080205/70eaeaf4/attachment.htm 


More information about the Developer mailing list