include/sched.h File Reference

CPU reservation prototypes. More...

Go to the source code of this file.

Defines

#define l4cpu_reserve_name   "cpu_res"

Functions

int l4cpu_reserve_add (l4_threadid_t thread, const char *name, int prio, int period, int *wcet, int deadline, int *id)
 Make a reservation.
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_reserve_change (l4_threadid_t thread, int id, int new_prio, int *new_wcet, int new_deadline)
 Change the reservation of a thread.
int l4cpu_reserve_delete_thread (l4_threadid_t thread)
 Remove the reservations of a thread.
int l4cpu_reserve_delete_task (l4_threadid_t task)
 Remove the reservations of a task.
int l4cpu_reserve_begin_strictly_periodic (l4_threadid_t thread, l4_kernel_clock_t clock)
 Start strictly periodic execution.
int l4cpu_reserve_begin_strictly_periodic_self (l4_threadid_t me)
 Start strictly periodic execution of own thread ASAP.
int l4cpu_reserve_begin_strictly_periodic_self_deprecated (l4_threadid_t me, l4_kernel_clock_t clock)
 Deprecated version with timeout, which is unsafe.
int l4cpu_reserve_begin_minimal_periodic (l4_threadid_t thread, l4_kernel_clock_t clock)
 Start periodic execution with minimal interrelease times.
int l4cpu_reserve_begin_minimal_periodic_self (l4_threadid_t thread)
 Start periodic execution with minimal interrelease times, own thread.
int l4cpu_reserve_begin_minimal_periodic_self_deprecated (l4_threadid_t thread, l4_kernel_clock_t clock)
int l4cpu_reserve_end_periodic (l4_threadid_t thread)
 Stop periodic execution.
int l4cpu_reserve_watch (l4_threadid_t thread, unsigned **addr)
 Watch exception IPCs for the given thread.
int l4cpu_reserve_scheds_count (void)
 Return the number of reservations made.

Use this function for debugging/monitoring purposes.

int l4cpu_reserve_scheds_get (int idx, char **name, l4_threadid_t *thread, l4_threadid_t *creator, int *id, int *prio, int *period, int *wcet, int *deadline)
 Return a given reservation.
int l4cpu_reserve_time_demand (l4_threadid_t thread, int id)
 Return response time of given thread.
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_active (void)
 Return if DP is currently running.
void l4cpu_dp_start_callback (void) __attribute__((weak))
 Callback for start of DP section.
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.

void l4cpu_dp_stop_callback (unsigned diff, void *eip) __attribute__((weak))
 Callback for end of DP 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.

int l4cpu_reserve_dump (void)
 Get the reservations at the reservation server and dump them.
int l4cpu_reserve_wait_periodic (l4_threadid_t parent)
int l4cpu_reserve_wait_periodic_ready (int mode, l4_threadid_t child, l4_kernel_clock_t clock)

Variables

void * l4cpu_dp_pc


Detailed Description

CPU reservation prototypes.

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

Definition in file include/sched.h.


Define Documentation

#define l4cpu_reserve_name   "cpu_res"

Definition at line 20 of file include/sched.h.

Referenced by main(), and server_init().


Function Documentation

int l4cpu_dp_active ( void   ) 

Return if DP is currently running.

Definition at line 53 of file delayed_preempt.c.

References preempt_counter.

void l4cpu_dp_start_callback ( void   ) 

Callback for start of DP section.

This function is called if an delayed preemption actually starts.

Referenced by l4cpu_dp_begin().

void l4cpu_dp_stop_callback ( unsigned  diff,
void *  eip 
)

Callback for end of DP section.

This function is called if an delayed preemption actually ends, this is when all nested start calls have their stop calls.

Parameters:
diff the time the delayed preemption was active
eip the eip that started the delayed preemption

Referenced by l4cpu_dp_end().

int l4cpu_reserve_begin_minimal_periodic_self_deprecated ( l4_threadid_t  thread,
l4_kernel_clock_t  clock 
)

Definition at line 201 of file clientlib.c.

References server_id, and server_init().

int l4cpu_reserve_begin_strictly_periodic_self_deprecated ( l4_threadid_t  me,
l4_kernel_clock_t  clock 
)

Deprecated version with timeout, which is unsafe.

Definition at line 160 of file clientlib.c.

References server_id, and server_init().

int l4cpu_reserve_dump ( void   ) 

Get the reservations at the reservation server and dump them.

Definition at line 21 of file convenience.c.

References l4cpu_reserve_scheds_count(), l4cpu_reserve_scheds_get(), and thread.

int l4cpu_reserve_time_demand ( l4_threadid_t  thread,
int  id 
)

Return response time of given thread.

Parameters:
thread thread id
id timeslice id
Return values:
>=0 worst-case response time according to given reservations
-L4_ETIME response-time larger than period (or deadline, if set) of the thread
-L4_EINVAL thread/timeslice not registered.

Definition at line 291 of file clientlib.c.

References server_id, and server_init().

int l4cpu_reserve_wait_periodic ( l4_threadid_t  parent  ) 

Definition at line 20 of file startperiodic.c.

int l4cpu_reserve_wait_periodic_ready ( int  mode,
l4_threadid_t  child,
l4_kernel_clock_t  clock 
)


Variable Documentation

void* l4cpu_dp_pc


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