L4Re - L4 Runtime Environment
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Fiasco real time scheduling extensions

Real time scheduling extension for the Fiasco L4 implementation. More...

+ Collaboration diagram for Fiasco real time scheduling extensions:

Functions

int l4_rt_add_time slice (l4_threadid_t dest, int prio, int time)
 Add a time slice for periodic execution.
int l4_rt_change_time slice (l4_threadid_t dest, int id, int prio, int time)
 Change a time slice for periodic execution.
int l4_rt_begin_strictly_periodic (l4_threadid_t dest, l4_kernel_clock_t clock)
 Start strictly periodic execution.
int l4_rt_begin_minimal_periodic (l4_threadid_t dest, l4_kernel_clock_t clock)
 Start periodic execution with minimal inter-release times.
int l4_rt_end_periodic (l4_threadid_t dest)
 Stop periodic execution.
int l4_rt_remove (l4_threadid_t dest)
 Remove all reservation scheduling contextsThis function removes all the scheduling contexts that were set up so far for the given thread.
void l4_rt_set_period (l4_threadid_t dest, l4_kernel_clock_t clock)
 Set the length of the periodThis function sets the length of the period for periodic execution.
int l4_rt_next_reservation (unsigned id, l4_kernel_clock_t *clock)
 activate the next time slice (scheduling context)
int l4_rt_next_period (void)
 Wait for the next period, skipping all unused time slices.
l4_threadid_t l4_preemption_id (l4_threadid_t id)
 Return the preemption id of a thread.
l4_threadid_t l4_next_period_id (l4_threadid_t id)
 Return thread-id that flags waiting for the next period.
int l4_rt_generic (l4_threadid_t dest, l4_sched_param_t param, l4_kernel_clock_t clock)
 Generic real-time setup function.

Detailed Description

Real time scheduling extension for the Fiasco L4 implementation.

Function Documentation

int l4_rt_add_time slice ( l4_threadid_t  dest,
int  prio,
int  time 
)
inline

Add a time slice for periodic execution.

Parameters
destthread to add the time slice to
priopriority of the time slice
timelength of the time slice in microseconds
Return values
0OK
-1Error, one of:
  • dest does not exist
  • insufficient MCP (old or new prio>MCP),
  • dest running in periodic mode or transitioning to
  • time quantum 0 or infinite
int l4_rt_change_time slice ( l4_threadid_t  dest,
int  id,
int  prio,
int  time 
)
inline

Change a time slice for periodic execution.

Parameters
destthread whose timing parameters are to change
idnumber of the time-slice to change (rt start at 1)
prionew priority of the time slice
timenew length of the time slice in microseconds, 0: don't change.
Return values
0OK
-1Error, one of:
  • dest does not exist
  • insufficient MCP (old or new prio>MCP),
  • time slice does not exist

This function modifies the priority and optionally the length of an existing time slice of a thread. When calling this function while the time slice is active, the effect may be delayed till the next period.

This function can be called as soon as the denoted time slice was added with l4_rt_add_time slice(). Thus, the thread may have started periodic execution already, but it needs not.

int l4_rt_begin_strictly_periodic ( l4_threadid_t  dest,
l4_kernel_clock_t  clock 
)
inline

Start strictly periodic execution.

Parameters
destthread that starts periodic execution
clockabsolute time to start.
Return values
0OK
-1Error, one of:
  • dest does not exist
  • insufficient MCP (old or new prio>MCP),
  • dest running in periodic mode or transitioning to

Call this function to start the periodic execution after setting up the time slices using l4_rt_add_time slice() and l4_rt_set_period().

By the time specified in clock thread dest must wait for the next period, e.g. by using l4_rt_next_period() or some other IPC with the L4_RT_NEXT_PERIOD flag enabled. Otherwise the transition to periodic mode fails.

Definition at line 81 of file rt_sched-impl.h.

References l4_rt_generic().

+ Here is the call graph for this function:

int l4_rt_begin_minimal_periodic ( l4_threadid_t  dest,
l4_kernel_clock_t  clock 
)
inline

Start periodic execution with minimal inter-release times.

Parameters
destthread that starts periodic execution
clockabsolute time to start.
Return values
0OK
-1Error, one of:
  • dest does not exist
  • insufficient MCP (old or new prio>MCP),
  • dest running in periodic mode or transitioning to

Call this function to start the periodic execution after setting up the time slices using l4_rt_add_time slice() and l4_rt_set_period().

By the time specified in clock thread dest must wait for the next period, e.g. by using l4_rt_next_period() or some other IPC with the L4_RT_NEXT_PERIOD flag enabled. Otherwise the transition to periodic mode fails.

Definition at line 91 of file rt_sched-impl.h.

References l4_rt_generic().

+ Here is the call graph for this function:

int l4_rt_end_periodic ( l4_threadid_t  dest)
inline

Stop periodic execution.

Parameters
destthread that stops periodic execution
Return values
0OK
-1Error, one of:
  • dest does not exist
  • insufficient MCP (old or new prio>MCP),
  • dest not running in periodic mode and not transitioning to

This function aborts the periodic execution of thread dest. Thread dest returns to conventional scheduling then.

Definition at line 101 of file rt_sched-impl.h.

References l4_rt_generic().

+ Here is the call graph for this function:

int l4_rt_remove ( l4_threadid_t  dest)
inline

Remove all reservation scheduling contextsThis function removes all the scheduling contexts that were set up so far for the given thread.

Parameters
destthread the scheduling contexts should be removed from
Return values
0OK
-1Error, one of:
  • dest does not exist
  • insufficient MCP
  • dest running in periodic mode or transitioning to

Definition at line 110 of file rt_sched-impl.h.

References l4_rt_generic().

+ Here is the call graph for this function:

void l4_rt_set_period ( l4_threadid_t  dest,
l4_kernel_clock_t  clock 
)
inline

Set the length of the periodThis function sets the length of the period for periodic execution.

Parameters
destdestination thread
clockperiod length in microseconds. Will be rounded up by the kernel according to the timer granularity.
Returns
This function always succeeds.

Definition at line 119 of file rt_sched-impl.h.

References l4_rt_generic().

+ Here is the call graph for this function:

int l4_rt_next_reservation ( unsigned  id,
l4_kernel_clock_t clock 
)
inline

activate the next time slice (scheduling context)

Parameters
idThe ID of the time slice we think we are on (current time slice)
clockpointer to a l4_kernel_clock_t variable
Return values
0OK, *clock contains the remaining time of the time slice
-1Error, id did not match current time slice

Definition at line 129 of file rt_sched-impl.h.

int l4_rt_next_period ( void  )
inline

Wait for the next period, skipping all unused time slices.

Return values
0OK
!0IPC Error.

Definition at line 155 of file rt_sched-impl.h.

References L4_IPC_BOTH_TIMEOUT_0, l4_ipc_receive(), and l4_next_period_id().

+ Here is the call graph for this function:

l4_threadid_t l4_preemption_id ( l4_threadid_t  id)
inline

Return the preemption id of a thread.

Parameters
idthread
Returns
thread-id of the (virtual) preemption IPC sender

Definition at line 303 of file rt_sched-proto.h.

l4_threadid_t l4_next_period_id ( l4_threadid_t  id)
inline

Return thread-id that flags waiting for the next period.

Parameters
idoriginal thread-id
Returns
modified id, to be used in an IPC, waiting for the next period.

Definition at line 310 of file rt_sched-proto.h.

Referenced by l4_rt_next_period().

+ Here is the caller graph for this function:

int l4_rt_generic ( l4_threadid_t  dest,
l4_sched_param_t  param,
l4_kernel_clock_t  clock 
)
inline

Generic real-time setup function.

Parameters
destdestination thread
paramscheduling parameter
clockclock parameter
Return values
0OK
-1Error.

This function is not meant to be used directly, it is merely used by others.

Definition at line 30 of file rt_sched-impl.h.

Referenced by l4_rt_begin_minimal_periodic(), l4_rt_begin_strictly_periodic(), l4_rt_end_periodic(), l4_rt_remove(), and l4_rt_set_period().

+ Here is the caller graph for this function:

L4Re - L4 Runtime Environment