1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Intel Multimedia Timer device interface
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
9 * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved.
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.
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
21 #ifndef _LINUX_MMTIMER_H
22 #define _LINUX_MMTIMER_H
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.
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.
33 * MMTIMER_GETRES - required
34 * The resolution of the clock in femto (10^-15) seconds
36 * MMTIMER_GETFREQ - required
37 * Frequency of the clock in Hz
39 * MMTIMER_GETBITS - required
40 * Number of bits in the clock's counter
42 * MMTIMER_MMAPAVAIL - required
43 * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
45 * MMTIMER_GETCOUNTER - required
46 * Gets the current value in the counter
48 #define MMTIMER_IOCTL_BASE 'm'
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)
57 #endif /* _LINUX_MMTIMER_H */