Real-time shadow services.
[RTAI/fusion nucleus.]

Collaboration diagram for Real-time shadow services.:


Detailed Description

Real-time shadow services.


Files

file  shadow.c
 Real-time shadow services.

Functions

static int xnshadow_harden (void)
 Migrate a Linux task to the RTAI 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.


Function Documentation

static int xnshadow_harden void   )  [static]
 

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

Environments:

This service can be called from:

  • User-space thread operating in secondary (i.e. relaxed) mode.

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.

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:
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 RTAI domain from this service.
Returns:
0 is returned on success. Otherwise:
  • -ERESTARTSYS is returned if the current Linux task has received a signal, thus preventing the final migration to the RTAI domain (i.e. in order to process the signal in the Linux domain). This error should not be considered as fatal.

  • -EINVAL is returned if the shadow thread has an invalid base priority. Priority levels must be in the range [ 1..MAX_RT_PRIO-1 ] inclusive.

  • -EPERM is returned if the shadow thread has been killed before the current task had a chance to return to the caller. In such a case, the real-time mapping operation has failed globally, and no RTAI resource remains attached to it.

Environments:

This service can be called from:

  • Regular user-space process.

Rescheduling: always.

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.

Parameters:
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.
Environments:

This service can be called from:

  • User-space thread operating in primary (i.e. harden) mode.

Rescheduling: always.

Note:
"current" is valid here since the shadow runs with the properties of the Linux task.


Generated on Wed Jun 22 22:54:03 2005 for RTAI Fusion API by  doxygen 1.4.1