fasttimer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * linux/include/asm-cris/fasttimer.h
  3. *
  4. * Fast timers for ETRAX100LX
  5. * Copyright (C) 2000-2007 Axis Communications AB
  6. */
  7. #include <linux/time.h> /* struct timeval */
  8. #include <linux/timex.h>
  9. #ifdef CONFIG_ETRAX_FAST_TIMER
  10. typedef void fast_timer_function_type(unsigned long);
  11. struct fasttime_t {
  12. unsigned long tv_jiff; /* jiffies */
  13. unsigned long tv_usec; /* microseconds */
  14. };
  15. struct fast_timer{ /* Close to timer_list */
  16. struct fast_timer *next;
  17. struct fast_timer *prev;
  18. struct fasttime_t tv_set;
  19. struct fasttime_t tv_expires;
  20. unsigned long delay_us;
  21. fast_timer_function_type *function;
  22. unsigned long data;
  23. const char *name;
  24. };
  25. extern struct fast_timer *fast_timer_list;
  26. void start_one_shot_timer(struct fast_timer *t,
  27. fast_timer_function_type *function,
  28. unsigned long data,
  29. unsigned long delay_us,
  30. const char *name);
  31. int del_fast_timer(struct fast_timer * t);
  32. /* return 1 if deleted */
  33. void schedule_usleep(unsigned long us);
  34. int fast_timer_init(void);
  35. #endif