All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Getting the current RT-state of a task
@ 2007-06-25  7:46 Johan Borkhuis
  2007-06-25  8:04 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Borkhuis @ 2007-06-25  7:46 UTC (permalink / raw)
  To: Xenomai-help

I am building an OS-abstraction layer for our application, and for this 
I would like to know the RT-status of a task.
Using the rt_task_set_mode function it is possible to switch between RT 
and non-RT (using T_PRIMARY). But I would like to know what the state is 
of the current task. I did not find a function to retrieve the RT-state 
of a task; is a function available that will return the status of a task?

For the moment I am using the code shown below. Does this code work:

    rt_task_set_mode(0,0, &var);
    if(var&T_PRIMARY)
    {   /* Primary mode */
        ....
    }
    else
    {   /* Secondary mode */
        ....
    }

I would like to use this for a printf-implementation, where the text is 
printed if the task is non-RT or send to a logging task is the task is 
RT. I would like to call this code from Xenomai tasks, but also from 
plain Linux tasks. Is this possible?

Kind regards,
    Johan Borkhuis



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-25  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-25  7:46 [Xenomai-help] Getting the current RT-state of a task Johan Borkhuis
2007-06-25  8:04 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.