![]() |
Files | |
file | shadow.c |
Real-time shadow services. | |
Functions | |
int | xnshadow_harden (void) |
Migrate a Linux task to the Xenomai domain. | |
void | xnshadow_relax (int notify) |
Switch a shadow thread back to the Linux domain. | |
int | xnshadow_map (xnthread_t *thread, xncompletion_t __user *u_completion) |
Create a shadow thread context. | |
xnshadow_ppd_t * | xnshadow_ppd_get (unsigned muxid) |
Return the per-process data attached to the calling process. |
int xnshadow_harden | ( | void | ) |
Migrate a Linux task to the Xenomai domain.
For internal use only.
This service causes the transition of "current" from the Linux domain to Xenomai. This is obtained by asking the gatekeeper to resume the shadow mated with "current" then triggering the rescheduling procedure in the Xenomai domain. The shadow will resume in the Xenomai domain as returning from schedule().
Environments:
This service can be called from:
Rescheduling: always.
int xnshadow_map | ( | xnthread_t * | thread, | |
xncompletion_t __user * | u_completion | |||
) |
Create a shadow thread context.
For internal use only.
This call maps a nucleus thread to the "current" Linux task. The priority of the Linux task is set to the priority of the shadow thread bounded to the [0..MAX_RT_PRIO-1] range, and its scheduling policy is set to either SCHED_FIFO for non-zero priority levels, or SCHED_NORMAL otherwise.
thread | The descriptor address of the new shadow thread to be mapped to "current". This descriptor must have been previously initialized by a call to xnpod_init_thread(). | |
u_completion | is the address of an optional completion descriptor aimed at synchronizing our parent thread with us. If non-NULL, the information xnshadow_map() will store into the completion block will be later used to wake up the parent thread when the current shadow has been initialized. In the latter case, the new shadow thread is left in a dormant state (XNDORMANT) after its creation, leading to the suspension of "current" in the Linux domain, only processing signals. Otherwise, the shadow thread is immediately started and "current" immediately resumes in the Xenomai domain from this service. |
Environments:
This service can be called from:
Rescheduling: always.
xnshadow_ppd_t* xnshadow_ppd_get | ( | unsigned | muxid | ) |
Return the per-process data attached to the calling process.
This service returns the per-process data attached to the calling process for the skin whose muxid is muxid. It must be called with nklock locked, irqs off.
See xnshadow_register_interface() documentation for information on the way to attach a per-process data to a process.
muxid | the skin muxid. |
NULL otherwise.
void xnshadow_relax | ( | int | notify | ) |
Switch a shadow thread back to the Linux domain.
For internal use only.
This service yields the control of the running shadow back to Linux. This is obtained by suspending the shadow and scheduling a wake up call for the mated user task inside the Linux domain. The Linux task will resume on return from xnpod_suspend_thread() on behalf of the root thread.
notify | A boolean flag indicating whether threads monitored from secondary mode switches should be sent a SIGXCPU signal. For instance, some internal operations like task exit should not trigger such signal. |
This service can be called from:
Rescheduling: always.