Go to the source code of this file.
Functions | |
int | sched_init (void) |
initalize arrays | |
int | sched_index (int prio) |
static int | get_max_dp (int prio, sched_t *new_) |
Get max blocking time due to non-preemption for a thread. | |
int | sched_response_time (sched_t *sched, int from, sched_t *new_) |
Get the response time of the thread s. | |
int | sched_free (int pos) |
Free an element at the given position. | |
int | sched_prepare_free (int pos) |
Ask the watcher of a sched-entry to stop and wait for its readiness. | |
void | lock_scheds (void) |
void | unlock_scheds (void) |
Variables | |
int | sched_cur_threads |
int | sched_max_threads |
sched_t ** | scheds |
l4semaphore_t | scheds_lock = L4SEMAPHORE_UNLOCKED |
Definition in file sched.c.
static int get_max_dp | ( | int | prio, | |
sched_t * | new_ | |||
) | [static] |
Get max blocking time due to non-preemption for a thread.
prio | prio of the thread to analyze | |
new_ | optional additional thread, not in scheds yet |
Definition at line 78 of file sched.c.
References is_dp(), sched_t::prio, sched_cur_threads, and sched_t::wcet.
Referenced by sched_response_time().
void lock_scheds | ( | void | ) |
Definition at line 175 of file sched.c.
References scheds_lock.
Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), l4cpu_reserve_delayed_preempt_component(), l4cpu_reserve_delete_task_component(), l4cpu_reserve_delete_thread_component(), monitor_start(), monitor_thread_dl(), and watch_hit_ts().
int sched_free | ( | int | pos | ) |
Free an element at the given position.
Definition at line 139 of file sched.c.
References sched_t::dl_hist, sched_t::name, sched_cur_threads, sched_t::watch, and sched_t::watcher.
Referenced by l4cpu_reserve_delete_task_component(), and l4cpu_reserve_delete_thread_component().
int sched_index | ( | int | prio | ) |
Definition at line 41 of file sched.c.
References sched_cur_threads.
Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), and l4cpu_reserve_delayed_preempt_component().
int sched_init | ( | void | ) |
initalize arrays
0 | OK | |
-L4_ENOMEM | out of memory |
Definition at line 29 of file sched.c.
References sched_max_threads.
Referenced by main().
int sched_prepare_free | ( | int | pos | ) |
Ask the watcher of a sched-entry to stop and wait for its readiness.
Definition at line 159 of file sched.c.
References sched_cur_threads, sched_t::watcher, and sched_t::watcher_end_sem.
Referenced by l4cpu_reserve_delete_task_component(), and l4cpu_reserve_delete_thread_component().
Get the response time of the thread s.
we do response-time analysis based on the wcet of the higher-prioritized threads with (period T, wcet C) (sometimes called time-demand analysis): Iterative proces: r_j+1 = sum_i { ceil(r_j/T_i)*C_i } until fixpoint is found
sched | contains sched params. If found in scheds, it is not included again | |
from | consider all threads at and above pos | |
new_ | a new thread, that is not in scheds yet, but has higher prio than s. maybe 0. |
>0 | response time, <=deadline | |
-1 | respones time would be>deadline |
Definition at line 109 of file sched.c.
References sched_t::deadline, get_max_dp(), is_dp(), sched_t::period, sched_t::prio, sched_cur_threads, and sched_t::wcet.
Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), l4cpu_reserve_delayed_preempt_component(), and l4cpu_reserve_time_demand_component().
void unlock_scheds | ( | void | ) |
Definition at line 179 of file sched.c.
References scheds_lock.
Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), l4cpu_reserve_delayed_preempt_component(), l4cpu_reserve_delete_task_component(), l4cpu_reserve_delete_thread_component(), monitor_start(), monitor_thread_dl(), and watch_hit_ts().
Definition at line 20 of file sched.c.
Referenced by get_max_dp(), l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), l4cpu_reserve_delayed_preempt_component(), l4cpu_reserve_delete_task_component(), l4cpu_reserve_delete_thread_component(), l4cpu_reserve_scheds_count_component(), l4cpu_reserve_scheds_get_component(), l4cpu_reserve_time_demand_component(), l4cpu_reserve_watch_component(), monitor_start(), monitor_thread_dl(), sched_free(), sched_index(), sched_prepare_free(), sched_response_time(), and watch_hit_ts().
Definition at line 20 of file sched.c.
Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_delayed_preempt_component(), main(), and sched_init().
Definition at line 21 of file sched.c.
Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), l4cpu_reserve_delayed_preempt_component(), l4cpu_reserve_delete_task_component(), l4cpu_reserve_delete_thread_component(), l4cpu_reserve_scheds_get_component(), l4cpu_reserve_time_demand_component(), l4cpu_reserve_watch_component(), monitor_start(), monitor_thread_dl(), and watch_hit_ts().
l4semaphore_t scheds_lock = L4SEMAPHORE_UNLOCKED |