Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
5.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. acpipriv.h
  5. Abstract:
  6. Internal definitions and structures for ACPI
  7. Author:
  8. Jason Clark (jasoncl)
  9. Environment:
  10. Kernel mode only.
  11. Revision History:
  12. --*/
  13. #ifndef _ACPIPRIV_H_
  14. #define _ACPIPRIV_H_
  15. //
  16. // This structure lets us know the state of one entry in the RSDT
  17. //
  18. typedef struct {
  19. //
  20. // Flags that indicate what options apply to this element
  21. //
  22. ULONG Flags;
  23. //
  24. // The handle, if we need to unload
  25. //
  26. HANDLE Handle;
  27. //
  28. // The address, if we need to unmap
  29. //
  30. PVOID Address;
  31. } RSDTELEMENT, *PRSDTELEMENT;
  32. #define RSDTELEMENT_MAPPED 0x1
  33. #define RSDTELEMENT_LOADED 0x2
  34. #define RSDTELEMENT_LOADABLE 0x4
  35. #define RSDTELEMENT_OVERRIDEN 0x8
  36. //
  37. // This structure corresponds to the number of elements within the
  38. // RSDT. For each entry in the RSDT, there is a corresponding entry
  39. // here.
  40. //
  41. typedef struct _RSDTINFORMATION {
  42. //
  43. // How many elements are there in the table?
  44. //
  45. ULONG NumElements;
  46. //
  47. // The table
  48. //
  49. RSDTELEMENT Tables[1];
  50. } RSDTINFORMATION, *PRSDTINFORMATION;
  51. typedef struct _DDBINFORMATION {
  52. BOOLEAN DSDTNeedsUnload;
  53. BOOLEAN SSDTNeedsUnload;
  54. BOOLEAN PSDTNeedsUnload;
  55. HANDLE DSDT;
  56. HANDLE SSDT;
  57. HANDLE PSDT;
  58. } DDBINFORMATION;
  59. //
  60. // ACPIInformation is a global structure which contains frequently needed
  61. // addresses and flags. Filled in at initializtion time.
  62. //
  63. typedef struct _ACPIInformation {
  64. //
  65. // Linear address of Root System Description Table
  66. //
  67. PRSDT RootSystemDescTable;
  68. //
  69. // Linear address of Fixed ACPI Description Table
  70. //
  71. PFADT FixedACPIDescTable;
  72. //
  73. // Linear address of the FACS
  74. //
  75. PFACS FirmwareACPIControlStructure;
  76. //
  77. // Linear address of Differentiated System Description Table
  78. //
  79. PDSDT DiffSystemDescTable;
  80. //
  81. // Linear address of Mulitple APIC table
  82. //
  83. PMAPIC MultipleApicTable;
  84. //
  85. // Linear address of GlobalLock ULONG_PTR (contained within Firmware ACPI control structure)
  86. //
  87. PULONG GlobalLock;
  88. //
  89. // Queue used for waiting on release of the Global Lock. Also, queue
  90. // lock and owner info.
  91. //
  92. LIST_ENTRY GlobalLockQueue;
  93. KSPIN_LOCK GlobalLockQueueLock;
  94. PVOID GlobalLockOwnerContext;
  95. ULONG GlobalLockOwnerDepth;
  96. //
  97. // Did we find SCI_EN set when we loaded ?
  98. //
  99. BOOLEAN ACPIOnly;
  100. //
  101. // I/O address of PM1a_BLK
  102. //
  103. ULONG_PTR PM1a_BLK;
  104. //
  105. // I/O address of PM1b_BLK
  106. //
  107. ULONG_PTR PM1b_BLK;
  108. //
  109. // I/O address of PM1a_CNT_BLK
  110. //
  111. ULONG_PTR PM1a_CTRL_BLK;
  112. //
  113. // I/O address of PM1b_CNT_BLK
  114. //
  115. ULONG_PTR PM1b_CTRL_BLK;
  116. //
  117. // I/O address of PM2_CNT_BLK
  118. //
  119. ULONG_PTR PM2_CTRL_BLK;
  120. //
  121. // I/O address of PM_TMR
  122. //
  123. ULONG_PTR PM_TMR;
  124. ULONG_PTR GP0_BLK;
  125. ULONG_PTR GP0_ENABLE;
  126. //
  127. // Length of GP0 register block (Total, status+enable regs)
  128. //
  129. UCHAR GP0_LEN;
  130. //
  131. // Number of GP0 logical registers
  132. //
  133. USHORT Gpe0Size;
  134. ULONG_PTR GP1_BLK;
  135. ULONG_PTR GP1_ENABLE;
  136. //
  137. // Length of GP1 register block
  138. //
  139. UCHAR GP1_LEN;
  140. //
  141. // Number of GP1 logical registers
  142. //
  143. USHORT Gpe1Size;
  144. USHORT GP1_Base_Index;
  145. //
  146. // Total number of GPE logical registers
  147. //
  148. USHORT GpeSize;
  149. //
  150. // I/O address of SMI_CMD
  151. //
  152. ULONG_PTR SMI_CMD;
  153. //
  154. // Bit mask of enabled PM1 events.
  155. //
  156. USHORT pm1_en_bits;
  157. USHORT pm1_wake_mask;
  158. USHORT pm1_wake_status;
  159. USHORT c2_latency;
  160. USHORT c3_latency;
  161. //
  162. // see below for bit descriptions.
  163. //
  164. ULONG ACPI_Flags;
  165. ULONG ACPI_Capabilities;
  166. BOOLEAN Dockable;
  167. } ACPIInformation, *PACPIInformation;
  168. //
  169. // Value if GP1 is not supported
  170. //
  171. #define GP1_NOT_SUPPORTED (USHORT) 0xFFFF
  172. //
  173. // descriptions of bits in ACPIInformation.ACPI_Flags
  174. //
  175. #define C2_SUPPORTED_BIT 3
  176. #define C2_SUPPORTED (1 << C2_SUPPORTED_BIT)
  177. #define C3_SUPPORTED_BIT 4
  178. #define C3_SUPPORTED (1 << C3_SUPPORTED_BIT)
  179. #define C3_PREFERRED_BIT 5
  180. #define C3_PREFERRED (1 << C3_PREFERRED_BIT)
  181. //
  182. // descriptions of bits in ACPIInformation.ACPI_Capabilities
  183. //
  184. #define CSTATE_C1_BIT 4
  185. #define CSTATE_C1 (1 << CSTATE_C1_BIT)
  186. #define CSTATE_C2_BIT 5
  187. #define CSTATE_C2 (1 << CSTATE_C2_BIT)
  188. #define CSTATE_C3_BIT 6
  189. #define CSTATE_C3 (1 << CSTATE_C3_BIT)
  190. //
  191. // Define some useful pooltags
  192. //
  193. #define ACPI_SHARED_GPE_POOLTAG 'gpcA'
  194. #define ACPI_SHARED_INFORMATION_POOLTAG 'ipcA'
  195. #define ACPI_SHARED_TABLE_POOLTAG 'tpcA'
  196. //
  197. // Define how many processors we support...
  198. //
  199. #define ACPI_SUPPORTED_PROCESSORS (sizeof(KAFFINITY) * 8)
  200. #endif