Real time scheduling extension for the Fiasco L4 implementation.
More...
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
-
| dest | thread to add the time slice to |
| prio | priority of the time slice |
| time | length of the time slice in microseconds |
- Return values
-
| 0 | OK |
| -1 | Error, 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
-
| dest | thread whose timing parameters are to change |
| id | number of the time-slice to change (rt start at 1) |
| prio | new priority of the time slice |
| time | new length of the time slice in microseconds, 0: don't change. |
- Return values
-
| 0 | OK |
| -1 | Error, 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.
Start strictly periodic execution.
- Parameters
-
| dest | thread that starts periodic execution |
| clock | absolute time to start. |
- Return values
-
| 0 | OK |
| -1 | Error, 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().
Start periodic execution with minimal inter-release times.
- Parameters
-
| dest | thread that starts periodic execution |
| clock | absolute time to start. |
- Return values
-
| 0 | OK |
| -1 | Error, 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().
| int l4_rt_end_periodic |
( |
l4_threadid_t |
dest | ) |
|
|
inline |
Stop periodic execution.
- Parameters
-
| dest | thread that stops periodic execution |
- Return values
-
| 0 | OK |
| -1 | Error, 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().
| 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
-
| dest | thread the scheduling contexts should be removed from |
- Return values
-
| 0 | OK |
| -1 | Error, 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().
Set the length of the periodThis function sets the length of the period for periodic execution.
- Parameters
-
| dest | destination thread |
| clock | period 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().
activate the next time slice (scheduling context)
- Parameters
-
| id | The ID of the time slice we think we are on (current time slice) |
| clock | pointer to a l4_kernel_clock_t variable |
- Return values
-
| 0 | OK, *clock contains the remaining time of the time slice |
| -1 | Error, id did not match current time slice |
Definition at line 129 of file rt_sched-impl.h.
| int l4_rt_next_period |
( |
void |
| ) |
|
|
inline |
| l4_threadid_t l4_preemption_id |
( |
l4_threadid_t |
id | ) |
|
|
inline |
Return the preemption id of a thread.
- Parameters
-
- 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
-
- 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().