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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * Intel Multimedia Timer device interface
  3.  *
  4.  * This file is subject to the terms and conditions of the GNU General Public
  5.  * License.  See the file "COPYING" in the main directory of this archive
  6.  * for more details.
  7.  *
  8.  * Copyright (c) 2001-2002 Silicon Graphics, Inc.  All rights reserved.
  9.  *
  10.  * Helper file for the SN implementation of mmtimers
  11.  *
  12.  * 11/01/01 - jbarnes - initial revision
  13.  */
  14. #ifndef _SN_MMTIMER_PRIVATE_H
  15. #define RTC_BITS 55 /* 55 bits for this implementation */
  16. #define NUM_COMPARATORS 2 /* two comparison registers in SN1 */
  17. /*
  18.  * Check for an interrupt and clear the pending bit if
  19.  * one is waiting.
  20.  */
  21. #define MMTIMER_INT_PENDING(x) (x ? *(RTC_INT_PENDING_B_ADDR) : *(RTC_INT_PENDING_A_ADDR))
  22. /*
  23.  * Set interrupts on RTC 'x' to 'v' (true or false)
  24.  */
  25. #define MMTIMER_SET_INT(x,v) (x ? (*(RTC_INT_ENABLED_B_ADDR) = (unsigned long)(v)) : (*(RTC_INT_ENABLED_A_ADDR) = (unsigned long)(v)))
  26. #define MMTIMER_ENABLE_INT(x) MMTIMER_SET_INT(x, 1)
  27. #define MMTIMER_DISABLE_INT(x) MMTIMER_SET_INT(x, 0)
  28. typedef struct mmtimer {
  29. spinlock_t timer_lock;
  30. unsigned long periodic;
  31. int signo;
  32. volatile unsigned long *compare;
  33. struct task_struct *process;
  34. } mmtimer_t;
  35. #endif /* _SN_LINUX_MMTIMER_PRIVATE_H */