* [Xenomai-help] What is permanent memory (rt_task_shadow)
@ 2006-11-24 11:46 Anders Blomdell
2006-11-24 12:25 ` Philippe Gerum
0 siblings, 1 reply; 4+ messages in thread
From: Anders Blomdell @ 2006-11-24 11:46 UTC (permalink / raw)
To: xenomai
The documentation for rt_task_shadow says:
task The address of a task descriptor Xenomai will use to store the
task-related data. This descriptor must always be valid while
the task is active therefore it must be allocated in permanent
memory.
Is it correct to assume that it is OK to the following:
void func() {
RT_TASK task;
int err;
err = rt_task_shadow(&task, ...);
... Realtime activities ...
if (err == 0) {
rt_task_delete(&task);
}
}
Regards
Anders Blomdell
--
Anders Blomdell Email: anders.blomdell@domain.hid
Department of Automatic Control
Lund University Phone: +46 46 222 4625
P.O. Box 118 Fax: +46 46 138118
SE-221 00 Lund, Sweden
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] What is permanent memory (rt_task_shadow)
2006-11-24 11:46 [Xenomai-help] What is permanent memory (rt_task_shadow) Anders Blomdell
@ 2006-11-24 12:25 ` Philippe Gerum
2006-11-24 13:31 ` Anders Blomdell
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Gerum @ 2006-11-24 12:25 UTC (permalink / raw)
To: Anders Blomdell; +Cc: xenomai
On Fri, 2006-11-24 at 12:46 +0100, Anders Blomdell wrote:
> The documentation for rt_task_shadow says:
>
> task The address of a task descriptor Xenomai will use to store the
> task-related data. This descriptor must always be valid while
> the task is active therefore it must be allocated in permanent
> memory.
>
> Is it correct to assume that it is OK to the following:
>
Yes, even if it relies on the assumption that func() will never unwind
its stack space before it self-destroys.
> void func() {
> RT_TASK task;
> int err;
>
> err = rt_task_shadow(&task, ...);
> ... Realtime activities ...
> if (err == 0) {
> rt_task_delete(&task);
> }
> }
>
> Regards
>
> Anders Blomdell
>
--
Philippe.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] What is permanent memory (rt_task_shadow)
2006-11-24 12:25 ` Philippe Gerum
@ 2006-11-24 13:31 ` Anders Blomdell
2006-11-24 13:47 ` Philippe Gerum
0 siblings, 1 reply; 4+ messages in thread
From: Anders Blomdell @ 2006-11-24 13:31 UTC (permalink / raw)
To: rpm; +Cc: xenomai
Philippe Gerum wrote:
> On Fri, 2006-11-24 at 12:46 +0100, Anders Blomdell wrote:
>> The documentation for rt_task_shadow says:
>>
>> task The address of a task descriptor Xenomai will use to store the
>> task-related data. This descriptor must always be valid while
>> the task is active therefore it must be allocated in permanent
>> memory.
>>
>> Is it correct to assume that it is OK to the following:
>>
>> void func() {
>> RT_TASK task;
>> int err;
>>
>> err = rt_task_shadow(&task, ...);
>> ... Realtime activities ...
>> if (err == 0) {
>> rt_task_delete(&task);
>> }
>> }
>
> Yes, even if it relies on the assumption that func() will never unwind
> its stack space before it self-destroys.
OK, good. Follow-up question:
Is there any way to do the inverse of rt_task_shadow (since
the answer above implies that rt_task_delete will destroy the
linux task as well)?
Regards
Anders Blomdell
--
Anders Blomdell Email: anders.blomdell@domain.hid
Department of Automatic Control
Lund University Phone: +46 46 222 4625
P.O. Box 118 Fax: +46 46 138118
SE-221 00 Lund, Sweden
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] What is permanent memory (rt_task_shadow)
2006-11-24 13:31 ` Anders Blomdell
@ 2006-11-24 13:47 ` Philippe Gerum
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-11-24 13:47 UTC (permalink / raw)
To: Anders Blomdell; +Cc: xenomai
On Fri, 2006-11-24 at 14:31 +0100, Anders Blomdell wrote:
> Philippe Gerum wrote:
> > On Fri, 2006-11-24 at 12:46 +0100, Anders Blomdell wrote:
> >> The documentation for rt_task_shadow says:
> >>
> >> task The address of a task descriptor Xenomai will use to store the
> >> task-related data. This descriptor must always be valid while
> >> the task is active therefore it must be allocated in permanent
> >> memory.
> >>
> >> Is it correct to assume that it is OK to the following:
> >>
> >> void func() {
> >> RT_TASK task;
> >> int err;
> >>
> >> err = rt_task_shadow(&task, ...);
> >> ... Realtime activities ...
> >> if (err == 0) {
> >> rt_task_delete(&task);
> >> }
> >> }
> >
> > Yes, even if it relies on the assumption that func() will never unwind
> > its stack space before it self-destroys.
> OK, good. Follow-up question:
>
> Is there any way to do the inverse of rt_task_shadow (since
> the answer above implies that rt_task_delete will destroy the
> linux task as well)?
>
No interface currently exists for that, even if technically, this could
be done by simply unmapping the shadow (needs a bit more thought for
corner cases, but still, there should be no showstopper). This would be
safe only against the current Linux task though.
> Regards
>
> Anders Blomdell
>
--
Philippe.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-11-24 13:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-24 11:46 [Xenomai-help] What is permanent memory (rt_task_shadow) Anders Blomdell
2006-11-24 12:25 ` Philippe Gerum
2006-11-24 13:31 ` Anders Blomdell
2006-11-24 13:47 ` 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.