mmtimer.h 2.0 KB

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