All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Borkhuis <j.borkhuis@domain.hid>
To: Xenomai-help@domain.hid
Subject: [Xenomai-help] Getting the current RT-state of a task
Date: Mon, 25 Jun 2007 09:46:09 +0200	[thread overview]
Message-ID: <467F72C1.5050306@domain.hid> (raw)

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



             reply	other threads:[~2007-06-25  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25  7:46 Johan Borkhuis [this message]
2007-06-25  8:04 ` [Xenomai-help] Getting the current RT-state of a task Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=467F72C1.5050306@domain.hid \
    --to=j.borkhuis@domain.hid \
    --cc=Xenomai-help@domain.hid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.