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