Real-time shadow services.
[Xenomai scheduler.]


Detailed Description

Real-time shadow services.


Files

file  shadow.c
 Real-time shadow services.


Functions

void xnshadow_harden (xnmutex_t *imutex)
 Migrate a Linux task to the RTAI domain -- INTERNAL.

void xnshadow_relax (void)
 Switch a shadow thread back to the Linux domain -- INTERNAL.

void xnshadow_map (xnthread_t *thread, const char *name, int prio, pid_t syncpid, int *u_syncp, unsigned magic, xnmutex_t *imutex)
 Create a shadow thread context -- INTERNAL.


Function Documentation

void xnshadow_harden xnmutex_t *  imutex  ) 
 

Migrate a Linux task to the RTAI domain -- INTERNAL.

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().

Parameters:
imutex The address of an interface mutex currently held by the caller which will be subject to a lock-breaking preemption before the rescheduling takes place in the __xn_sys_sched service. The ability to pass a mutex through this service is indirectly used by skins when creating a new shadow thread (see xnshadow_map()), thus preventing any deletion while the thread descriptor is accessed by the internal bootstrap code. Passing NULL when no lock-breaking preemption is required is valid. See xnpod_schedule() for more on lock-breaking preemption points.
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.

xnthread_t * xnshadow_map xnthread_t *  thread,
const char *  name,
int  prio,
pid_t  syncpid,
int *  u_syncp,
unsigned  magic,
xnmutex_t *  imutex
 

Create a shadow thread context -- INTERNAL.

Parameters:
thread The descriptor address of the new shadow thread to be mapped to "current".
name An ASCII string standing for the symbolic name of the shadow thread.
prio The base priority of the new thread. This value must range from [minpri .. maxpri] (inclusive) as specified when calling the xnpod_init() service from the skin initialization routine.
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.
magic A magic value aimed at identifying unambiguously the skin to which the shadow belongs to. This value must be non-zero.
imutex The address of an interface mutex currently held by the caller which will be subject to a lock-breaking preemption before the rescheduling takes place in the __xn_sys_sched service. Passing NULL when no lock-breaking preemption is required is valid. See xnpod_schedule() for more on lock-breaking preemption points.
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 -- INTERNAL.

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 Sat Jul 24 19:36:22 2004 for RTAI API by doxygen 1.3.4