xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/linux/mmtimer.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /*
2*53ee8cc1Swenshuai.xi  * Intel Multimedia Timer device interface
3*53ee8cc1Swenshuai.xi  *
4*53ee8cc1Swenshuai.xi  * This file is subject to the terms and conditions of the GNU General Public
5*53ee8cc1Swenshuai.xi  * License.  See the file "COPYING" in the main directory of this archive
6*53ee8cc1Swenshuai.xi  * for more details.
7*53ee8cc1Swenshuai.xi  *
8*53ee8cc1Swenshuai.xi  * Copyright (c) 2001-2004 Silicon Graphics, Inc.  All rights reserved.
9*53ee8cc1Swenshuai.xi  *
10*53ee8cc1Swenshuai.xi  * This file should define an interface compatible with the IA-PC Multimedia
11*53ee8cc1Swenshuai.xi  * Timers Draft Specification (rev. 0.97) from Intel.  Note that some
12*53ee8cc1Swenshuai.xi  * hardware may not be able to safely export its registers to userspace,
13*53ee8cc1Swenshuai.xi  * so the ioctl interface should support all necessary functionality.
14*53ee8cc1Swenshuai.xi  *
15*53ee8cc1Swenshuai.xi  * 11/01/01 - jbarnes - initial revision
16*53ee8cc1Swenshuai.xi  * 9/10/04 - Christoph Lameter - remove interrupt support
17*53ee8cc1Swenshuai.xi  * 9/17/04 - jbarnes - remove test program, move some #defines to the driver
18*53ee8cc1Swenshuai.xi  */
19*53ee8cc1Swenshuai.xi 
20*53ee8cc1Swenshuai.xi #ifndef _LINUX_MMTIMER_H
21*53ee8cc1Swenshuai.xi #define _LINUX_MMTIMER_H
22*53ee8cc1Swenshuai.xi 
23*53ee8cc1Swenshuai.xi /*
24*53ee8cc1Swenshuai.xi  * Breakdown of the ioctl's available.  An 'optional' next to the command
25*53ee8cc1Swenshuai.xi  * indicates that supporting this command is optional, while 'required'
26*53ee8cc1Swenshuai.xi  * commands must be implemented if conformance is desired.
27*53ee8cc1Swenshuai.xi  *
28*53ee8cc1Swenshuai.xi  * MMTIMER_GETOFFSET - optional
29*53ee8cc1Swenshuai.xi  *   Should return the offset (relative to the start of the page where the
30*53ee8cc1Swenshuai.xi  *   registers are mapped) for the counter in question.
31*53ee8cc1Swenshuai.xi  *
32*53ee8cc1Swenshuai.xi  * MMTIMER_GETRES - required
33*53ee8cc1Swenshuai.xi  *   The resolution of the clock in femto (10^-15) seconds
34*53ee8cc1Swenshuai.xi  *
35*53ee8cc1Swenshuai.xi  * MMTIMER_GETFREQ - required
36*53ee8cc1Swenshuai.xi  *   Frequency of the clock in Hz
37*53ee8cc1Swenshuai.xi  *
38*53ee8cc1Swenshuai.xi  * MMTIMER_GETBITS - required
39*53ee8cc1Swenshuai.xi  *   Number of bits in the clock's counter
40*53ee8cc1Swenshuai.xi  *
41*53ee8cc1Swenshuai.xi  * MMTIMER_MMAPAVAIL - required
42*53ee8cc1Swenshuai.xi  *   Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
43*53ee8cc1Swenshuai.xi  *
44*53ee8cc1Swenshuai.xi  * MMTIMER_GETCOUNTER - required
45*53ee8cc1Swenshuai.xi  *   Gets the current value in the counter
46*53ee8cc1Swenshuai.xi  */
47*53ee8cc1Swenshuai.xi #define MMTIMER_IOCTL_BASE 'm'
48*53ee8cc1Swenshuai.xi 
49*53ee8cc1Swenshuai.xi #define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
50*53ee8cc1Swenshuai.xi #define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
51*53ee8cc1Swenshuai.xi #define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
52*53ee8cc1Swenshuai.xi #define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
53*53ee8cc1Swenshuai.xi #define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
54*53ee8cc1Swenshuai.xi #define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
55*53ee8cc1Swenshuai.xi 
56*53ee8cc1Swenshuai.xi #endif /* _LINUX_MMTIMER_H */
57