Sean McGranaghan wrote:
Hello all,
I am writing an RTDM driver that needs a simple task suspend/resume. I
have a simple ioctl() that needs to initiate some io and then sleep
until an interrupt occurs. I have been trying to use rt_task_suspend()
and rt_task_resume(). I tried to save the calling task id using
rt_task_self() inside open(). When I try to suspend the task in the
ioclt() rt_task_suspend() returns an EINVAL. (I looked at the code and
it appears to fail a magic number test.)
Object descriptors must be exclusively used in the execution space (i.e.
kernel or user) they have been obtained from. Those descriptors are only
containers of some data pointing at the indexed object, therefore they
can be mapped at distinct addresses whilst still representing the same
object -- and they actually do when they belong to different execution
spaces.
I then compared the calling task id before the open() to the task id
inside open() and they are different. Is there a way to retrieve the
calling task id without explicitly sending it to the ioctl()?
suspend/resume are going to be racy for synchronization purpose. It
would be better to use RTDM services (e.g. sema4s), which would fix the
current issue in the same move.
Sean
------------------------------------------------------------------------
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help