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-2003 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 15 #ifndef _SN_MMTIMER_PRIVATE_H 16 17 #define RTC_BITS 55 /* 55 bits for this implementation */ 18 #define NUM_COMPARATORS 2 /* two comparison registers in SN1 */ 19 20 /* 21 * Check for an interrupt and clear the pending bit if 22 * one is waiting. 23 */ 24 #define MMTIMER_INT_PENDING(x) (x ? *(RTC_INT_PENDING_B_ADDR) : *(RTC_INT_PENDING_A_ADDR)) 25 26 /* 27 * Set interrupts on RTC 'x' to 'v' (true or false) 28 */ 29 #define MMTIMER_SET_INT(x,v) (x ? (*(RTC_INT_ENABLED_B_ADDR) = (unsigned long)(v)) : (*(RTC_INT_ENABLED_A_ADDR) = (unsigned long)(v))) 30 31 #define MMTIMER_ENABLE_INT(x) MMTIMER_SET_INT(x, 1) 32 #define MMTIMER_DISABLE_INT(x) MMTIMER_SET_INT(x, 0) 33 34 typedef struct mmtimer { 35 spinlock_t timer_lock; 36 unsigned long periodic; 37 int signo; 38 volatile unsigned long *compare; 39 struct task_struct *process; 40 } mmtimer_t; 41 42 #endif /* _SN_LINUX_MMTIMER_PRIVATE_H */ 43