All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] 3rd party task mode switches and inquiries
@ 2006-10-09 16:38 Jeff Weber
  2006-10-09 17:51 ` Jan Kiszka
  2006-10-09 18:14 ` Philippe Gerum
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Weber @ 2006-10-09 16:38 UTC (permalink / raw)
  To: Xenomai

I have a need for task t1 to switch task t2 to and from primary mode,
using the native API.  The rt_task_set_mode() API does not have an
argument for the target task, and assumes the current task.  How can I
initiate a 3rd party task mode switch?

On a related note, the task info returned from rt_task_inquire() does
not indicate task mode switches in the corresponding T_PRIMARY (0x200)
bit, which is the bit used to command the mode switch.  However, a mode
switch can be seen in the 0x100 status bit, which corresponds to the
XNRELAX bit, (not in the public native/task.h API).  What's the best way
to inquire if an arbitrary task is in primary or secondary mode?

I am using Xenomai-2.2.0.

thanks,
	Jeff Weber



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

* Re: [Xenomai-help] 3rd party task mode switches and inquiries
  2006-10-09 16:38 [Xenomai-help] 3rd party task mode switches and inquiries Jeff Weber
@ 2006-10-09 17:51 ` Jan Kiszka
  2006-10-09 18:00   ` Jan Kiszka
  2006-10-09 18:14 ` Philippe Gerum
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2006-10-09 17:51 UTC (permalink / raw)
  To: Jeff Weber; +Cc: Xenomai

[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]

Jeff Weber wrote:
> I have a need for task t1 to switch task t2 to and from primary mode,
> using the native API.  The rt_task_set_mode() API does not have an
> argument for the target task, and assumes the current task.  How can I
> initiate a 3rd party task mode switch?

Umm, could you explain why you need this? Sounds a bit weird to me.

We basically have this feature to support RTDM drivers that provide
mode-dependent (overloaded) services like resource allocation from Linux
vs. real-time pools. Normally, you should not need to touch the mode
explicitly, Xenomai will switch for you when required and feasible.

> 
> On a related note, the task info returned from rt_task_inquire() does
> not indicate task mode switches in the corresponding T_PRIMARY (0x200)
> bit, which is the bit used to command the mode switch.  However, a mode
> switch can be seen in the 0x100 status bit, which corresponds to the
> XNRELAX bit, (not in the public native/task.h API).  What's the best way
> to inquire if an arbitrary task is in primary or secondary mode?

I would say there is no official way yet, but I think we should create
one, likely by translating XNRELAX to the native-specific T_PRIMARY
flag. Should be trivial.

> 
> I am using Xenomai-2.2.0.
> 
> thanks,
> 	Jeff Weber
> 

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

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

* Re: [Xenomai-help] 3rd party task mode switches and inquiries
  2006-10-09 17:51 ` Jan Kiszka
@ 2006-10-09 18:00   ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2006-10-09 18:00 UTC (permalink / raw)
  To: Jeff Weber; +Cc: Xenomai

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Jan Kiszka wrote:
> Jeff Weber wrote:
>> I have a need for task t1 to switch task t2 to and from primary mode,
>> using the native API.  The rt_task_set_mode() API does not have an
>> argument for the target task, and assumes the current task.  How can I
>> initiate a 3rd party task mode switch?
> 
> Umm, could you explain why you need this? Sounds a bit weird to me.

Or do you mean more than just T_PRIMARY? Still, manipulating a remote
task that way can be fairly dangerous (T_LOCK, T_NOSIG). It's at least
as "evil" as rt_task_suspend(someone_else). ;)

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

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

* Re: [Xenomai-help] 3rd party task mode switches and inquiries
  2006-10-09 16:38 [Xenomai-help] 3rd party task mode switches and inquiries Jeff Weber
  2006-10-09 17:51 ` Jan Kiszka
@ 2006-10-09 18:14 ` Philippe Gerum
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-10-09 18:14 UTC (permalink / raw)
  To: Jeff Weber; +Cc: Xenomai

On Mon, 2006-10-09 at 11:38 -0500, Jeff Weber wrote:
> I have a need for task t1 to switch task t2 to and from primary mode,
> using the native API.  The rt_task_set_mode() API does not have an
> argument for the target task, and assumes the current task.  How can I
> initiate a 3rd party task mode switch?
> 

You can't, it's forbidden. Too many indirect issues would become
possible as a result of allowing that. Only the current task can switch
its own mode.

> On a related note, the task info returned from rt_task_inquire() does
> not indicate task mode switches in the corresponding T_PRIMARY (0x200)
> bit, which is the bit used to command the mode switch.  However, a mode
> switch can be seen in the 0x100 status bit, which corresponds to the
> XNRELAX bit, (not in the public native/task.h API).  What's the best way
> to inquire if an arbitrary task is in primary or secondary mode?
> 

Testing XNRELAX is the current way to do it, since no native interface
exists yet. Before this happens, there's some sanitization to do first
(e.g. if T_PRIMARY is used to switch mode, it should be usable to check
the status word too, instead of having T_SECONDARY as XNRELAX but which
could not be used for switching modes).

> I am using Xenomai-2.2.0.
> 
> thanks,
> 	Jeff Weber
> 
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




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

end of thread, other threads:[~2006-10-09 18:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-09 16:38 [Xenomai-help] 3rd party task mode switches and inquiries Jeff Weber
2006-10-09 17:51 ` Jan Kiszka
2006-10-09 18:00   ` Jan Kiszka
2006-10-09 18:14 ` 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.