[okl4-developer] Bug in multithread Example

Martin Lawitzky Martin.Lawitzky at nicta.com.au
Wed Mar 5 22:58:03 EST 2008


Hi OKL,

whoever wrote the multithread example, he owes me an evening. ;) Just kidding, but it took stupid me a few hours.


This is an excerpt from the code (multithread.c) shipped with OKL4, latest release:

    ....

    L4_MsgClear(&msg);
    L4_Set_MsgLabel(&msg, 0x1);
    L4_MsgLoad(&msg);


    /* Go! */
    tag = L4_Call(thread_l4tid(second_thread));

    ....


Unfortunately, thread_l4tid() trashes the MSRs. Hence, all the MsgClear Set_MsgLabel and MsgLoad is irrelevant.

I tried to figure out how to send any useful stuff in the message registers. I always received just trash at the callee.
I checked every single line in the IPC path before I found out, that thread_l4tid() is more than an innocent macro.

Now I know, but maybe you should insert a tiny comment in the example for the next release. Or better don't nest the thread_L4tid function in the L4_Call to make the 3 lines above even somewhat useful.


Cheers,

Martin




More information about the Developer mailing list