Real-time shadow services.
[Xenomai nucleus.]


Detailed Description

Real-time shadow services.


Files

file  shadow.c
 Real-time shadow services.

Functions

void xnshadow_harden (void)
 Migrate a Linux task to the RTAI domain.
void xnshadow_relax (void)
 Switch a shadow thread back to the Linux domain .
void xnshadow_map (xnthread_t *thread, pid_t syncpid, int *u_syncp)
 Create a shadow thread context.


Function Documentation

void xnshadow_harden void   ) 
 

Migrate a Linux task to the RTAI domain.

For internal use only.

This service causes the transition of "current" from the Linux domain to RTAI. This is obtained by asking the gatekeeper to resume the shadow mated with "current" then triggering the rescheduling procedure in the RTAI domain. The shadow will resume in the RTAI domain as returning from schedule().

Side-effect: This routine indirectly triggers the rescheduling procedure (see __xn_sys_sched service).

Context: This routine must be called on behalf of a user-space task from the Linux domain.

void xnshadow_map xnthread_t *  thread,
pid_t  syncpid,
int *  u_syncp
 

Create a shadow thread context.

For internal use only.

This call maps a nucleus thread to the "current" Linux task.

Parameters:
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().
Warning:
The thread must have been set the same magic number (i.e. xnthread_set_magic()) than the one used to register the skin it belongs to. Failing to do so leads to unexpected results.
Parameters:
syncpid If non-zero, this must be the pid of a Linux task to wake up when the shadow has been initialized. In this case, u_syncp must be valid to, and the new shadow thread is left in a dormant state (XNDORMANT) after its creation, leading to the suspension of "current" in the RTAI domain. Otherwise, the shadow thread is immediately started and "current" exits from this service without being suspended.
u_syncp If non-zero, this must be a pointer to an integer variable into the caller's address space in user-space which will be used as a semaphore. This semaphore will be posted to wakeup the task identified by pid before "current" is suspended in dormant state by this service. The awaken Linux task is expected to invoke a syscall hat ends up calling xnshadow_start() to finally start the newly created shadow. Passing a null pointer here has the same effect as passing a zero pid argument, and there will be no attempt to wake up any task.
Side-effect: This routine indirectly calls the rescheduling procedure.

Context: This routine must be called on behalf of the Linux user-space task which is being shadowed.

void xnshadow_relax void   ) 
 

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.

Side-effect: This routine indirectly calls the rescheduling procedure.

Context: This routine must be called on behalf of a real-time shadow inside the RTAI domain.


Generated on Mon Aug 30 13:58:39 2004 for RTAI API by doxygen 1.3.8