Re: [pok-devel] hello i have some question about semaphore!

[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]


On 08/12/2011 04:42 AM, 김정석 wrote:
hello
these day i write code for application on POK
my application require semaphore.
so i used "pok_sem_create()" function.


uint8_t sid;
pok_ret_t ret;
ret = pok_sem_create(&sid , 5, 5, POK_SEMAPHORE_DISCIPLINE_FIFO);
printf("pok_sem_create return=%d, mid=%d\n", ret, sid);

but
i received message
*" pok_sem_create return=1, mid=0 "*

so i ran the pok example about [semaphore]
but i also received same message.

i guess that return code 1 is invalid argument.
so can u check the semaphore function ?
and can u show me the code example?

Check at errno.h, the return code 1 corresponds to EINVAL, that is in fact an invalid argument.


how do i solve this problem ?

I can't help a really good help because you just copy/paste the code that is similar to the example. I think you should look at the *NB_LOCKOBJECTS macro to configure your kernel and make sure that each partition can own a correct number of lock objects. You can look at arinc653-events example for that (how to configure your kernel). You must also configure the partitions to include the appropriate service. So, please check that you configure correctly the partition _and_ the kernel.

However, please note that the semaphore function might have some issues since most of POK services is used by Ocarina generated code and ocarina doesn't use the semaphore layer since a long time. Also, if you find a bug or ned to fix some functions, your patch will be welcome and kindly integrated in the main branch.

Please also note that the previous bug you reported (about the network issue) was solved in previous Ocarina version and that it works again !

Best,



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/