mmtimer.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #ifndef _LINUX_MMTIMER_H
  21. #define _LINUX_MMTIMER_H
  22. /*
  23. * Breakdown of the ioctl's available. An 'optional' next to the command
  24. * indicates that supporting this command is optional, while 'required'
  25. * commands must be implemented if conformance is desired.
  26. *
  27. * MMTIMER_GETOFFSET - optional
  28. * Should return the offset (relative to the start of the page where the
  29. * registers are mapped) for the counter in question.
  30. *
  31. * MMTIMER_GETRES - required
  32. * The resolution of the clock in femto (10^-15) seconds
  33. *
  34. * MMTIMER_GETFREQ - required
  35. * Frequency of the clock in Hz
  36. *
  37. * MMTIMER_GETBITS - required
  38. * Number of bits in the clock's counter
  39. *
  40. * MMTIMER_MMAPAVAIL - required
  41. * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
  42. *
  43. * MMTIMER_GETCOUNTER - required
  44. * Gets the current value in the counter
  45. */
  46. #define MMTIMER_IOCTL_BASE 'm'
  47. #define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
  48. #define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
  49. #define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
  50. #define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
  51. #define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
  52. #define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
  53. #endif /* _LINUX_MMTIMER_H */