sched.c File Reference

management of the scheduling data More...

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


Detailed Description

management of the scheduling data

Date:
09/04/2004
Author:
Jork Loeser <jork.loeser@inf.tu-dresden.de>

Definition in file sched.c.


Function Documentation

static int get_max_dp ( int  prio,
sched_t new_ 
) [static]

Get max blocking time due to non-preemption for a thread.

Parameters:
prio prio of the thread to analyze
new_ optional additional thread, not in scheds yet
Returns:
max blocking time due to non-preemption by lower-prioritized threads
This function gets the max blocking time due to non-preemption for a thread of the given priority. Note that only threads with *lower* priority are taken into account, as others do not lead to blocking due to non-preemption but to normal preemption. Normal preemption is handled elsewhere.

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   ) 

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  ) 

int sched_init ( void   ) 

initalize arrays

Return values:
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().

int sched_response_time ( sched_t sched,
int  from,
sched_t new_ 
)

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

Parameters:
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.
Return values:
>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   ) 


Variable Documentation

l4semaphore_t scheds_lock = L4SEMAPHORE_UNLOCKED

Definition at line 22 of file sched.c.

Referenced by lock_scheds(), and unlock_scheds().


CPU reservation server Reference Manual, written by Jork Loeser  © 2004