timer.c File Reference

Go to the source code of this file.

Classes

struct  _timer

Defines

#define __DEBUG   0

Typedefs

typedef struct _timer ddekit_timer_t

Enumerations

enum  { DDEKIT_TIMEOUT_NEVER = 0xFFFFFFFF }

Functions

static void dump_list (char *msg)
static void __notify_timer_thread (void)
 Notify the timer thread there is a new timer at the beginning of the timer list.
int ddekit_add_timer (void(*fn)(void *), void *args, unsigned long timeout)
 Add a timer event.
int ddekit_del_timer (int timer)
 Delete timer with the corresponding timer id.
int ddekit_timer_pending (int timer)
 Check whether a timer with a given ID is still pending.
static ddekit_timer_tget_next_timer (void)
 Get the next timer function to run.
static int __timer_sleep (unsigned to)
 Let the timer thread sleep for a while.
static void ddekit_timer_thread (void *arg)
ddekit_thread_tddekit_get_timer_thread ()
 Get the timer thread.
void ddekit_init_timers (void)
 Initialization function, startup timer thread.

Variables

volatile unsigned long jiffies
unsigned long HZ
static ddekit_timer_ttimer_list = NULL
 list of pending timers
static l4lock_t timer_lock = L4LOCK_UNLOCKED
 lock to access timer_list
static l4_threadid_t timer_thread = L4_NIL_ID
 the timer thread
static ddekit_thread_ttimer_thread_ddekit = NULL
 ddekit ID of timer thread
static ddekit_sem_tnotify_semaphore = NULL
 timer thread's wait semaphore
static int timer_id_ctr = 0


Define Documentation

#define __DEBUG   0

Definition at line 16 of file ddekit/src/timer.c.


Typedef Documentation

typedef struct _timer ddekit_timer_t


Enumeration Type Documentation

anonymous enum

Enumerator:
DDEKIT_TIMEOUT_NEVER 

Definition at line 237 of file ddekit/src/timer.c.


Function Documentation

static void __notify_timer_thread ( void   )  [inline, static]

Notify the timer thread there is a new timer at the beginning of the timer list.

Definition at line 65 of file ddekit/src/timer.c.

static int __timer_sleep ( unsigned  to  )  [inline, static]

Let the timer thread sleep for a while.

Parameters:
to timeout in msec
Returns:
1 if IPC timed out 0 if message received -> recalc timeout

Definition at line 249 of file ddekit/src/timer.c.

ddekit_thread_t* ddekit_get_timer_thread ( void   ) 

Get the timer thread.

Definition at line 315 of file ddekit/src/timer.c.

static void ddekit_timer_thread ( void *  arg  )  [static]

Definition at line 277 of file ddekit/src/timer.c.

static void dump_list ( char *  msg  )  [static]

Definition at line 46 of file ddekit/src/timer.c.

static ddekit_timer_t* get_next_timer ( void   )  [static]

Get the next timer function to run.

Returns:
NULL if no timer is to be run now != NULL next timer to execute

Definition at line 220 of file ddekit/src/timer.c.


Variable Documentation

unsigned long HZ

volatile unsigned long jiffies

ddekit_sem_t* notify_semaphore = NULL [static]

timer thread's wait semaphore

Definition at line 42 of file ddekit/src/timer.c.

int timer_id_ctr = 0 [static]

Definition at line 44 of file ddekit/src/timer.c.

ddekit_timer_t* timer_list = NULL [static]

list of pending timers

Definition at line 38 of file ddekit/src/timer.c.

l4lock_t timer_lock = L4LOCK_UNLOCKED [static]

lock to access timer_list

Definition at line 39 of file ddekit/src/timer.c.

l4_threadid_t timer_thread = L4_NIL_ID [static]

the timer thread

Definition at line 40 of file ddekit/src/timer.c.

ddekit ID of timer thread

Definition at line 41 of file ddekit/src/timer.c.


Generated on Wed Apr 11 06:39:16 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6