fasttimer.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id: fasttimer.h,v 1.2 2002/05/28 17:45:34 johana 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. /* The timer0 values gives 52us resolution (1/19200) or higher 
  12.  * but interrupts at HZ 
  13.  */
  14. /* We use timer1 to generate interrupts at desired times. */
  15. #ifdef CONFIG_ETRAX_FAST_TIMER
  16. typedef void fast_timer_function_type(unsigned long);
  17. struct fast_timer{ /* Close to timer_list */
  18.   struct fast_timer *next;
  19.   struct fast_timer *prev;
  20.   struct timeval tv_set;
  21.   struct timeval tv_expires;
  22.   unsigned long delay_us;
  23.   fast_timer_function_type *function;
  24.   unsigned long data;
  25.   const char *name;
  26. };
  27. void start_one_shot_timer(struct fast_timer *t,
  28.                           fast_timer_function_type *function,
  29.                           unsigned long data,
  30.                           unsigned long delay_us,
  31.                           const char *name);
  32. int del_fast_timer(struct fast_timer * t);
  33. /* return 1 if deleted */
  34. void schedule_usleep(unsigned long us);
  35. void fast_timer_init(void);
  36. #endif