Functions | |
int | l4cpu_reserve_delayed_preempt (l4_threadid_t thread, int id, int prio, int *delay) |
Add delayed preemption reservation for a thread, internal function. | |
int | l4cpu_dp_reserve_task (int *duration) |
Delayed Preemption: Reserve a duration for the whole task. | |
int | l4cpu_dp_remove (void) |
Delayed preemption: Cancel a reservation. | |
int | l4cpu_dp_begin (void) |
Delayed preemption: Start a delayed preemption
After making a dp reservation with l4cpu_dp_reserve_task(), a thread can start an uninterruptible execution. Calls to this function may be nested, and the last call to l4cpu_dp_end() actually leaves the uninterruptible section. | |
int | l4cpu_dp_end (void) |
Delayed preemption: End a delayed preemption
When calling this function, and un-nesting all previous calls to l4cpu_dp_begin(), the thread may be preempted by the kernel again. |
The function-prototypes can be found in <l4/cpu_reserve/sched.h>
The API implementation can be found in the libcpu_reserve.a library.
int l4cpu_dp_begin | ( | void | ) |
Delayed preemption: Start a delayed preemption
After making a dp reservation with l4cpu_dp_reserve_task(), a thread can start an uninterruptible execution. Calls to this function may be nested, and the last call to l4cpu_dp_end() actually leaves the uninterruptible section.
Nesting calls from different threads will be detected and interpreted as an error. Kernel debugger is entered.
0 | OK | |
!0 | Error, e.g. nesting calls from different threads. |
Definition at line 57 of file delayed_preempt.c.
References CONFIG_LOG_DP, l4cpu_dp_start_callback(), pc, preempt_counter, preempt_start, and thread.
int l4cpu_dp_end | ( | void | ) |
Delayed preemption: End a delayed preemption
When calling this function, and un-nesting all previous calls to l4cpu_dp_begin(), the thread may be preempted by the kernel again.
0 | OK. probably someone still in the preemption | |
>0 | OK, DP ended. Time left (in usecs). | |
-L4_ETIME | blocking was too long | |
-L4_EINVAL | DP was not running |
Definition at line 89 of file delayed_preempt.c.
References CONFIG_LOG_DP, CONFIG_LOG_TO_KERN, dp_duration, l4cpu_dp_stop_callback(), pc, preempt_counter, preempt_start, and thread.
int l4cpu_dp_remove | ( | void | ) |
Delayed preemption: Cancel a reservation.
0 | OK | |
!0 | Error. |
int l4cpu_dp_reserve_task | ( | int * | duration | ) |
Delayed Preemption: Reserve a duration for the whole task.
duration | time (microseconds) |
duration | contains the actually reserved time. | |
0 | OK | |
!0 | Error. |
With future kernel releases, that might include real kernel support for DP, the task abstraction might be hard to implement, and support for DP must be programmed more explicitely. Think of interrupt threads that are created by DDE internally.
Definition at line 39 of file delayed_preempt.c.
References dp_duration, and l4cpu_reserve_delayed_preempt().
int l4cpu_reserve_delayed_preempt | ( | l4_threadid_t | thread, | |
int | id, | |||
int | prio, | |||
int * | delay | |||
) |
Add delayed preemption reservation for a thread, internal function.
thread | thread to add delayed preemption (DP) to | |
id | id of the timeslice to add DP to | |
prio | sensitive priority of DP, once it is activated. (Ignored and assumed to be 255, see note.) | |
delay | max. duration of DP. Will be rounded up according to kernel capabilities and returned. |
0 | OK | |
!0 | Error |
The delayed preemption reservation will be removed when the reservations for the thread are removed.
Definition at line 73 of file clientlib.c.
References server_id, and server_init().
Referenced by l4cpu_dp_reserve_task().