2 * linux/include/asm-cris/fasttimer.h
4 * Fast timers for ETRAX100LX
5 * This may be useful in other OS than Linux so use 2 space indentation...
6 * Copyright (C) 2000, 2001, 2002, 2003 Axis Communications AB
9 #include <linux/config.h>
10 #include <linux/time.h> /* struct timeval */
11 #include <linux/timex.h>
13 /* The timer0 values gives 52us resolution (1/19200) or higher
14 * but interrupts at HZ
16 /* We use timer1 to generate interrupts at desired times. */
18 #ifdef CONFIG_ETRAX_FAST_TIMER
20 typedef void fast_timer_function_type(unsigned long);
22 struct fast_timer { /* Close to timer_list */
23 struct fast_timer *next;
24 struct fast_timer *prev;
25 struct timeval tv_set;
26 struct timeval tv_expires;
27 unsigned long delay_us;
28 fast_timer_function_type *function;
33 extern struct fast_timer *fast_timer_list;
35 void start_one_shot_timer(struct fast_timer *t,
36 fast_timer_function_type *function,
38 unsigned long delay_us,
41 int del_fast_timer(struct fast_timer * t);
42 /* return 1 if deleted */
44 extern inline int fast_timer_pending (const struct fast_timer * t)
46 return (t->next != NULL) || (t->prev != NULL) || (t == fast_timer_list);
49 void schedule_usleep(unsigned long us);
52 void fast_timer_init(void);