1/* $Id: fasttimer.h,v 1.1.1.1 2008/10/15 03:29:00 james26_jang Exp $
2 * linux/include/asm-cris/fasttimer.h
3 *
4 * Fast timers for ETRAX100LX
5 * This may be useful in other OS than Linux so use 2 space indentation...
6 * Copyright (C) 2000, 2002 Axis Communications AB
7 */
8#include <linux/config.h>
9#include <linux/time.h> /* struct timeval */
10#include <linux/timex.h>
11
12/* The timer0 values gives 52us resolution (1/19200) or higher
13 * but interrupts at HZ
14 */
15/* We use timer1 to generate interrupts at desired times. */
16
17#ifdef CONFIG_ETRAX_FAST_TIMER
18
19typedef void fast_timer_function_type(unsigned long);
20
21struct fast_timer{ /* Close to timer_list */
22  struct fast_timer *next;
23  struct fast_timer *prev;
24  struct timeval tv_set;
25  struct timeval tv_expires;
26  unsigned long delay_us;
27  fast_timer_function_type *function;
28  unsigned long data;
29  const char *name;
30};
31
32void start_one_shot_timer(struct fast_timer *t,
33                          fast_timer_function_type *function,
34                          unsigned long data,
35                          unsigned long delay_us,
36                          const char *name);
37
38int del_fast_timer(struct fast_timer * t);
39/* return 1 if deleted */
40
41
42void schedule_usleep(unsigned long us);
43
44
45void fast_timer_init(void);
46
47#endif
48