acpitabs.h 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667
  1. /*++
  2. Copyright (c) 2012 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. acpitabs.h
  5. Abstract:
  6. This header contains definitions for tables defined by the Advanced
  7. Configuration and Power Interface specification.
  8. Author:
  9. Evan Green 4-Aug-2012
  10. --*/
  11. //
  12. // ---------------------------------------------------------------- Definitions
  13. //
  14. //
  15. // Well known table signatures.
  16. //
  17. #define RSDP_SIGNATURE 0x2052545020445352ULL // "RSD PTR "
  18. #define RSDT_SIGNATURE 0x54445352 // 'RSDT'
  19. #define XSDT_SIGNATURE 0x54445358 // 'XSDT'
  20. #define FADT_SIGNATURE 0x50434146 // 'FACP'
  21. #define FACS_SIGNATURE 0x53434146 // 'FACS'
  22. #define MADT_SIGNATURE 0x43495041 // 'APIC'
  23. #define DSDT_SIGNATURE 0x54445344 // 'DSDT'
  24. #define SSDT_SIGNATURE 0x54445353 // 'SSDT'
  25. #define DBG2_SIGNATURE 0x32474244 // 'DBG2'
  26. #define GTDT_SIGNATURE 0x54445447 // 'GTDT'
  27. #define ACPI_20_RSDP_REVISION 0x02
  28. #define ACPI_30_RSDT_REVISION 0x01
  29. #define ACPI_30_XSDT_REVISION 0x01
  30. //
  31. // Normally the entire contents of the table is checksummed, however in the
  32. // case of the RSDP only the bytes defined in ACPI 1.0 are checksummed.
  33. //
  34. #define RSDP_CHECKSUM_SIZE 20
  35. typedef enum _ADDRESS_SPACE_TYPE {
  36. AddressSpaceMemory = 0,
  37. AddressSpaceIo = 1,
  38. AddressSpacePciConfig = 2,
  39. AddressSpaceEmbeddedController = 3,
  40. AddressSpaceSmBus = 4,
  41. AddressSpaceFixedHardware = 0x7F
  42. } ADDRESS_SPACE_TYPE, *PADDRESS_SPACE_TYPE;
  43. typedef enum _MADT_ENTRY_TYPE {
  44. MadtEntryTypeLocalApic = 0x0,
  45. MadtEntryTypeIoApic = 0x1,
  46. MadtEntryTypeInterruptOverride = 0x2,
  47. MadtEntryTypeNmiSource = 0x3,
  48. MadtEntryTypeLocalApicNmi = 0x4,
  49. MadtEntryTypeLocalApicAddressOverride = 0x5,
  50. MadtEntryTypeIoSapic = 0x6,
  51. MadtEntryTypeLocalSapic = 0x7,
  52. MadtEntryTypePlatformInterruptSource = 0x8,
  53. MadtEntryTypeLocalX2Apic = 0x9,
  54. MadtEntryTypeGic = 0xB,
  55. MadtEntryTypeGicDistributor = 0xC,
  56. } MADT_ENTRY_TYPE, *PMADT_ENTRY_TYPE;
  57. //
  58. // Define the frequency of the ACPI PM timer.
  59. //
  60. #define PM_TIMER_FREQUENCY 3579545
  61. //
  62. // Define the values for the argument to the \_PIC method.
  63. //
  64. #define ACPI_INTERRUPT_PIC_MODEL 0
  65. #define ACPI_INTERRUPT_APIC_MODEL 1
  66. #define ACPI_INTERRUPT_SAPIC_MODEL 2
  67. //
  68. // MADT Flags.
  69. //
  70. //
  71. // This flag is set if the machine has a PC/AT compatible dual 8259 PIC
  72. // interrupt controller.
  73. //
  74. #define MADT_FLAG_DUAL_8259 0x00000001
  75. //
  76. // Set if the processor is present.
  77. //
  78. #define MADT_LOCAL_APIC_FLAG_ENABLED 1
  79. //
  80. // MADT Interrupt Override flags. For those muddling through this, ISA
  81. // interrupts that "conform to bus" are edge triggered, active low.
  82. //
  83. #define MADT_INTERRUPT_POLARITY_MASK 0x03
  84. #define MADT_INTERRUPT_POLARITY_CONFORMS_TO_BUS 0x00
  85. #define MADT_INTERRUPT_POLARITY_ACTIVE_HIGH 0x01
  86. #define MADT_INTERRUPT_POLARITY_ACTIVE_LOW 0x03
  87. #define MADT_INTERRUPT_TRIGGER_MODE_MASK 0xC0
  88. #define MADT_INTERRUPT_TRIGGER_MODE_CONFORMS_TO_BUS 0x00
  89. #define MADT_INTERRUPT_TRIGGER_MODE_EDGE 0x01
  90. #define MADT_INTERRUPT_TRIGGER_MODE_LEVEL 0x11
  91. //
  92. // Set if the processor is present.
  93. //
  94. #define MADT_LOCAL_GIC_FLAG_ENABLED 0x00000001
  95. //
  96. // Set if the performance interrupt for the processor is edge triggered.
  97. //
  98. #define MADT_LOCAL_GIC_FLAG_PERFORMANCE_INTERRUPT_EDGE_TRIGGERED 0x00000002
  99. //
  100. // FADT Flags.
  101. //
  102. //
  103. // Set if the processor correctly flushes the processor caches and maintains
  104. // memory coherency when the WBINVD instruction is invoked.
  105. //
  106. #define FADT_FLAG_WRITEBACK_INVALIDATE_CORRECT 0x00000001
  107. //
  108. // Set if the processor properly flushes all caches and maintains memory
  109. // coherency when the WBINVD instruction is invoked, but doesn't necessarily
  110. // invalidate all caches.
  111. //
  112. #define FADT_FLAG_WRITEBACK_INVALIDATE_FLUSH 0x00000002
  113. //
  114. // Set if the C1 power state is supported on all processors.
  115. //
  116. #define FADT_FLAG_C1_SUPPORTED 0x00000004
  117. //
  118. // Set if the C2 power state can work with more than one processor.
  119. //
  120. #define FADT_FLAG_C2_MULTIPROCESSOR 0x00000008
  121. //
  122. // Set if the power button is implemented as a control method device. If not
  123. // set, it is implemented as a fixed feature device.
  124. //
  125. #define FADT_FLAG_POWER_BUTTON_CONTROL_METHOD 0x00000010
  126. //
  127. // Set if the sleep button is implemented as a control method device. If not
  128. // set, it is implemented as a fixed feature device.
  129. //
  130. #define FADT_FLAG_SLEEP_BUTTON_CONTROL_METHOD 0x00000020
  131. //
  132. // Set if RTC wake status is not supported in fixed register space.
  133. //
  134. #define FADT_FLAG_NO_RTC_FIXED_WAKE_STATUS 0x00000040
  135. //
  136. // Set if the RTC can wake the system from the S4 power state.
  137. //
  138. #define FADT_FLAG_RTC_WAKES_S4 0x00000080
  139. //
  140. // Set if the PM timer is 32 bits. If clear, the timer is 24 bits.
  141. //
  142. #define FADT_FLAG_PM_TIMER_32_BITS 0x00000100
  143. //
  144. // Set if the system can support docking.
  145. //
  146. #define FADT_FLAG_DOCKING_SUPPORTED 0x00000200
  147. //
  148. // Set if the ACPI reset register is supported.
  149. //
  150. #define FADT_FLAG_RESET_REGISTER_SUPPORTED 0x00000400
  151. //
  152. // Set if the system has no external expansion capabilities and the case is
  153. // sealed.
  154. //
  155. #define FADT_FLAG_SEALED_CASE 0x00000800
  156. //
  157. // Set if the system cannot detect the monitor or keyboard/mouse devices.
  158. //
  159. #define FADT_FLAG_HEADLESS 0x00001000
  160. //
  161. // Set if the OSPM must execute a processor native instruction after writing
  162. // the SLP_TYPx register.
  163. //
  164. #define FADT_FLAG_SOFTWARE_SLEEP 0x00002000
  165. //
  166. // Set if the platform supports waking from PCI express.
  167. //
  168. #define FADT_FLAG_PCI_EXPRESS_WAKE 0x00004000
  169. //
  170. // Set if the operating system should use a platform clock, and not a
  171. // processor-based timer to measure time.
  172. //
  173. #define FADT_FLAG_USE_PLATFORM_CLOCK 0x00008000
  174. //
  175. // Set if the contents of the RTC_STS flag is valid when waking from S4.
  176. //
  177. #define FADT_FLAG_S4_RTC_STATUS_VALID 0x00010000
  178. //
  179. // Set if the platform is compatible with remote power on.
  180. //
  181. #define FADT_FLAG_REMOTE_POWER_ON_SUPPORTED 0x00020000
  182. //
  183. // Set if all local APICs must be used in clustered mode.
  184. //
  185. #define FADT_FLAG_USE_CLUSTERED_MODE 0x00040000
  186. //
  187. // Set if all local APICs must be used in physical destination mode.
  188. //
  189. #define FADT_FLAG_USE_PHYSICAL_MODE 0x00080000
  190. //
  191. // Set if ACPI hardware is not available.
  192. //
  193. #define FADT_HARDWARE_REDUCED_ACPI 0x00100000
  194. //
  195. // Define IA boot flags in the FADT.
  196. //
  197. #define FADT_IA_FLAG_LEGACY_DEVICES 0x0001
  198. #define FADT_IA_FLAG_8042_PRESENT 0x0002
  199. #define FADT_IA_FLAG_VGA_NOT_PRESENT 0x0004
  200. #define FADT_IA_FLAG_MSI_NOT_SUPPORTED 0x0008
  201. #define FADT_IA_FLAG_PCIE_ASPM_NOT_SUPPORTED 0x0010
  202. //
  203. // Define PM1 Control register bit definitions.
  204. //
  205. //
  206. // Set if the SCI interrupt is enabled, which is also used as an indication that
  207. // ACPI mode is enabled. If this flag is cleared, SCI interrupts generate SMI
  208. // interrupts.
  209. //
  210. #define FADT_PM1_CONTROL_SCI_ENABLED 0x00000001
  211. //
  212. // Set if the generation of a bus master request can cause any processor in the
  213. // C3 state to transition to the C0 state. When this bit is not set, the
  214. // generation of a bus master request does not affect any processor in the C3
  215. // state.
  216. //
  217. #define FADT_PM1_CONTROL_BUS_MASTER_WAKE 0x00000002
  218. //
  219. // This write-only bit is used by the ACPI software to raise an event to the
  220. // BIOS indicating that the OS has released the global lock.
  221. //
  222. #define FADT_PM1_CONTROL_GLOBAL_LOCK_RELEASED 0x00000004
  223. //
  224. // Defines the shift of the field that indicates the type of sleep state to
  225. // enter when the sleep enable bit is set.
  226. //
  227. #define FADT_PM1_CONTROL_SLEEP_TYPE_SHIFT 10
  228. //
  229. // Define PM2 Control register bit definitions.
  230. //
  231. //
  232. // This bit is set to disable the system bus arbiter, which disallows bus
  233. // masters other than the CPU from using the system bus.
  234. //
  235. #define FADT_PM2_ARBITER_DISABLE 0x00000001
  236. //
  237. // Sends the system to sleep. The sleep level is determined by the sleep type
  238. // bits.
  239. //
  240. #define FADT_PM1_CONTROL_SLEEP 0x00002000
  241. //
  242. // Define PM1 Event register bit definitions.
  243. //
  244. //
  245. // This bit is set when the most significant bit of the PM timer rolls over.
  246. //
  247. #define FADT_PM1_EVENT_TIMER_STATUS 0x00000001
  248. //
  249. // This bit is set any time a system bus master requests the system bus. It can
  250. // only be cleared by writing a 1 to this bit. This bit reflects bus master
  251. // activity, not CPU activity.
  252. //
  253. #define FADT_PM1_EVENT_BUS_MASTER_STATUS 0x00000010
  254. //
  255. // This bit is set when the BIOS has raised the SCI interrupt and would the
  256. // attention of the OS.
  257. //
  258. #define FADT_PM1_EVENT_GLOBAL_STATUS 0x00000020
  259. //
  260. // This bit is set when the power button was pressed. It is cleared by writing
  261. // a one to this bit.
  262. //
  263. #define FADT_PM1_EVENT_POWER_BUTTON_STATUS 0x00000100
  264. //
  265. // This bit is set when the sleep button was pressed. It is cleared by writing
  266. // a one to this bit.
  267. //
  268. #define FADT_PM1_EVENT_SLEEP_BUTTON_STATUS 0x00000200
  269. //
  270. // This bit is set when the RTC alarm has fired. It is cleared by writing a
  271. // one to this bit.
  272. //
  273. #define FADT_PM1_EVENT_RTC_STATUS 0x00000400
  274. //
  275. // This bit is set when a PCI wake event is requested. It is cleared by writing
  276. // a one to this bit.
  277. //
  278. #define FADT_PM1_EVENT_PCIE_WAKE_STATUS 0x00004000
  279. //
  280. // This bit is set when the system was sleeping and a wake event occurred.
  281. // It is cleared by writing a one to it.
  282. //
  283. #define FADT_PM1_EVENT_WAKE_STATUS 0x00008000
  284. //
  285. // Define PM1 interrupt enable register bits. They correspond to the PM1 event
  286. // register bits.
  287. //
  288. #define FADT_PM1_ENABLE_PM_TIMER 0x00000001
  289. #define FADT_PM1_ENABLE_GLOBAL 0x00000020
  290. #define FADT_PM1_ENABLE_POWER_BUTTON 0x00000100
  291. #define FADT_PM1_ENABLE_SLEEP_BUTTON 0x00000200
  292. #define FADT_PM1_ENABLE_RTC 0x00000400
  293. #define FADT_PM1_ENABLE_PCIE_DISABLE 0x00004000
  294. //
  295. // Define FACS flags.
  296. //
  297. //
  298. // This bit is set to indicate that the OS supports S4BIOS_REQ. If not
  299. // supported, the OSPM must be able to save and restore memory state in order
  300. // to use the S4 state.
  301. //
  302. #define FACS_FLAG_S4_BIOS_REQUEST_SUPPORTED 0x00000001
  303. //
  304. // This bit is set by the platform firmware to indicate that a 64-bit
  305. // environment is available for the waking vector.
  306. //
  307. #define FACS_FLAG_64_BIT_WAKE_SUPPORTED 0x00000001
  308. //
  309. // This bit is set by the OS to indicate that it would like a 64-bit
  310. // execution environment when coming out of sleep via the
  311. // XFirmwareWakingVector.
  312. //
  313. #define FACS_OSPM_FLAG_64_BIT_WAKE_ENABLED 0x00000001
  314. //
  315. // This bit is set in the global lock to indicate that there is a request to
  316. // own the lock.
  317. //
  318. #define FACS_GLOBAL_LOCK_PENDING 0x00000001
  319. //
  320. // This bit is set to indicate ownership of the global lock.
  321. //
  322. #define FACS_GLOBAL_LOCK_OWNED 0x00000002
  323. //
  324. // Resource descriptor definitions.
  325. //
  326. #define RESOURCE_DESCRIPTOR_LARGE 0x80
  327. #define RESOURCE_DESCRIPTOR_LENGTH_MASK 0x7
  328. //
  329. // Small resource types.
  330. //
  331. #define SMALL_RESOURCE_TYPE_MASK 0x78
  332. #define SMALL_RESOURCE_TYPE_IRQ (0x4 << 3)
  333. #define SMALL_RESOURCE_TYPE_DMA (0x5 << 3)
  334. #define SMALL_RESOURCE_TYPE_START_DEPENDENT_FUNCTIONS (0x6 << 3)
  335. #define SMALL_RESOURCE_TYPE_END_DEPENDENT_FUNCTIONS (0x7 << 3)
  336. #define SMALL_RESOURCE_TYPE_IO_PORT (0x8 << 3)
  337. #define SMALL_RESOURCE_TYPE_FIXED_LOCATION_IO_PORT (0x9 << 3)
  338. #define SMALL_RESOURCE_TYPE_FIXED_DMA (0xA << 3)
  339. #define SMALL_RESOURCE_TYPE_VENDOR_DEFINED (0xE << 3)
  340. #define SMALL_RESOURCE_TYPE_END_TAG (0xF << 3)
  341. //
  342. // I/O port resource bit definitions.
  343. //
  344. #define IO_PORT_RESOURCE_DECODES_16_BITS 0x01
  345. //
  346. // Large resource types.
  347. //
  348. #define LARGE_RESOURCE_TYPE_MASK 0x7F
  349. #define LARGE_RESOURCE_TYPE_MEMORY24 0x01
  350. #define LARGE_RESOURCE_TYPE_GENERIC_REGISTER 0x02
  351. #define LARGE_RESOURCE_TYPE_VENDOR_DEFINED 0x04
  352. #define LARGE_RESOURCE_TYPE_MEMORY32 0x05
  353. #define LARGE_RESOURCE_TYPE_FIXED_MEMORY32 0x06
  354. #define LARGE_RESOURCE_TYPE_ADDRESS_SPACE32 0x07
  355. #define LARGE_RESOURCE_TYPE_ADDRESS_SPACE16 0x08
  356. #define LARGE_RESOURCE_TYPE_IRQ 0x09
  357. #define LARGE_RESOURCE_TYPE_ADDRESS_SPACE64 0x0A
  358. #define LARGE_RESOURCE_TYPE_ADDRESS_SPACE_EXTENDED 0x0B
  359. #define LARGE_RESOURCE_TYPE_GPIO 0x0C
  360. #define LARGE_RESOURCE_TYPE_SPB 0x0E
  361. //
  362. // Memory descriptor information flags.
  363. //
  364. #define ACPI_MEMORY_DESCRIPTOR_WRITEABLE 0x01
  365. #define ACPI_MEMORY_DESCRIPTOR_ATTRIBUTES_MASK 0x06
  366. #define ACPI_MEMORY_DESCRIPTOR_ATTRIBUTE_UNCACHED (0x00 << 1)
  367. #define ACPI_MEMORY_DESCRIPTOR_ATTRIBUTE_CACHEABLE (0x01 << 1)
  368. #define ACPI_MEMORY_DESCRIPTOR_ATTRIBUTE_WRITE_COMBINED (0x02 << 1)
  369. #define ACPI_MEMORY_DESCRIPTOR_ATTRIBUTE_PREFETCHABLE (0x03 << 1)
  370. #define ACPI_MEMORY_DESCRIPTOR_TYPE_MASK 0x18
  371. #define ACPI_MEMORY_DESCRIPTOR_TYPE_MEMORY (0x00 << 3)
  372. #define ACPI_MEMORY_DESCRIPTOR_TYPE_RESERVED (0x01 << 3)
  373. #define ACPI_MEMORY_DESCRIPTOR_TYPE_ACPI (0x02 << 3)
  374. #define ACPI_MEMORY_DESCRIPTOR_TYPE_NON_VOLATILE (0x03 << 3)
  375. #define ACPI_MEMORY_DESCRIPTOR_TRANSLATES_TO_IO (1 << 5)
  376. //
  377. // Generic address types.
  378. //
  379. #define GENERIC_ADDRESS_TYPE_MEMORY 0
  380. #define GENERIC_ADDRESS_TYPE_IO 1
  381. #define GENERIC_ADDRESS_TYPE_BUS_NUMBER 2
  382. #define GENERIC_ADDRESS_TYPE_VENDOR_DEFINED 192
  383. //
  384. // Generic address descriptor flags.
  385. //
  386. #define GENERIC_ADDRESS_SUBTRACTIVE_DECODE 0x02
  387. #define GENERIC_ADDRESS_MINIMUM_FIXED 0x04
  388. #define GENERIC_ADDRESS_MAXIMUM_FIXED 0x08
  389. //
  390. // Memory attribute flags.
  391. //
  392. #define ACPI_MEMORY_ATTRIBUTE_UNCACHED 0x1
  393. #define ACPI_MEMORY_ATTRIBUTE_WRITE_COMBINED 0x2
  394. #define ACPI_MEMORY_ATTRIBUTE_WRITE_THROUGH 0x4
  395. #define ACPI_MEMORY_ATTRIBUTE_WRITE_BACK 0x8
  396. #define ACPI_MEMORY_ATTRIBUTE_UNCACHED_EXPORTED 0x10
  397. #define ACPI_MEMORY_ATTRIBUTE_NON_VOLATILE 0x8000
  398. //
  399. // Small IRQ flags.
  400. //
  401. #define ACPI_SMALL_IRQ_FLAG_EDGE_TRIGGERED 0x01
  402. #define ACPI_SMALL_IRQ_FLAG_ACTIVE_LOW 0x08
  403. #define ACPI_SMALL_IRQ_FLAG_SHAREABLE 0x10
  404. //
  405. // Large IRQ flags.
  406. //
  407. #define ACPI_LARGE_IRQ_FLAG_CONSUMER 0x01
  408. #define ACPI_LARGE_IRQ_FLAG_EDGE_TRIGGERED 0x02
  409. #define ACPI_LARGE_IRQ_FLAG_ACTIVE_LOW 0x04
  410. #define ACPI_LARGE_IRQ_FLAG_SHAREABLE 0x08
  411. //
  412. // Small DMA flags.
  413. //
  414. #define ACPI_SMALL_DMA_SPEED_MASK 0x3
  415. #define ACPI_SMALL_DMA_SPEED_SHIFT 5
  416. #define ACPI_SMALL_DMA_SPEED_ISA (0x0 << ACPI_SMALL_DMA_SPEED_SHIFT)
  417. #define ACPI_SMALL_DMA_SPEED_EISA_A (0x1 << ACPI_SMALL_DMA_SPEED_SHIFT)
  418. #define ACPI_SMALL_DMA_SPEED_EISA_B (0x2 << ACPI_SMALL_DMA_SPEED_SHIFT)
  419. #define ACPI_SMALL_DMA_SPEED_EISA_F (0x3 << ACPI_SMALL_DMA_SPEED_SHIFT)
  420. #define ACPI_SMALL_DMA_BUS_MASTER 0x4
  421. #define ACPI_SMALL_DMA_SIZE_MASK 0x3
  422. #define ACPI_SMALL_DMA_SIZE_8_BIT 0x0
  423. #define ACPI_SMALL_DMA_SIZE_8_AND_16_BIT 0x1
  424. #define ACPI_SMALL_DMA_SIZE_16_BIT 0x2
  425. //
  426. // Small Fixed DMA flags.
  427. //
  428. #define ACPI_SMALL_FIXED_DMA_8BIT 0x00
  429. #define ACPI_SMALL_FIXED_DMA_16BIT 0x01
  430. #define ACPI_SMALL_FIXED_DMA_32BIT 0x02
  431. #define ACPI_SMALL_FIXED_DMA_64BIT 0x03
  432. #define ACPI_SMALL_FIXED_DMA_128BIT 0x04
  433. #define ACPI_SMALL_FIXED_DMA_256BIT 0x05
  434. //
  435. // GPIO descriptor flags.
  436. //
  437. #define ACPI_GPIO_CONNECTION_INTERRUPT 0x00
  438. #define ACPI_GPIO_CONNECTION_IO 0x01
  439. #define ACPI_GPIO_WAKE 0x0010
  440. #define ACPI_GPIO_SHARED 0x0008
  441. #define ACPI_GPIO_POLARITY_MASK (0x3 << 1)
  442. #define ACPI_GPIO_POLARITY_ACTIVE_HIGH (0x0 << 1)
  443. #define ACPI_GPIO_POLARITY_ACTIVE_LOW (0x1 << 1)
  444. #define ACPI_GPIO_POLARITY_ACTIVE_BOTH (0x2 << 1)
  445. #define ACPI_GPIO_EDGE_TRIGGERED 0x0001
  446. #define ACPI_GPIO_IO_RESTRICTION_MASK 0x0003
  447. #define ACPI_GPIO_IO_RESTRICTION_IO 0x0000
  448. #define ACPI_GPIO_IO_RESTRICTION_INPUT 0x0001
  449. #define ACPI_GPIO_IO_RESTRICTION_OUTPUT 0x0002
  450. #define ACPI_GPIO_IO_RESTRICTION_IO_PRESERVE 0x0003
  451. #define ACPI_GPIO_PIN_PULL_DEFAULT 0x00
  452. #define ACPI_GPIO_PIN_PULL_UP 0x01
  453. #define ACPI_GPIO_PIN_PULL_DOWN 0x02
  454. #define ACPI_GPIO_PIN_PULL_NONE 0x03
  455. #define ACPI_GPIO_OUTPUT_DRIVE_DEFAULT 0xFFFF
  456. #define ACPI_GPIO_DEBOUNCE_TIMEOUT_DEFAULT 0xFFFF
  457. //
  458. // Simple Peripheral Bus descriptor definitions.
  459. //
  460. #define ACPI_SPB_BUS_I2C 1
  461. #define ACPI_SPB_BUS_SPI 2
  462. #define ACPI_SPB_BUS_UART 3
  463. #define ACPI_SPB_I2C_TYPE_DATA_LENGTH 6
  464. #define ACPI_SPB_SPI_TYPE_DATA_LENGTH 9
  465. #define ACPI_SPB_UART_TYPE_DATA_LENGTH 10
  466. #define ACPI_SPB_FLAG_SLAVE 0x01
  467. #define ACPI_SPB_I2C_10_BIT_ADDRESSING 0x0001
  468. #define ACPI_SPB_SPI_3_WIRES 0x0001
  469. #define ACPI_SPB_SPI_DEVICE_SELECT_ACTIVE_HIGH 0x0002
  470. #define ACPI_SPB_SPI_PHASE_FIRST 0
  471. #define ACPI_SPB_SPI_PHASE_SECOND 1
  472. #define ACPI_SPB_SPI_POLARITY_START_LOW 0
  473. #define ACPI_SPB_SPI_POLARITY_START_HIGH 1
  474. #define ACPI_SPB_UART_FLOW_CONTROL_NONE 0x00
  475. #define ACPI_SPB_UART_FLOW_CONTROL_HARDWARE 0x01
  476. #define ACPI_SPB_UART_FLOW_CONTROL_SOFTWARE 0x02
  477. #define ACPI_SPB_UART_FLOW_CONTROL_MASK 0x03
  478. #define ACPI_SPB_UART_STOP_BITS_NONE (0x0 << 2)
  479. #define ACPI_SPB_UART_STOP_BITS_1 (0x1 << 2)
  480. #define ACPI_SPB_UART_STOP_BITS_1_5 (0x2 << 2)
  481. #define ACPI_SPB_UART_STOP_BITS_2 (0x3 << 2)
  482. #define ACPI_SPB_UART_STOP_BITS_MASK (0x3 << 2)
  483. #define ACPI_SPB_UART_DATA_BITS_5 (0x0 << 4)
  484. #define ACPI_SPB_UART_DATA_BITS_6 (0x1 << 4)
  485. #define ACPI_SPB_UART_DATA_BITS_7 (0x2 << 4)
  486. #define ACPI_SPB_UART_DATA_BITS_8 (0x3 << 4)
  487. #define ACPI_SPB_UART_DATA_BITS_9 (0x4 << 4)
  488. #define ACPI_SPB_UART_DATA_BITS_MASK (0x7 << 4)
  489. #define ACPI_SPB_UART_DATA_BITS_SHIFT 4
  490. #define ACPI_SPB_UART_BIG_ENDIAN 0x0080
  491. #define ACPI_SPB_UART_PARITY_NONE 0x00
  492. #define ACPI_SPB_UART_PARITY_EVEN 0x01
  493. #define ACPI_SPB_UART_PARITY_ODD 0x02
  494. #define ACPI_SPB_UART_PARITY_MARK 0x03
  495. #define ACPI_SPB_UART_PARITY_SPACE 0x04
  496. #define ACPI_SPB_UART_CONTROL_DTD (1 << 2)
  497. #define ACPI_SPB_UART_CONTROL_RI (1 << 3)
  498. #define ACPI_SPB_UART_CONTROL_DSR (1 << 4)
  499. #define ACPI_SPB_UART_CONTROL_DTR (1 << 5)
  500. #define ACPI_SPB_UART_CONTROL_CTS (1 << 6)
  501. #define ACPI_SPB_UART_CONTROL_RTS (1 << 7)
  502. //
  503. // Define the meaning of bits coming back from the _STA AML method.
  504. //
  505. #define ACPI_DEVICE_STATUS_PRESENT 0x00000001
  506. #define ACPI_DEVICE_STATUS_ENABLED 0x00000002
  507. #define ACPI_DEVICE_STATUS_SHOW_IN_UI 0x00000004
  508. #define ACPI_DEVICE_STATUS_FUNCTIONING_PROPERLY 0x00000008
  509. #define ACPI_DEVICE_STATUS_BATTERY_PRESENT 0x00000010
  510. //
  511. // Define the default status flags if no _STA method is found.
  512. //
  513. #define ACPI_DEFAULT_DEVICE_STATUS \
  514. (ACPI_DEVICE_STATUS_PRESENT | \
  515. ACPI_DEVICE_STATUS_ENABLED | \
  516. ACPI_DEVICE_STATUS_SHOW_IN_UI | \
  517. ACPI_DEVICE_STATUS_FUNCTIONING_PROPERLY | \
  518. ACPI_DEVICE_STATUS_BATTERY_PRESENT)
  519. //
  520. // Define debug port table 2 types.
  521. //
  522. #define DEBUG_PORT_TYPE_SERIAL 0x8000
  523. #define DEBUG_PORT_TYPE_1394 0x8001
  524. #define DEBUG_PORT_TYPE_USB 0x8002
  525. #define DEBUG_PORT_TYPE_NET 0x8003
  526. //
  527. // Debug port table 2 sub-types.
  528. //
  529. #define DEBUG_PORT_SERIAL_16550 0x0000
  530. #define DEBUG_PORT_SERIAL_16550_COMPATIBLE 0x0001
  531. #define DEBUG_PORT_SERIAL_ARM_PL011 0x0003
  532. #define DEBUG_PORT_SERIAL_ARM_OMAP4 0x0004
  533. #define DEBUG_PORT_1394_STANDARD 0x0000
  534. #define DEBUG_PORT_USB_XHCI 0x0000
  535. #define DEBUG_PORT_USB_EHCI 0x0001
  536. //
  537. // Define the signature for optional 16550 UART OEM data. The string "165U".
  538. //
  539. #define DEBUG_PORT_16550_OEM_DATA_SIGNATURE 0x55353631
  540. //
  541. // Define the set of flags for the optional 16550 UART OEM data.
  542. //
  543. #define DEBUG_PORT_16550_OEM_FLAG_64_BYTE_FIFO 0x00000001
  544. #define DEBUG_PORT_16550_OEM_FLAG_TRANSMIT_TRIGGER_2_CHARACTERS 0x00000002
  545. //
  546. // Define Intel-specific fixed function hardware register flags and bitfields.
  547. //
  548. #define ACPI_FIXED_HARDWARE_INTEL 0x01
  549. #define ACPI_FIXED_HARDWARE_INTEL_CST_HALT 0x00
  550. #define ACPI_FIXED_HARDWARE_INTEL_CST_IO_HALT 0x01
  551. #define ACPI_FIXED_HARDWARE_INTEL_CST_MWAIT 0x02
  552. #define ACPI_INTEL_MWAIT_HARDWARE_COORDINATED 0x01
  553. #define ACPI_INTEL_MWAIT_BUS_MASTER_AVOIDANCE 0x02
  554. //
  555. // Define Intel-specific _OSC and _PDC bits.
  556. //
  557. #define ACPI_OSC_INTEL_UUID {{0x4077A616, 0x47BE290C, 0x70D8BD9E, 0x53397158}}
  558. #define ACPI_OSC_INTEL_PSTATE_MSRS (1 << 0)
  559. #define ACPI_OSC_INTEL_SMP_C1_IO_HALT (1 << 1)
  560. #define ACPI_OSC_INTEL_THROTTLING_MSRS (1 << 2)
  561. #define ACPI_OSC_INTEL_SMP_INDEPENDENT (1 << 3)
  562. #define ACPI_OSC_INTEL_C2_C3_SMP_INDEPENDENT (1 << 4)
  563. #define ACPI_OSC_INTEL_SMP_PSTATE_PSD (1 << 5)
  564. #define ACPI_OSC_INTEL_SMP_CSTATE_CST (1 << 6)
  565. #define ACPI_OSC_INTEL_SMP_TSTATE_TSD (1 << 7)
  566. #define ACPI_OSC_INTEL_SMP_C1_NATIVE (1 << 8)
  567. #define ACPI_OSC_INTEL_SMP_C2_C3_NATIVE (1 << 9)
  568. #define ACPI_OSC_INTEL_PSTATE_ACNT_MCNT (1 << 11)
  569. #define ACPI_OSC_INTEL_PSTATE_COLLABORATIVE (1 << 12)
  570. #define ACPI_OSC_INTEL_HARDWARE_DUTY_CYCLING (1 << 13)
  571. //
  572. // Define the generic timer global flags.
  573. //
  574. #define GTDT_GLOBAL_FLAG_MEMORY_MAPPED_BLOCK_PRESENT 0x00000001
  575. #define GTDT_GLOBAL_FLAG_INTERRUPT_MODE_MASK 0x00000002
  576. #define GTDT_GLOBAL_FLAG_INTERRUPT_MODE_EDGE 0x00000002
  577. #define GTDT_GLOBAL_FLAG_INTERRUPT_MODE_LEVEL 0x00000000
  578. //
  579. // Define the generic timer flags.
  580. //
  581. #define GTDT_TIMER_FLAG_INTERRUPT_MODE_MASK 0x00000001
  582. #define GTDT_TIMER_FLAG_INTERRUPT_MODE_EDGE 0x00000001
  583. #define GTDT_TIMER_FLAG_INTERRUPT_MODE_LEVEL 0x00000000
  584. #define GTDT_TIMER_FLAG_INTERRUPT_POLARITY_MASK 0x00000002
  585. #define GTDT_TIMER_FLAG_INTERRUPT_POLARITY_ACTIVE_LOW 0x00000002
  586. #define GTDT_TIMER_FLAG_INTERRUPT_POLARITY_ACTIVE_HIGH 0x00000000
  587. //
  588. // ------------------------------------------------------ Data Type Definitions
  589. //
  590. /*++
  591. Structure Description:
  592. This structure describes platform register locations. It is used to express
  593. register addresses within tables defined by ACPI.
  594. Members:
  595. AddressSpaceId - Stores type ADDRESS_SPACE_TYPE defining where the data
  596. structure or register exists.
  597. RegisterBitWidth - Stores the size in bits of the given register. When
  598. addressing a data structure, this field must be zero.
  599. AccessSize - Stores the size in bytes of the access. 0 is undefined, 1 for
  600. byte access, 2 for word access, 3 for double-word access, and 4 for
  601. quad-word access.
  602. Address - Stores the 64-bit address of the data structure or register in
  603. the given address space (relative to the processor).
  604. --*/
  605. typedef struct _GENERIC_ADDRESS {
  606. UCHAR AddressSpaceId;
  607. UCHAR RegisterBitWidth;
  608. UCHAR RegisterBitOffset;
  609. UCHAR AccessSize;
  610. ULONGLONG Address;
  611. } PACKED GENERIC_ADDRESS, *PGENERIC_ADDRESS;
  612. /*++
  613. Structure Description:
  614. This structure describes the Root System Description Pointer. This is used
  615. to locate the Root System Description Table or the Extended Root System
  616. Description Table. According to ACPI, this structure can be found on PC/AT
  617. systems by searching the 1 KB of the Extended BIOS data area, or the ROM
  618. space between 0xE0000 and 0xFFFFF.
  619. Members:
  620. Signature - Stores "RSD PTR ".
  621. Checksum - Stores a value such that the sum of the first 20 bytes of this
  622. structure including the checksum sum to zero.
  623. OemId - Stores an OEM-supplied string that identifies the OEM.
  624. Revision - Stores the revision number of the structure. As of ACPI 3.0b,
  625. the revision number is 2.
  626. RsdtAddress - Stores the 32-bit physical address of the RSDT.
  627. Length - Stores the length of the table, in bytes.
  628. XsdtAddress - Stores the 64-bit physical address of the XSDT.
  629. ExtendedChecksum - Stores the checksum of the entire table, including both
  630. checksum fields.
  631. Reserved - These fields are reserved.
  632. --*/
  633. typedef struct _RSDP {
  634. ULONGLONG Signature;
  635. UCHAR Checksum;
  636. UCHAR OemId[6];
  637. UCHAR Revision;
  638. ULONG RsdtAddress;
  639. ULONG Length;
  640. ULONGLONG XsdtAddress;
  641. UCHAR ExtendedChecksum;
  642. UCHAR Reserved[3];
  643. } PACKED RSDP, *PRSDP;
  644. /*++
  645. Structure Description:
  646. This structure describes the beginning of all system description tables.
  647. The signature field determines the content of the system description table.
  648. Members:
  649. Signature - Stores the ASCII string representation of the table identifier.
  650. Length - Store the length of the table, in bytes, including the header.
  651. Revision - Stores the revision of the structure corresponding to the
  652. signature field for this table. Larger revision numbers are backwards
  653. compatible with lower revision numbers of the same signature.
  654. Checksum - Stores a byte such that the entire table, including the checksum
  655. field, must add to zero to be considered valid.
  656. OemId - Stores an OEM-supplied string that identifies the OEM.
  657. OemTableId - Stores an OEM-supplied string that the OEM uses to identify
  658. the particular data table. This field is particularly useful when
  659. defining a definition block to distinguish definition block functions.
  660. The OEM assigns each dissimilar table a new OEM Table ID.
  661. OemRevision - Stores the OEM-supplied revision number. Larger numbers are
  662. assumed to be newer revisions.
  663. CreatorId - Stores the Vendor ID of the utility that created the table. For
  664. tables containing Definition Blocks, this is the ID for the ASL
  665. compiler.
  666. CreatorRevision - Stores the revision of the utility that created the table.
  667. For tables containing Definition Blocks, this is the revision of the
  668. ASL compiler.
  669. --*/
  670. typedef struct _DESCRIPTION_HEADER {
  671. ULONG Signature;
  672. ULONG Length;
  673. UCHAR Revision;
  674. UCHAR Checksum;
  675. UCHAR OemId[6];
  676. ULONGLONG OemTableId;
  677. ULONG OemRevision;
  678. ULONG CreatorId;
  679. ULONG CreatorRevision;
  680. } PACKED DESCRIPTION_HEADER, *PDESCRIPTION_HEADER;
  681. /*++
  682. Structure Description:
  683. This structure describes the Root System Description Table. The table
  684. provides a list of pointers to other tables. The length field of the header
  685. implies how many entries exist in the table.
  686. Members:
  687. Header - Store the table header, including the signature 'RSDT'.
  688. Entries - Stores the list of 32-bit physical pointers to other ACPI tables.
  689. --*/
  690. typedef struct _RSDT {
  691. DESCRIPTION_HEADER Header;
  692. ULONG Entries[ANYSIZE_ARRAY];
  693. } PACKED RSDT, *PRSDT;
  694. /*++
  695. Structure Description:
  696. This structure describes the Extended System Description Table. The table
  697. provides a list of pointers to other tables. The length field of the header
  698. implies how many entries exist in the table. This table provides identical
  699. functionality to the RSDT, but uses 64-bit addresses.
  700. Members:
  701. Header - Store the table header, including the signature 'XSDT'.
  702. Entries - Stores the list of 64-bit physical pointers to other ACPI tables.
  703. --*/
  704. typedef struct _XSDT {
  705. DESCRIPTION_HEADER Header;
  706. ULONGLONG Entries[ANYSIZE_ARRAY];
  707. } PACKED XSDT, *PXSDT;
  708. /*++
  709. Structure Description:
  710. This structure describes the Fixed ACPI Description Table, which defines
  711. various fixed hardware ACPI information vital to an ACPI-compatible OS. The
  712. FADT also has a pointer to the DSDT that contains the Differentiated
  713. Definition Block, which provides base system design information.
  714. Members:
  715. Header - Store the table header, including the signature 'FACP'.
  716. FirmwareControlAddress - Stores the physical memory address of the FACS,
  717. where OSPM and firmware exchange control information.
  718. DsdtAddress - Stores the physical address of the DSDT.
  719. Reserved1 - This field is reserved.
  720. PreferredPowerProfile - Stores the preferred power managment profile, used
  721. to set default power policy during OS installation. Valid values are:
  722. 0 - Unspecified
  723. 1 - Desktop
  724. 2 - Mobile
  725. 3 - Workstation
  726. 4 - Enterprise Server
  727. 5 - SOHO Server
  728. 6 - Appliance PC
  729. 7 - Performance Server
  730. SciVector - Stores the system vector the SCI interrupt is wired to in
  731. legacy 8259 mode. On systems that do not contain the 8259, this field
  732. contains the Global System Interrupt number of the SCI interrupt. OSPM
  733. is required to treat the ACPI SCI interrupt as a sharable, level,
  734. active low interrupt.
  735. SciCommandPort - Stores the system port address of the SMI command port.
  736. AcpiEnable - Stores the value to write to the SMI command port to disable
  737. SMI ownership of the ACPI hardware registers. The OS should see the
  738. SCI_EN bit flip on when the firmware has fully relinquished control of
  739. the hardware registers.
  740. AcpiDisable - Stores the value to write to the SMI command port to re-enable
  741. SMI ownership of the ACPI hardware registers.
  742. S4BiosRequest - Stores the value to write to the SMI command port to enter
  743. the S4BIOS state. This is an alternate way to enter the S4 state where
  744. the firmware saves and restores the memory context. A value of 0 means
  745. not supported.
  746. PStateControl - Stores the value to write to the SMI command register to
  747. assume processor performance state control responsibility.
  748. Pm1aEventBlock - Stores the system port address of the PM1a Event Register
  749. Block.
  750. Pm1bEventBlock - Stores the system port address of the PM1b Event Register
  751. Block.
  752. Pm1aControlBlock - Stores the system port address of the PM1a Control
  753. Register Block.
  754. Pm1bControlBlock - Stores the system port address of the PM1b Control
  755. Register Block.
  756. Pm2ControlBlock - Stores the system port address of the PM2 Control
  757. Register Block. This field is optional.
  758. PmTimerBlock - Stores the system port address of the Power Management
  759. Timer Control Register Block.
  760. Gpe0Block - Stores the system port address of the General Purpose Event 0
  761. Register Block. Zero indicates not supported.
  762. Gpe1Block - Stores the system port address of the General Purpose Event 1
  763. Register Block. Zero indicates not supported.
  764. Pm1EventLength - Stores the number of bytes decoded by the PM1a and PM1b
  765. Event Blocks. This value is >= 4.
  766. Pm1ControlLength - Stores the number of bytes decoded by the PM1a and PM1b
  767. Control Blocks. This value is >= 2.
  768. Pm2ControlLength - Stores the number of bytes decoded by the PM2 Control
  769. Block. If supported, this value is >= 1. If not supported, this field
  770. is 0.
  771. PmTimerLength - Stores the number of bytes decoded by the PM Timer block.
  772. This field's value must be 4.
  773. Gpe0BlockLength - Stores the number of bytes decoded by the GPE0 Block. This
  774. value is a non-negative multiple of 2.
  775. Gpe1BlockLength - Stores the number of bytes decoded by the GPE1 Block. This
  776. value is a non-negative multiple of 2.
  777. Gpe1Base - Stores the offset within the ACPI general purpose event model
  778. where GPE1 based events start.
  779. CstControl - Stores the value to write to the SMI command port to indicate
  780. OS support for the _CST object and C States Changed notification.
  781. C2Latency - Stores the worst-case latency, in microseconds, to enter and
  782. exit a C2 state. A value > 100 indicates that the system does not
  783. support C2.
  784. C3Latency - Stores the worst-case latency, in microseconds, to enter and
  785. exit a C3 state. A value > 1000 indicates that the system does not
  786. support C3.
  787. FlushSize - Stores the number of flush strides that need to be read (using
  788. cacheable addresses) to completely flush dirty lines from any
  789. processor's memory caches. This field is maintained for ACPI 1.0
  790. compatibility, newer processors set WBINVD=1 and the OS is expected
  791. to flush caches that way.
  792. FlushStride - Stores the cache line width, in bytes, of the processor's
  793. memory caches. This field is ignored if WBINVD=1, and is maintained for
  794. ACPI 1.0 compatibility.
  795. DutyOffset - Stores the zero-based index of where the processor's duty
  796. cycle setting is within the processor's P_CNT register.
  797. DutyWidth - Stores the bit width of the processor's duty cycle setting in
  798. the P_CNT register. Each processor's duty cycle setting allows the
  799. software to slect a nominal processor frequency below its absolute
  800. frequency as defined by (BaseFrequency * DutyCycle) / (2^DutyWidth).
  801. DayAlarm - Stores the CMOS RAM index to the day-of-month alarm value.
  802. MonthAlarm - Stores the CMOS RAM index to the month-of-year alarm value.
  803. Century - Stores the CMOS RAM index to the century of data value.
  804. IaBootFlags - Stores the IA-PC Boot ArchitectureFlags.
  805. Reserved2 - This field is reserved.
  806. Flags - Stores the fixed feature flags.
  807. ResetRegister - Stores the address of the Reset Register. Only System I/O
  808. Space, System Memory space, and PCI Configuration Space (Bus 0) are
  809. valid. RegisterBitWidth must be 8 and RegisterBitOffset must be 0.
  810. ResetValue - Stores the value to write to the Reset Register port to reset
  811. the system.
  812. Reserved3 - This field is reserved.
  813. XFirmwareControl - Stores the 64-bit address of the FACS.
  814. XDsdt - Stores the 64-bit address of the DSDT.
  815. XPm1aEventBlock - Stores the address of the PM1a Event Register Block. This
  816. supercedes the original Pm1aEventBlock field.
  817. XPm1bEventBlock - Stores the address of the PM1b Event Register Block. This
  818. supercedes the original Pm1bEventBlock field.
  819. XPm1aControlBlock - Stores the address of the PM1a Control Register Block.
  820. This supercedes the original Pm1aControlBlock field.
  821. XPm1bControlBlock - Stores the address of the PM1b Control Register Block.
  822. This supercedes the original Pm1bControlBlock field.
  823. XPm2ControlBlock - Stores the address of the PM2 Control Register Block.
  824. This supercedes the original Pm2ControlBlock field.
  825. XPmTimerBlock - Stores the address of the PM Timer Control Register Block.
  826. This supercedes the original PmTimerBlock.
  827. XGpe0Block - Stores the address of the General Purpose Event 0 Register
  828. Block. This supercedes the original Gpe0Block.
  829. XGpe1Block - Stores the address of the General Purpose Event 1 Register
  830. Block. This supercedes the original Gpe1Block.
  831. --*/
  832. typedef struct _FADT {
  833. DESCRIPTION_HEADER Header;
  834. ULONG FirmwareControlAddress;
  835. ULONG DsdtAddress;
  836. UCHAR Reserved1;
  837. UCHAR PreferredPowerProfile;
  838. USHORT SciVector;
  839. ULONG SmiCommandPort;
  840. UCHAR AcpiEnable;
  841. UCHAR AcpiDisable;
  842. UCHAR S4BiosRequest;
  843. UCHAR PStateControl;
  844. ULONG Pm1aEventBlock;
  845. ULONG Pm1bEventBlock;
  846. ULONG Pm1aControlBlock;
  847. ULONG Pm1bControlBlock;
  848. ULONG Pm2ControlBlock;
  849. ULONG PmTimerBlock;
  850. ULONG Gpe0Block;
  851. ULONG Gpe1Block;
  852. UCHAR Pm1EventLength;
  853. UCHAR Pm1ControlLength;
  854. UCHAR Pm2ControlLength;
  855. UCHAR PmTimerLength;
  856. UCHAR Gpe0BlockLength;
  857. UCHAR Gpe1BlockLength;
  858. UCHAR Gpe1Base;
  859. UCHAR CstControl;
  860. USHORT C2Latency;
  861. USHORT C3Latency;
  862. USHORT FlushSize;
  863. USHORT FlushStride;
  864. UCHAR DutyOffset;
  865. UCHAR DutyWidth;
  866. UCHAR DayAlarm;
  867. UCHAR MonthAlarm;
  868. UCHAR Century;
  869. USHORT IaBootFlags;
  870. UCHAR Reserved2;
  871. ULONG Flags;
  872. GENERIC_ADDRESS ResetRegister;
  873. UCHAR ResetValue;
  874. UCHAR Reserved3[3];
  875. ULONGLONG XFirmwareControl;
  876. ULONGLONG XDsdt;
  877. GENERIC_ADDRESS XPm1aEventBlock;
  878. GENERIC_ADDRESS XPm1bEventBlock;
  879. GENERIC_ADDRESS XPm1aControlBlock;
  880. GENERIC_ADDRESS XPm1bControlBlock;
  881. GENERIC_ADDRESS XPm2ControlBlock;
  882. GENERIC_ADDRESS XPmTimerBlock;
  883. GENERIC_ADDRESS XGpe0Block;
  884. GENERIC_ADDRESS XGpe1Block;
  885. } PACKED FADT, *PFADT;
  886. /*++
  887. Structure Description:
  888. This structure describes the Firmware ACPI Control Structure.
  889. Members:
  890. Signature - Stores the four byte signature of this table, 'FACS'.
  891. Length - Stores the complete length of the structure.
  892. HardwareSignature - Stores the value of the system's "hardware signature"
  893. at last boot. This value is calulated by the BIOS on a best effort
  894. basis to indicate the base hardware configuration of the system. The
  895. OSPM uses this information when waking from an S4 state by comparing
  896. this signature to the one seen on boot to determine if the hardware
  897. configuration has changed while the system was in S4.
  898. FirmwareWakingVector - Stores a value superceded by the
  899. XFirmwareWakingVector field. Before transitioning the system into a
  900. global sleeping state, the OSPM fills in this field with the physical
  901. memory address of an OS-specific wake function. When waking up, the
  902. BIOS jumps to this address. On PC platforms, the address is in memory
  903. below 1MB and the address is jumped to in real mode. If the address
  904. were 0x12345, the real mode address jumped to would be CS:IP =
  905. 0x1234:0x0005. A20 will not have been enabled.
  906. GlobalLock - Stores the global lock used to synchronize access to the
  907. shared hardware resources between the OSPM and external firmware.
  908. See FACS_GLOBAL_LOCK_* definitions.
  909. Flags - Stores a bitfield of flags. See FACS_FLAG_* definitions.
  910. XFirmwareWakingVector - Stores the 64-bit physical address of the OSPM's
  911. waking vector. Before transitioning the system into a global sleeping
  912. state, the OSPM fills in this field with the physical memory address of
  913. an OS-specific wake function. When waking up, the BIOS jumps to this
  914. address in either 32-bit or 64-bit mode. If the platform supports
  915. 64-bit mode, firmware inspects the OSPM flags during POST. If the
  916. 64BIT_WAKE_F flag is set, the platform firmware creates a 64-bit
  917. execution environment. Otherwise, the platform creates a 32-bit
  918. execution environment. For a 64-bit execution environment, interrupts
  919. must be disabled (EFLAGS.IF is zero), long mode is enabled, paging
  920. mode is enabled and physical memory for the waking vector is identity
  921. mapped (to a single page), and selectors are set to flat. For a 32-bit
  922. execution environment, interrupts are also disabled, memory address
  923. translation is disabled, and the segment registers are set flat.
  924. Version - Stores the value 2, the current version of this table.
  925. Reserved - Stores some padding bytes used for alignment.
  926. OspmFlags - Stores OSPM-enabled firmware control flags. Platform firmware
  927. initializes this to zero. See FACS_OSPM_FLAG_* definitions.
  928. --*/
  929. typedef struct _FACS {
  930. ULONG Signature;
  931. ULONG Length;
  932. ULONGLONG HardwareSignature;
  933. ULONG FirmwareWakingVector;
  934. ULONG GlobalLock;
  935. ULONGLONG XFirmwareWakingVector;
  936. UCHAR Version;
  937. UCHAR Reserved[3];
  938. ULONG OspmFlags;
  939. } PACKED FACS, *PFACS;
  940. /*++
  941. Structure Description:
  942. This structure describes the interrupt model information for systems with
  943. an APIC or SAPIC implementation.
  944. Members:
  945. Header - Stores the table header, including the signature, 'APIC'.
  946. ApicAddress - Stores the 32-bit physical address at which each processor
  947. can access its local APIC.
  948. Flags - Stores APIC flags. The only flag currently defined is bit 0, which
  949. indicates that the system is a dual 8259 compatible PC.
  950. ApicStructures - Stores a list of APIC structures describing local APICs,
  951. IOAPICs, NMI sources, etc.
  952. --*/
  953. typedef struct _MADT {
  954. DESCRIPTION_HEADER Header;
  955. ULONG ApicAddress;
  956. ULONG Flags;
  957. // ApicStructures[n].
  958. } PACKED MADT, *PMADT;
  959. /*++
  960. Structure Description:
  961. This structure describes an entry in the MADT whose content is not yet
  962. fully known.
  963. Members:
  964. Type - Stores the type of entry, used to differentiate the various types
  965. of entries.
  966. Length - Stores the size of the entry, in bytes.
  967. --*/
  968. typedef struct _MADT_GENERIC_ENTRY {
  969. UCHAR Type;
  970. UCHAR Length;
  971. } PACKED MADT_GENERIC_ENTRY, *PMADT_GENERIC_ENTRY;
  972. /*++
  973. Structure Description:
  974. This structure describes a local APIC unit in the MADT.
  975. Members:
  976. Type - Stores 0 to indicate a Processor Local APIC structure.
  977. Length - Stores 8, the size of this structure.
  978. AcpiProcessorId - Stores the Processor ID for which this processor is listed
  979. in the ACPI Processor declaration operator.
  980. ApicId - Stores the processor's local APIC ID.
  981. Flags - Stores flags governing this APIC. See MADT_LOCAL_APIC_FLAG_*.
  982. --*/
  983. typedef struct _MADT_LOCAL_APIC {
  984. UCHAR Type;
  985. UCHAR Length;
  986. UCHAR AcpiProcessorId;
  987. UCHAR ApicId;
  988. ULONG Flags;
  989. } PACKED MADT_LOCAL_APIC, *PMADT_LOCAL_APIC;
  990. /*++
  991. Structure Description:
  992. This structure describes an IO APIC in the MADT.
  993. Members:
  994. Type - Stores 1 to indicate that this is an IOAPIC description.
  995. Length - Stores 12, the size of this structure.
  996. IoApicId - Stores the IO APIC's ID.
  997. Reserved - This field is reserved.
  998. IoApicAddress - Stores the unique 32-bit physical address to access this
  999. IO APIC. Each IO APIC resides at a unique address.
  1000. GsiBase - Stores the Global System Interrupt number where this IO APIC's
  1001. interrupt inputs start. The number of interrupts is determined by the
  1002. IO APIC's MaxRedirEntry register.
  1003. --*/
  1004. typedef struct _MADT_IO_APIC {
  1005. UCHAR Type;
  1006. UCHAR Length;
  1007. UCHAR IoApicId;
  1008. UCHAR Reserved;
  1009. ULONG IoApicAddress;
  1010. ULONG GsiBase;
  1011. } PACKED MADT_IO_APIC, *PMADT_IO_APIC;
  1012. /*++
  1013. Structure Description:
  1014. This structure describes a local APIC unit in the MADT.
  1015. Members:
  1016. Type - Stores 2 to indicate an Interrupt Override structure.
  1017. Length - Stores 10, the size of this structure.
  1018. Bus - Stores the bus type, which is always 0 for ISA.
  1019. Irq - Stores the source 8259 PIC interrupt number being altered. Valid
  1020. values are 0 through 15.
  1021. Gsi - Stores the Global System Interrupt number corresponding to the IRQ
  1022. number.
  1023. Flags - Stores a bitfield of flags. See MADT_INTERRUPT_* definitions.
  1024. --*/
  1025. typedef struct _MADT_INTERRUPT_OVERRIDE {
  1026. UCHAR Type;
  1027. UCHAR Length;
  1028. UCHAR Bus;
  1029. UCHAR Irq;
  1030. ULONG Gsi;
  1031. USHORT Flags;
  1032. } PACKED MADT_INTERRUPT_OVERRIDE, *PMADT_INTERRUPT_OVERRIDE;
  1033. /*++
  1034. Structure Description:
  1035. This structure describes a GIC CPU interface unit in the MADT.
  1036. Members:
  1037. Type - Stores a value to indicate a Processor GIC CPU interface structure
  1038. (0xB).
  1039. Length - Stores the size of this structure, 40.
  1040. Reserved - Stores a reserved value which must be zero.
  1041. GicId - Store the local GIC's hardware ID.
  1042. AcpiProcessorId - Stores the Processor ID for which this processor is listed
  1043. in the ACPI Processor declaration operator.
  1044. Flags - Stores flags governing this GIC CPU interface. See
  1045. MADT_LOCAL_GIC_FLAG_*.
  1046. ParkingProtocolVersion - Stores the version of the ARM processor parking
  1047. protocol implemented.
  1048. PerformanceInterruptGsi - Stores the GSI of the performance interrupt.
  1049. ParkedAddress - Stores the physical address of the processor's parking
  1050. protocol mailbox.
  1051. BaseAddress - Stores the physical address of the GIC CPU interface. If the
  1052. "local interrupt controller address" field is provided, this field is
  1053. ignored.
  1054. --*/
  1055. typedef struct _MADT_GIC {
  1056. UCHAR Type;
  1057. UCHAR Length;
  1058. USHORT Reserved;
  1059. ULONG GicId;
  1060. ULONG AcpiProcessorId;
  1061. ULONG Flags;
  1062. ULONG ParkingProtocolVersion;
  1063. ULONG PerformanceInterruptGsi;
  1064. ULONGLONG ParkedAddress;
  1065. ULONGLONG BaseAddress;
  1066. } PACKED MADT_GIC, *PMADT_GIC;
  1067. /*++
  1068. Structure Description:
  1069. This structure describes a GIC distributor unit.
  1070. Members:
  1071. Type - Stores 0xC to indicate that this is a GIC distributor description.
  1072. Length - Stores 24, the size of this structure.
  1073. Reserved - Stores a reserved field that must be zero.
  1074. GicId - Stores the hardware ID of the GIC distributor unit.
  1075. BaseAddress - Stores the physical address of the distributor base.
  1076. GsiBase - Stores the Global System Interrupt number where this IO APIC's
  1077. interrupt inputs start. The number of interrupts is determined by the
  1078. IO APIC's MaxRedirEntry register.
  1079. Reserved2 - Stores another reserved value that must be zero.
  1080. --*/
  1081. typedef struct _MADT_GIC_DISTRIBUTOR {
  1082. UCHAR Type;
  1083. UCHAR Length;
  1084. USHORT Reserved;
  1085. ULONG GicId;
  1086. ULONGLONG BaseAddress;
  1087. ULONG GsiBase;
  1088. ULONG Reserved2;
  1089. } PACKED MADT_GIC_DISTRIBUTOR, *PMADT_GIC_DISTRIBUTOR;
  1090. /*++
  1091. Structure Description:
  1092. This structure describes the debug port table, revision 2.
  1093. Members:
  1094. Header - Stores the standard ACPI table header.
  1095. DeviceInformationOffset - Stores the offset in bytes from the beginning of
  1096. the table to the beginning of the device information structure.
  1097. DeviceInformationCount - Stores the number of device information structures
  1098. that are in the array starting at the device information offset.
  1099. --*/
  1100. typedef struct _DEBUG_PORT_TABLE2 {
  1101. DESCRIPTION_HEADER Header;
  1102. ULONG DeviceInformationOffset;
  1103. ULONG DeviceInformationCount;
  1104. } PACKED DEBUG_PORT_TABLE2, *PDEBUG_PORT_TABLE2;
  1105. /*++
  1106. Structure Description:
  1107. This structure describes the debug device information contained within
  1108. the debug port table, revision 2. Following this structure is an array of
  1109. generic addresses, an array of sizes for each generic address, an ASCII
  1110. ACPI namespace string, and OEM-specific data.
  1111. Members:
  1112. Revision - Stores the revision of the structure, currently 0.
  1113. Length - Stores the length of this structure including the namespace string
  1114. and OEM data.
  1115. GenericAddressCount - Stores the number of generic address registers in
  1116. the array that follows this structure.
  1117. NamespaceStringLength - Stores the length of the ASCII null-terminated
  1118. string identifying the device in the ACPI namespace.
  1119. NamespaceStringOffset - Stores the offset in bytes from the beginning of
  1120. this structure to the namespace string.
  1121. OemDataLength - Stores the length of the OEM data.
  1122. OemDataOffset - Stores the offset in bytes from the beginning of this
  1123. structure to the OEM data.
  1124. PortType - Stores the debug port type. See DEBUG_PORT_TYPE_* definitions.
  1125. PortSubType - Stores the port sub-type. See DEBUG_PORT_* definitions.
  1126. Reserved - Stores a reserved value that must be zero.
  1127. BaseAddressRegisterOffset - Stores the offset in bytes from the beginning
  1128. of this structure to the array of generic address structures.
  1129. AddressSizeOffset - Stores the offset in bytes from the beginning of this
  1130. structure to the array of sizes that correspond to each generic
  1131. address structure.
  1132. --*/
  1133. typedef struct _DEBUG_DEVICE_INFORMATION {
  1134. UCHAR Revision;
  1135. USHORT Length;
  1136. UCHAR GenericAddressCount;
  1137. USHORT NamespaceStringLength;
  1138. USHORT NamespaceStringOffset;
  1139. USHORT OemDataLength;
  1140. USHORT OemDataOffset;
  1141. USHORT PortType;
  1142. USHORT PortSubType;
  1143. USHORT Reserved;
  1144. USHORT BaseAddressRegisterOffset;
  1145. USHORT AddressSizeOffset;
  1146. } PACKED DEBUG_DEVICE_INFORMATION, *PDEBUG_DEVICE_INFORMATION;
  1147. /*++
  1148. Structure Description:
  1149. This structure describes the debug port table, revision 2.
  1150. Members:
  1151. Signature - Stores a constant signature used for verification of the
  1152. contents of the structure. Set to DEBUG_PORT_16550_OEM_DATA_SIGNATURE.
  1153. BaseBaud - Stores the baud rate for a divisor of 1.
  1154. RegisterOffset - Stores the offset from the base of the region where the
  1155. 16550-compatible registers start.
  1156. RegisterShift - Stores the amount to shift the standard 16550 register
  1157. numbers by to get correct offsets.
  1158. Flags - Stores a bitmask of flags for the device. See
  1159. DEBUG_PORT_16550_OEM_FLAG_* for definitions.
  1160. --*/
  1161. typedef struct _DEBUG_PORT_16550_OEM_DATA {
  1162. ULONG Signature;
  1163. ULONG BaseBaud;
  1164. USHORT RegisterOffset;
  1165. USHORT RegisterShift;
  1166. ULONG Flags;
  1167. } PACKED DEBUG_PORT_16550_OEM_DATA, *PDEBUG_PORT_16550_OEM_DATA;
  1168. /*++
  1169. Structure Description:
  1170. This structure defines the system's Generic Timer information.
  1171. Members:
  1172. Header - Stores the table header, including the signature, 'GTDT'.
  1173. CounterBlockAddress - Stores the physical address of the counter block.
  1174. GlobalFlags - Stores a bitmask of global GTDT flags. See GTDT_GLOBAL_FLAG_*
  1175. for definitions.
  1176. SecurePl1Gsi - Stores the optional GSI of the secure PL1 physical timer.
  1177. Stores 0 if not provided.
  1178. SecurePl1Flags - Stores a bitmask of timer flags. See GTDT_TIMER_FLAG_* for
  1179. definitions.
  1180. NonSecurePl1Gsi - Stores the GSI of the non-secure PL1 physical timer.
  1181. NonSecurePl1Flags - Stores a bitmask of timer flags. See GTDT_TIMER_FLAG_*
  1182. for definitions.
  1183. VirtualTimerGsi - Stores the GSI of the virtual timer.
  1184. VirtualTimerFlags - Stores a bitmask of timer flags. See GTDT_TIMER_FLAG_*
  1185. for definitions.
  1186. NonSecurePl2Gsi - Stores the GSI of the non-secure PL2 physical timer.
  1187. NonSecurePl2Flags - Stores a bitmask of timer flags. See GTDT_TIMER_FLAG_*
  1188. for definitions.
  1189. --*/
  1190. typedef struct _GTDT {
  1191. DESCRIPTION_HEADER Header;
  1192. ULONGLONG CounterBlockAddress;
  1193. ULONG GlobalFlags;
  1194. ULONG SecurePl1Gsi;
  1195. ULONG SecurePl1Flags;
  1196. ULONG NonSecurePl1Gsi;
  1197. ULONG NonSecurePl1Flags;
  1198. ULONG VirtualTimerGsi;
  1199. ULONG VirtualTimerFlags;
  1200. ULONG NonSecurePl2Gsi;
  1201. ULONG NonSecurePl2Flags;
  1202. } PACKED GTDT, *PGTDT;
  1203. //
  1204. // -------------------------------------------------------------------- Globals
  1205. //
  1206. //
  1207. // -------------------------------------------------------- Function Prototypes
  1208. //