Skip to contentSkip to conversation

What is permanent memory (rt_task_shadow)

Xenomai-help Anders Blomdell 2 participants 4 messages Nov 24, 2006

lore
Share & tools
lore
#0 lore raw

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

Signature · 5 lines
Anders Blomdell                  Email: [email protected]
Department of Automatic Control
Lund University                  Phone:    +46 46 222 4625
P.O. Box 118                     Fax:      +46 46 138118
SE-221 00 Lund, Sweden
#1 lore raw
Quoted 9 lines · Anders Blomdell

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.

Quoted 15 lines
   void func() {
     RT_TASK task;
     int err;
     err = rt_task_shadow(&task, ...);
     ...  Realtime activities ...
     if (err == 0) {
       rt_task_delete(&task);
     }

}

Regards

Anders Blomdell

Signature · 1 line
Philippe.
#2 lore raw
Quoted 21 lines · Philippe Gerum
Quoted 13 lines · Anders Blomdell

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;
Quoted 6 lines
     err = rt_task_shadow(&task, ...);
     ...  Realtime activities ...
     if (err == 0) {
       rt_task_delete(&task);
     }

}

Quoted 2 lines

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

Signature · 5 lines
Anders Blomdell                  Email: [email protected]
Department of Automatic Control
Lund University                  Phone:    +46 46 222 4625
P.O. Box 118                     Fax:      +46 46 138118
SE-221 00 Lund, Sweden
#3 lore raw
Quoted 22 lines · Anders Blomdell
Quoted 21 lines · Philippe Gerum
Quoted 19 lines · Anders Blomdell

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);
     }

}

Quoted 8 lines
Quoted 2 lines

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.

Quoted 4 lines

Regards

Anders Blomdell

Signature · 1 line
Philippe.