[okl4-developer] Interrupts
Geoffrey Lee
glee at ok-labs.com
Mon Jun 2 20:50:43 EST 2008
On Mon, Jun 02, 2008 at 12:38:34PM +0200, Sebastian Huß wrote:
> Hi,
>
>
>
> I'm trying to implement some interrupt handling, but my approaches don't work yet.
>
>
>
> First approach: using the [irq_handler] - flag in the corresponding idl4-file
>
> The correct server code is generated and I have the handler-function:
Hi Sebastian
In the latest OKL4 2.1 release the interrupts are normally assigned
statically at build time. You do this by editing the machines.py
file located in platforms/*/tools/machines.py.
In OKL4 2.1 we migrated the interrupt IPC model from being synchronous
to asynchronous, but the old IRQ handler was left lying around, which
I think is the cause of some of your confusion. Take a look
at the vserial_async_handler() in the vserial driver which should
hopefully clear things up.
-gl
>
>
>
> void
>
> testdriver_irq_handler(L4_ThreadId_t partner)
>
> {
>
> printf("IRQ%d, function %d is called!\n", (int)L4_ThreadNo(partner), funcNum);
>
> }
>
>
>
>
>
> int main(int argc, char **argv)
>
> {
>
> L4_ThreadId_t main_tid;
>
>
>
> main_tid = thread_l4tid(env_thread(iguana_getenv("MAIN")));
>
>
>
> hardware_register_interrupt(main_tid, 11);
>
>
>
> printf("<===== Testdriver Started =====>\n");
>
> testdriver_server_loop();
>
> assert(!"Shouldn't reach here\n");
>
> }
>
>
>
> I let it all run in a modified qemu where I can initiate interrupts (and this works with another flavor of L4),
>
> but no interrupts get through to my irq_handler.
>
>
>
> In another attempt I dismissed the middle-man (the server_loop and the irq_handler-function)
>
> And implemented according to another example here in the mailing list, still no results.
>
>
>
>
>
> int main(int argc, char **argv)
>
> {
>
> L4_ThreadId_t main_tid;
>
> L4_ThreadId_t from_tid;
>
> main_tid = thread_l4tid(env_thread(iguana_getenv("MAIN")));
>
>
>
> hardware_register_interrupt(main_tid, 11);
>
>
>
> printf("<===== Testdriver Started =====>\n");
>
>
>
> for(;;)
>
> {
>
> L4_Wait(&from_tid);
>
> printf("from_tid %d is called!\n", (int)L4_ThreadNo(from_tid));
>
> }
>
> }
>
>
>
>
>
> Additionally, I tried all this with the following (to see anything), without results.
>
>
>
> for(int i=0;i<45;i++)
>
> {
>
> hardware_register_interrupt(main_tid, i);
>
> }
>
>
>
> I think I must be missing something, but I found nothing even grepping through the sources.
>
>
>
>
>
> Thanks in advance,
>
> Sebastian
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
--
More information about the Developer
mailing list