xref: /linux/include/uapi/linux/mmtimer.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * Intel Multimedia Timer device interface
4607ca46eSDavid Howells  *
5607ca46eSDavid Howells  * This file is subject to the terms and conditions of the GNU General Public
6607ca46eSDavid Howells  * License.  See the file "COPYING" in the main directory of this archive
7607ca46eSDavid Howells  * for more details.
8607ca46eSDavid Howells  *
9607ca46eSDavid Howells  * Copyright (c) 2001-2004 Silicon Graphics, Inc.  All rights reserved.
10607ca46eSDavid Howells  *
11607ca46eSDavid Howells  * This file should define an interface compatible with the IA-PC Multimedia
12607ca46eSDavid Howells  * Timers Draft Specification (rev. 0.97) from Intel.  Note that some
13607ca46eSDavid Howells  * hardware may not be able to safely export its registers to userspace,
14607ca46eSDavid Howells  * so the ioctl interface should support all necessary functionality.
15607ca46eSDavid Howells  *
16607ca46eSDavid Howells  * 11/01/01 - jbarnes - initial revision
17607ca46eSDavid Howells  * 9/10/04 - Christoph Lameter - remove interrupt support
18607ca46eSDavid Howells  * 9/17/04 - jbarnes - remove test program, move some #defines to the driver
19607ca46eSDavid Howells  */
20607ca46eSDavid Howells 
21607ca46eSDavid Howells #ifndef _LINUX_MMTIMER_H
22607ca46eSDavid Howells #define _LINUX_MMTIMER_H
23607ca46eSDavid Howells 
24607ca46eSDavid Howells /*
25607ca46eSDavid Howells  * Breakdown of the ioctl's available.  An 'optional' next to the command
26607ca46eSDavid Howells  * indicates that supporting this command is optional, while 'required'
27607ca46eSDavid Howells  * commands must be implemented if conformance is desired.
28607ca46eSDavid Howells  *
29607ca46eSDavid Howells  * MMTIMER_GETOFFSET - optional
30607ca46eSDavid Howells  *   Should return the offset (relative to the start of the page where the
31607ca46eSDavid Howells  *   registers are mapped) for the counter in question.
32607ca46eSDavid Howells  *
33607ca46eSDavid Howells  * MMTIMER_GETRES - required
34607ca46eSDavid Howells  *   The resolution of the clock in femto (10^-15) seconds
35607ca46eSDavid Howells  *
36607ca46eSDavid Howells  * MMTIMER_GETFREQ - required
37607ca46eSDavid Howells  *   Frequency of the clock in Hz
38607ca46eSDavid Howells  *
39607ca46eSDavid Howells  * MMTIMER_GETBITS - required
40607ca46eSDavid Howells  *   Number of bits in the clock's counter
41607ca46eSDavid Howells  *
42607ca46eSDavid Howells  * MMTIMER_MMAPAVAIL - required
43607ca46eSDavid Howells  *   Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
44607ca46eSDavid Howells  *
45607ca46eSDavid Howells  * MMTIMER_GETCOUNTER - required
46607ca46eSDavid Howells  *   Gets the current value in the counter
47607ca46eSDavid Howells  */
48607ca46eSDavid Howells #define MMTIMER_IOCTL_BASE 'm'
49607ca46eSDavid Howells 
50607ca46eSDavid Howells #define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
51607ca46eSDavid Howells #define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
52607ca46eSDavid Howells #define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
53607ca46eSDavid Howells #define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
54607ca46eSDavid Howells #define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
55607ca46eSDavid Howells #define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
56607ca46eSDavid Howells 
57607ca46eSDavid Howells #endif /* _LINUX_MMTIMER_H */
58