regacces.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /*++
  2. Copyright (c) 2012 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. regacces.h
  9. Abstract:
  10. This header contains definitions for basic hardware register access.
  11. Author:
  12. Evan Green 28-Oct-2012
  13. --*/
  14. //
  15. // ------------------------------------------------------------------- Includes
  16. //
  17. //
  18. // ---------------------------------------------------------------- Definitions
  19. //
  20. //
  21. // ------------------------------------------------------ Data Type Definitions
  22. //
  23. //
  24. // -------------------------------------------------------------------- Globals
  25. //
  26. //
  27. // -------------------------------------------------------- Function Prototypes
  28. //
  29. KERNEL_API
  30. ULONG
  31. HlReadRegister32 (
  32. PVOID RegisterAddress
  33. );
  34. /*++
  35. Routine Description:
  36. This routine performs a 32-bit memory register read. The given address
  37. is assumed to be mapped with an uncached attribute.
  38. Arguments:
  39. RegisterAddress - Supplies the virtual address of the register to read.
  40. Return Value:
  41. Returns the value at the given register.
  42. --*/
  43. KERNEL_API
  44. VOID
  45. HlWriteRegister32 (
  46. PVOID RegisterAddress,
  47. ULONG Value
  48. );
  49. /*++
  50. Routine Description:
  51. This routine performs a 32-bit memory register write. The given address
  52. is assumed to be mapped with an uncached attribute.
  53. Arguments:
  54. RegisterAddress - Supplies the virtual address of the register to write to.
  55. Value - Supplies the value to write.
  56. Return Value:
  57. None.
  58. --*/
  59. KERNEL_API
  60. USHORT
  61. HlReadRegister16 (
  62. PVOID RegisterAddress
  63. );
  64. /*++
  65. Routine Description:
  66. This routine performs a 16-bit memory register read. The given address
  67. is assumed to be mapped with an uncached attribute.
  68. Arguments:
  69. RegisterAddress - Supplies the virtual address of the register to read.
  70. Return Value:
  71. Returns the value at the given register.
  72. --*/
  73. KERNEL_API
  74. VOID
  75. HlWriteRegister16 (
  76. PVOID RegisterAddress,
  77. USHORT Value
  78. );
  79. /*++
  80. Routine Description:
  81. This routine performs a 16-bit memory register write. The given address
  82. is assumed to be mapped with an uncached attribute.
  83. Arguments:
  84. RegisterAddress - Supplies the virtual address of the register to write to.
  85. Value - Supplies the value to write.
  86. Return Value:
  87. None.
  88. --*/
  89. KERNEL_API
  90. UCHAR
  91. HlReadRegister8 (
  92. PVOID RegisterAddress
  93. );
  94. /*++
  95. Routine Description:
  96. This routine performs an 8-bit memory register read. The given address
  97. is assumed to be mapped with an uncached attribute.
  98. Arguments:
  99. RegisterAddress - Supplies the virtual address of the register to read.
  100. Return Value:
  101. Returns the value at the given register.
  102. --*/
  103. KERNEL_API
  104. VOID
  105. HlWriteRegister8 (
  106. PVOID RegisterAddress,
  107. UCHAR Value
  108. );
  109. /*++
  110. Routine Description:
  111. This routine performs an 8-bit memory register write. The given address
  112. is assumed to be mapped with an uncached attribute.
  113. Arguments:
  114. RegisterAddress - Supplies the virtual address of the register to write to.
  115. Value - Supplies the value to write.
  116. Return Value:
  117. None.
  118. --*/