2 * http://devel.0cpm.org/ -- Open source firmware for SIP phones.
14 /* The bottom defines a few useful things:
15 * typedef uint..._t timing_t;
16 * #define TIME_MSEC(x) ...
17 * #define TIME_SEC(x) ...
18 * #define TIME_BEOFRE(x,y) ...
19 * The former can be used as a parameter without pointers;
20 * the TIME_xxx define such periods in terms of that time.
24 /* Timer drivers are split in a top half and a bottom half. The top half is generic, the
25 * bottom half is device-specific. The bottom half routines start with bottom_irqtimer_
26 * while the top half functions start with irqtimer_
28 * The bottom system is only aware of the time of the next hardware-raised interrupt.
29 * The top system maintains a timeout-ordered queue of interrupts to raise.
32 typedef struct irqtimer_type irqtimer_t;
33 struct irqtimer_type {
39 /* Managing functions for kernel-defined timers */
40 void irqtimer_start (irqtimer_t *tmr, timing_t delay, irq_handler_t hdl, priority_t prio);
41 void irqtimer_restart (irqtimer_t *tmr, timing_t intval);
42 void irqtimer_stop (irqtimer_t *tmr);
45 /* Top-half operations to manipulate timers */
46 void top_timer_expiration (timing_t exptime);
49 /* Bottom-half operations to manipulate the next timer interrupt */
50 timing_t bottom_time (void);
51 timing_t bottom_timer_set (timing_t nextirq);