Source code of Windows XP (NT5)
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.

740 lines
30 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) Copyright MICROSOFT Corp., 1996
  4. *
  5. * Title: ACPITABL.H --- Definitions and descriptions of the various BIOS supplied ACPI tables.
  6. *
  7. * Version: 1.00
  8. *
  9. * Date: 6-17-96
  10. *
  11. * Author: Jason Clark (jasoncl)
  12. *
  13. *------------------------------------------------------------------------------
  14. *
  15. * Change log:
  16. *
  17. * DATE REV DESCRIPTION
  18. * ----------- --- -----------------------------------------------------------
  19. *
  20. ****************************************************************************/
  21. // These map to bios provided structures, so turn on 1 byte packing
  22. #ifndef _ACPITABL_H
  23. #define _ACPITABL_H
  24. #ifdef ASL_ASSEMBLER
  25. #undef PHYSICAL_ADDRESS
  26. #define PHYSICAL_ADDRESS ULONGLONG
  27. #define UNALIGNED
  28. #endif
  29. #include <pshpack1.h>
  30. // Generic Register Address Structure
  31. typedef struct _GEN_ADDR {
  32. UCHAR AddressSpaceID;
  33. UCHAR BitWidth;
  34. UCHAR BitOffset;
  35. UCHAR Reserved;
  36. PHYSICAL_ADDRESS Address;
  37. } GEN_ADDR, *PGEN_ADDR;
  38. #define RSDP_SIGNATURE 0x2052545020445352 // "RSD PTR "
  39. typedef struct _RSDP { // Root System Description Table Pointer Structure
  40. ULONGLONG Signature; // 8 UCHAR table signature 'RSD PTR '
  41. UCHAR Checksum; // checksum for first 20 bytes of table (entire ACPI 1.0 table)
  42. UCHAR OEMID[6]; // String that uniquely ID's the OEM
  43. UCHAR Revision; // 0 - ACPI 1.0; 2 - ACPI 2.0
  44. ULONG RsdtAddress;// physical address of Root System Description Table (1.0 table ended here)
  45. ULONG Length; // Length of the table in bytes
  46. PHYSICAL_ADDRESS XsdtAddress;// physical address of XSDT
  47. UCHAR XChecksum; // checksum for entire table
  48. UCHAR Reserved[3];
  49. } RSDP, *PRSDP;
  50. #define RSDP_SEARCH_RANGE_BEGIN 0xE0000 // physical address where we begin searching for the RSDP
  51. #define RSDP_SEARCH_RANGE_END 0xFFFFF
  52. #define RSDP_SEARCH_RANGE_LENGTH (RSDP_SEARCH_RANGE_END-RSDP_SEARCH_RANGE_BEGIN+1)
  53. #define RSDP_SEARCH_INTERVAL 16 // search on 16 byte boundaries
  54. typedef struct _DESCRIPTION_HEADER { // Header structure appears at the beginning of each ACPI table
  55. ULONG Signature; // Signature used to identify the type of table
  56. ULONG Length; // Length of entire table including the DESCRIPTION_HEADER
  57. UCHAR Revision; // Minor version of ACPI spec to which this table conforms
  58. UCHAR Checksum; // sum of all bytes in the entire TABLE should = 0
  59. UCHAR OEMID[6]; // String that uniquely ID's the OEM
  60. UCHAR OEMTableID[8]; // String that uniquely ID's this table (used for table patching and replacement).
  61. ULONG OEMRevision; // OEM supplied table revision number. Bigger number = newer table.
  62. UCHAR CreatorID[4]; // Vendor ID of utility which created this table.
  63. ULONG CreatorRev; // Revision of utility that created the table.
  64. } DESCRIPTION_HEADER;
  65. typedef DESCRIPTION_HEADER *PDESCRIPTION_HEADER;
  66. // Header constants
  67. #define ACPI_MAX_SIGNATURE 4
  68. #define ACPI_MAX_OEM_ID 6
  69. #define ACPI_MAX_TABLE_ID 8
  70. #define ACPI_MAX_TABLE_STRINGS ACPI_MAX_SIGNATURE + ACPI_MAX_OEM_ID + ACPI_MAX_TABLE_ID
  71. #define FACS_SIGNATURE 0x53434146 // "FACS"
  72. typedef enum {
  73. AcpiGenericSpaceMemory = 0,
  74. AcpiGenericSpaceIO,
  75. AcpiGenericSpacePciConfig,
  76. AcpiGenericSpaceEC,
  77. AcpiGenericSpaceSMBus,
  78. AcpiGenericSpaceFixedFunction = 0x7F
  79. } ACPI_GENERIC_ADDRESS_TYPE, *PACPI_GENERIC_ADDRESS_TYPE;
  80. typedef struct _FACS { // Firmware ACPI Control Structure. Note that this table does not have a header, it is pointed to by the FADT
  81. ULONG Signature; // 'FACS'
  82. ULONG Length; // Length of entire firmware ACPI control structure (must be 64 bytes or larger)
  83. ULONG HardwareSignature;
  84. ULONG pFirmwareWakingVector; // physical address of location where the OS needs to put the firmware waking vector
  85. ULONG GlobalLock; // 32 bit structure used for sharing Embedded Controller
  86. ULONG Flags;
  87. PHYSICAL_ADDRESS x_FirmwareWakingVector; // 64-bit capable firmware vector
  88. UCHAR version;
  89. UCHAR Reserved[31];
  90. } FACS, *PFACS;
  91. // FACS.GlobalLock bit field definitions
  92. #define GL_PENDING_BIT 0x00
  93. #define GL_PENDING (1 << GL_PENDING_BIT)
  94. #define GL_OWNER_BIT 0x01
  95. #define GL_OWNER (1 << GL_OWNER_BIT)
  96. #define GL_NON_RESERVED_BITS_MASK (GL_PENDING+GL_OWNED)
  97. // FACS Flags definitions
  98. #define FACS_S4BIOS_SUPPORTED_BIT 0 // flag indicates whether or not the BIOS will save/restore memory around S4
  99. #define FACS_S4BIOS_SUPPORTED (1 << FACS_S4BIOS_SUPPORTED_BIT)
  100. #define FADT_SIGNATURE 0x50434146 // "FACP"
  101. typedef struct _FADT { // Fixed ACPI description table
  102. DESCRIPTION_HEADER Header;
  103. ULONG facs; // Physical address of the Firmware ACPI Control Structure
  104. ULONG dsdt; // Physical address of the Differentiated System Description Table
  105. UCHAR int_model; // System's Interrupt mode, 0=Dual PIC, 1=Multiple APIC, >1 reserved
  106. UCHAR pm_profile; // System's preferred power profile
  107. USHORT sci_int_vector; // Vector of SCI interrupt.
  108. ULONG smi_cmd_io_port; // Address in System I/O Space of the SMI Command port, used to enable and disable ACPI.
  109. UCHAR acpi_on_value; // Value out'd to smi_cmd_port to activate ACPI
  110. UCHAR acpi_off_value; // Value out'd to smi_cmd_port to deactivate ACPI
  111. UCHAR s4bios_req; // Value to write to SMI_CMD to enter the S4 state.
  112. UCHAR pstate_control; // Value to write to SMI_CMD to assume control of processor performance states
  113. ULONG pm1a_evt_blk_io_port; // Address in System I/O Space of the PM1a_EVT_BLK register block
  114. ULONG pm1b_evt_blk_io_port; // Address in System I/O Space of the PM1b_EVT_BLK register block
  115. ULONG pm1a_ctrl_blk_io_port; // Address in System I/O Space of the PM1a_CNT_BLK register block
  116. ULONG pm1b_ctrl_blk_io_port; // Address in System I/O Space of the PM1b_CNT_BLK register block
  117. ULONG pm2_ctrl_blk_io_port; // Address in System I/O Space of the PM2_CNT_BLK register block
  118. ULONG pm_tmr_blk_io_port; // Address in System I/O Space of the PM_TMR register block
  119. ULONG gp0_blk_io_port; // Address in System I/O Space of the GP0 register block
  120. ULONG gp1_blk_io_port; // Address in System I/O Space of the GP1 register block
  121. UCHAR pm1_evt_len; // number of bytes decoded for PM1_BLK (must be >= 4)
  122. UCHAR pm1_ctrl_len; // number of bytes decoded for PM1_CNT (must be >= 2)
  123. UCHAR pm2_ctrl_len; // number of bytes decoded for PM1a_CNT (must be >= 1)
  124. UCHAR pm_tmr_len; // number of bytes decoded for PM_TMR (must be >= 4)
  125. UCHAR gp0_blk_len; // number of bytes decoded for GP0_BLK (must be multiple of 2)
  126. UCHAR gp1_blk_len; // number of bytes decoded for GP1_BLK (must be multiple of 2)
  127. UCHAR gp1_base; // index at which GP1 based events start
  128. UCHAR cstate_control; // Value to write to SMI_CMD to assume control of _CST states
  129. USHORT lvl2_latency; // Worst case latency in microseconds required to enter and leave the C2 processor state
  130. USHORT lvl3_latency; // Worst case latency in microseconds required to enter and leave the C3 processor state
  131. USHORT flush_size; // Ignored if WBINVD flag is 1 -- indicates size of memory read to flush dirty lines from
  132. // any processors memory caches. A size of zero indicates this is not supported.
  133. USHORT flush_stride; // Ignored if WBINVD flag is 1 -- the memory stride width, in bytes, to perform reads to flush
  134. // the processor's memory caches.
  135. UCHAR duty_offset; // zero based index of where the processor's duty cycle setting is within the processor's P_CNT register.
  136. UCHAR duty_width; // bit width of the processor's duty cycle setting value in the P_CNT register.
  137. // a value of zero indicates that processor duty cycle is not supported
  138. UCHAR day_alarm_index;
  139. UCHAR month_alarm_index;
  140. UCHAR century_alarm_index;
  141. USHORT boot_arch;
  142. UCHAR reserved3[1];
  143. ULONG flags; // This is the last field if the table Revision is 1
  144. GEN_ADDR reset_reg;
  145. UCHAR reset_val; // This is the last field if the table Revision is 2
  146. UCHAR reserved4[3];
  147. PHYSICAL_ADDRESS x_firmware_ctrl;
  148. PHYSICAL_ADDRESS x_dsdt;
  149. GEN_ADDR x_pm1a_evt_blk;
  150. GEN_ADDR x_pm1b_evt_blk;
  151. GEN_ADDR x_pm1a_ctrl_blk;
  152. GEN_ADDR x_pm1b_ctrl_blk;
  153. GEN_ADDR x_pm2_ctrl_blk;
  154. GEN_ADDR x_pm_tmr_blk;
  155. GEN_ADDR x_gp0_blk;
  156. GEN_ADDR x_gp1_blk; // This is the last field if the table Revision is 3
  157. } FADT, *PFADT;
  158. #define FADT_REV_1_SIZE (FIELD_OFFSET(FADT, flags) + sizeof(ULONG))
  159. #define FADT_REV_2_SIZE (FIELD_OFFSET(FADT, reset_val) + sizeof(UCHAR))
  160. #define FADT_REV_3_SIZE (FIELD_OFFSET(FADT, x_gp1_blk) + sizeof(GEN_ADDR))
  161. //
  162. // Static Resource Affinity Table
  163. //
  164. // This table describes the static topology of a ccNUMA machine.
  165. //
  166. #define ACPI_SRAT_SIGNATURE 0x54415253 // "SRAT"
  167. typedef struct _ACPI_SRAT {
  168. DESCRIPTION_HEADER Header;
  169. ULONG TableRevision;
  170. ULONG Reserved[2];
  171. } ACPI_SRAT, *PACPI_SRAT;
  172. typedef struct _ACPI_SRAT_ENTRY {
  173. UCHAR Type;
  174. UCHAR Length;
  175. UCHAR ProximityDomain;
  176. union {
  177. struct {
  178. UCHAR ApicId;
  179. struct {
  180. ULONG Enabled:1;
  181. ULONG Reserved:31;
  182. } Flags;
  183. UCHAR SApicEid;
  184. UCHAR Reserved[7];
  185. } ApicAffinity;
  186. struct {
  187. UCHAR Reserved[5];
  188. PHYSICAL_ADDRESS Base;
  189. ULONGLONG Length;
  190. struct {
  191. ULONG Enabled:1;
  192. ULONG HotPlug:1;
  193. ULONG Reserved:30;
  194. } Flags;
  195. UCHAR Reserved2[8];
  196. } MemoryAffinity;
  197. };
  198. } ACPI_SRAT_ENTRY, *PACPI_SRAT_ENTRY;
  199. typedef enum {
  200. SratProcessorLocalAPIC,
  201. SratMemory
  202. } SRAT_ENTRY_TYPE;
  203. #ifdef _IA64_
  204. // FLUSH WORKS IS FOR IA64
  205. #define FLUSH_WORKS_BIT 0
  206. #define FLUSH_WORKS (1 << FLUSH_WORKS_BIT)
  207. #endif // IA64
  208. // definition of FADT.flags bits
  209. // this one bit flag indicates whether or not the WBINVD instruction works properly,if this bit is not set we can not use S2, S3 states, or
  210. // C3 on MP machines
  211. #define WRITEBACKINVALIDATE_WORKS_BIT 0
  212. #define WRITEBACKINVALIDATE_WORKS (1 << WRITEBACKINVALIDATE_WORKS_BIT)
  213. // this flag indicates if wbinvd works EXCEPT that it does not invalidate the cache
  214. #define WRITEBACKINVALIDATE_DOESNT_INVALIDATE_BIT 1
  215. #define WRITEBACKINVALIDATE_DOESNT_INVALIDATE (1 << WRITEBACKINVALIDATE_DOESNT_INVALIDATE_BIT)
  216. // this flag indicates that the C1 state is supported on all processors.
  217. #define SYSTEM_SUPPORTS_C1_BIT 2
  218. #define SYSTEM_SUPPORTS_C1 (1 << SYSTEM_SUPPORTS_C1_BIT)
  219. // this one bit flag indicates whether support for the C2 state is restricted to uniprocessor machines
  220. #define P_LVL2_UP_ONLY_BIT 3
  221. #define P_LVL2_UP_ONLY (1 << P_LVL2_UP_ONLY_BIT)
  222. // this bit indicates whether the PWR button is treated as a fix feature (0) or a generic feature (1)
  223. #define PWR_BUTTON_GENERIC_BIT 4
  224. #define PWR_BUTTON_GENERIC (1 << PWR_BUTTON_GENERIC_BIT)
  225. #define SLEEP_BUTTON_GENERIC_BIT 5
  226. #define SLEEP_BUTTON_GENERIC (1 << SLEEP_BUTTON_GENERIC_BIT)
  227. // this bit indicates whether the RTC wakeup status is reported in fix register space (0) or not (1)
  228. #define RTC_WAKE_GENERIC_BIT 6
  229. #define RTC_WAKE_GENERIC (1 << RTC_WAKE_GENERIC_BIT)
  230. #define RTC_WAKE_FROM_S4_BIT 7
  231. #define RTC_WAKE_FROM_S4 (1 << RTC_WAKE_FROM_S4_BIT)
  232. // This bit indicates whether the machine implements a 24 or 32 bit timer.
  233. #define TMR_VAL_EXT_BIT 8
  234. #define TMR_VAL_EXT (1 << TMR_VAL_EXT_BIT)
  235. // This bit indicates whether the machine supports docking
  236. #define DCK_CAP_BIT 9
  237. #define DCK_CAP (1 << DCK_CAP_BIT)
  238. // This bit indicates whether the machine supports reset
  239. #define RESET_CAP_BIT 10
  240. #define RESET_CAP (1 << RESET_CAP_BIT)
  241. // This bit indicates whether the machine case can be opened
  242. #define SEALED_CASE_BIT 11
  243. #define SEALED_CASE_CAP (1 << SEALED_CASE_BIT)
  244. // This bit indicates whether the machine has no video
  245. #define HEADLESS_BIT 12
  246. #define HEADLESS_CAP (1 << HEADLESS_BIT)
  247. // spec defines maximum entry/exit latency values for C2 and C3, if the FADT indicates that these values are
  248. // exceeded then we do not use that C state.
  249. #define C2_MAX_LATENCY 100
  250. #define C3_MAX_LATENCY 1000
  251. //
  252. // Definition of FADT.boot_arch flags
  253. //
  254. #define LEGACY_DEVICES 1
  255. #define I8042 2
  256. #ifndef ANYSIZE_ARRAY
  257. #define ANYSIZE_ARRAY 1
  258. #endif
  259. // Multiple APIC description table
  260. typedef struct _MAPIC {
  261. DESCRIPTION_HEADER Header;
  262. ULONG LocalAPICAddress; // Physical Address at which each processor can access its local APIC
  263. ULONG Flags;
  264. ULONG APICTables[ANYSIZE_ARRAY]; // A list of APIC tables.
  265. } MAPIC;
  266. typedef MAPIC *PMAPIC;
  267. // Multiple APIC structure flags
  268. #define PCAT_COMPAT_BIT 0 // indicates that the system also has a dual 8259 pic setup.
  269. #define PCAT_COMPAT (1 << PCAT_COMPAT_BIT)
  270. // APIC Structure Types
  271. #define PROCESSOR_LOCAL_APIC 0
  272. #define IO_APIC 1
  273. #define ISA_VECTOR_OVERRIDE 2
  274. #define IO_NMI_SOURCE 3
  275. #define LOCAL_NMI_SOURCE 4
  276. #define ADDRESS_EXTENSION_STRUCTURE 5
  277. #define IO_SAPIC 6
  278. #define LOCAL_SAPIC 7
  279. #define PLATFORM_INTERRUPT_SOURCE 8
  280. #define PROCESSOR_LOCAL_APIC_LENGTH 8
  281. #define IO_APIC_LENGTH 12
  282. #define ISA_VECTOR_OVERRIDE_LENGTH 10
  283. #define IO_NMI_SOURCE_LENGTH 8
  284. #define LOCAL_NMI_SOURCE_LENGTH 6
  285. #define PLATFORM_INTERRUPT_SOURCE_LENGTH 16
  286. #define IO_SAPIC_LENGTH 16
  287. #define PROCESSOR_LOCAL_SAPIC_LENGTH 12
  288. // Platform Interrupt Types
  289. #define PLATFORM_INT_PMI 1
  290. #define PLATFORM_INT_INIT 2
  291. #define PLATFORM_INT_CPE 3
  292. // These defines come from the MPS 1.4 spec, section 4.3.4 and they are referenced as
  293. // such in the ACPI spec.
  294. #define PO_BITS 3
  295. #define POLARITY_HIGH 1
  296. #define POLARITY_LOW 3
  297. #define POLARITY_CONFORMS_WITH_BUS 0
  298. #define EL_BITS 0xc
  299. #define EL_BIT_SHIFT 2
  300. #define EL_EDGE_TRIGGERED 4
  301. #define EL_LEVEL_TRIGGERED 0xc
  302. #define EL_CONFORMS_WITH_BUS 0
  303. // The shared beginning info in all APIC Structures
  304. typedef struct _APICTABLE {
  305. UCHAR Type;
  306. UCHAR Length;
  307. } APICTABLE;
  308. typedef APICTABLE UNALIGNED *PAPICTABLE;
  309. typedef struct _PROCLOCALAPIC {
  310. UCHAR Type; // should be zero to identify a ProcessorLocalAPIC structure
  311. UCHAR Length; // better be 8
  312. UCHAR ACPIProcessorID; // ProcessorID for which this processor is listed in the ACPI processor declaration
  313. // operator.
  314. UCHAR APICID; // The processor's local APIC ID.
  315. ULONG Flags;
  316. } PROCLOCALAPIC;
  317. typedef PROCLOCALAPIC UNALIGNED *PPROCLOCALAPIC;
  318. // Processor Local APIC Flags
  319. #define PLAF_ENABLED_BIT 0
  320. #define PLAF_ENABLED (1 << PLAF_ENABLED_BIT)
  321. typedef struct _IOAPIC {
  322. UCHAR Type;
  323. UCHAR Length; // better be 12
  324. UCHAR IOAPICID;
  325. UCHAR Reserved;
  326. ULONG IOAPICAddress; // Physical address at which this IO APIC resides.
  327. ULONG SystemVectorBase; // system interrupt vector index for this APIC
  328. } IOAPIC;
  329. typedef IOAPIC UNALIGNED *PIOAPIC;
  330. // Interrupt Source Override
  331. typedef struct _ISA_VECTOR {
  332. UCHAR Type; // Must be 2
  333. UCHAR Length; // Must be 10
  334. UCHAR Bus; // Must be 0
  335. UCHAR Source; // BusRelative IRQ
  336. ULONG GlobalSystemInterruptVector; // Global IRQ
  337. USHORT Flags; // Same as MPS INTI Flags
  338. #ifdef _IA64_ // XXTF
  339. UCHAR Reserved[6]; // 6 bytes reserved as per 64 bit
  340. // extensions to ACPI spec v0.7
  341. #endif
  342. } ISA_VECTOR;
  343. typedef ISA_VECTOR UNALIGNED *PISA_VECTOR;
  344. // I/O Non-Maskable Source Interrupt
  345. typedef struct _IO_NMISOURCE {
  346. UCHAR Type; // must be 3
  347. UCHAR Length; // better be 8
  348. USHORT Flags; // Same as MPS INTI Flags
  349. ULONG GlobalSystemInterruptVector; // Interrupt connected to NMI
  350. } IO_NMISOURCE;
  351. typedef IO_NMISOURCE UNALIGNED *PIO_NMISOURCE;
  352. // Local Non-Maskable Interrupt Source
  353. typedef struct _LOCAL_NMISOURCE {
  354. UCHAR Type; // must be 4
  355. UCHAR Length; // better be 6
  356. UCHAR ProcessorID; // which processor? 0xff means all
  357. USHORT Flags;
  358. UCHAR LINTIN; // which LINTIN# signal on the processor
  359. } LOCAL_NMISOURCE;
  360. typedef LOCAL_NMISOURCE UNALIGNED *PLOCAL_NMISOURCE;
  361. typedef struct _PROCLOCALSAPIC {
  362. UCHAR Type; // PROCESSOR_LOCAL_SAPIC
  363. UCHAR Length; // PROCESSOR_LOCAL_SAPIC_LENGTH
  364. // operator.
  365. UCHAR ACPIProcessorID; // ProcessorID for which this processor is listed in the ACPI processor declaration
  366. UCHAR APICID; // The processor's local APIC ID.
  367. UCHAR APICEID; // The processor's local APIC EID.
  368. UCHAR Reserved[3];
  369. ULONG Flags;
  370. } PROCLOCALSAPIC;
  371. typedef PROCLOCALSAPIC UNALIGNED *PPROCLOCALSAPIC;
  372. typedef struct _IOSAPIC {
  373. UCHAR Type; // IO_SAPIC
  374. UCHAR Length; // IO_SAPIC_LENGTH
  375. USHORT Reserved;
  376. ULONG SystemVectorBase; // system interrupt vector index for this SAPIC
  377. ULONG_PTR IOSAPICAddress; // 64-bit Physical address at which this IO APIC resides.
  378. } IOSAPIC;
  379. typedef IOSAPIC UNALIGNED *PIOSAPIC;
  380. typedef struct _PLATFORM_INTERRUPT {
  381. UCHAR Type; // PLATFORM_INTERRUPT_SOURCE
  382. UCHAR Length; // PLATFORM_INTERRUPT_SOURCE_LENGTH
  383. USHORT Flags; // Same as MPS INTI Flags
  384. UCHAR InterruptType;
  385. UCHAR APICID;
  386. UCHAR ACPIEID;
  387. UCHAR IOSAPICVector;
  388. ULONG GlobalVector;
  389. ULONG Reserved;
  390. } PLATFORM_INTERRUPT;
  391. typedef PLATFORM_INTERRUPT UNALIGNED *PPLATFORM_INTERRUPT;
  392. //
  393. // Smart Battery
  394. //
  395. typedef struct _SMARTBATTTABLE {
  396. DESCRIPTION_HEADER Header;
  397. ULONG WarningEnergyLevel; // mWh at which the OEM suggests we warn the user that the battery is getting low.
  398. ULONG LowEnergyLevel; // mWh at which the OEM suggests we put the machine into a sleep state.
  399. ULONG CriticalEnergyLevel; // mWH at which the OEM suggests we do an emergency shutdown.
  400. } SMARTBATTTABLE;
  401. typedef SMARTBATTTABLE *PSMARTBATTTABLE;
  402. #define RSDT_SIGNATURE 0x54445352 // "RSDT"
  403. #define XSDT_SIGNATURE 0x54445358 // "XSDT"
  404. typedef struct _RSDT_32 { // Root System Description Table
  405. DESCRIPTION_HEADER Header;
  406. ULONG Tables[ANYSIZE_ARRAY]; // The structure contains an n length array of physical addresses each of which point to another table.
  407. } RSDT_32;
  408. typedef struct _RSDT_64 { // Root System Description Table
  409. DESCRIPTION_HEADER Header;
  410. ULONG Reserved; // 4 bytes reserved as per 64 bit extensions to ACPI spec v0.7
  411. ULONG_PTR Tables[ANYSIZE_ARRAY]; // The structure contains an n length array of physical addresses each of which point to another table.
  412. } RSDT_64;
  413. #ifdef _IA64_ // XXTF
  414. typedef RSDT_64 RSDT;
  415. #else
  416. typedef RSDT_32 RSDT;
  417. #endif // _IA64_ XXTF
  418. typedef RSDT *PRSDT;
  419. typedef struct _XSDT {
  420. DESCRIPTION_HEADER Header;
  421. UNALIGNED PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY];
  422. } XSDT, *PXSDT;
  423. // The below macro uses the min macro to protect against the case where we are running on machine which is compliant with
  424. // a spec prior to .99. If you had a .92 compliant header and one table pointer we would end of subtracting 32-36 resulting
  425. // in a really big number and hence we would think we had lots and lots of tables... Using the min macro we end up subtracting
  426. // the length-length getting zero which will be harmless and cause us to fail to load (with a red screen on Win9x) which is
  427. // the best we can do in this case.
  428. #ifndef min
  429. #define min(a,b) (((a) < (b)) ? (a) : (b))
  430. #endif
  431. //
  432. // BUGBUG John Vert (jvert) 4/26/2000
  433. // alpha64 machines are still running with 32-bit RSDTs. Once that support is dropped we can
  434. // remove this hack.
  435. //
  436. #ifdef _IA64_
  437. #define NumTableEntriesFromRSDTPointer(p) (p->Header.Length-min(p->Header.Length,sizeof(DESCRIPTION_HEADER)))/sizeof(ULONG_PTR)
  438. #else
  439. #define NumTableEntriesFromRSDTPointer(p) (p->Header.Length-min(p->Header.Length,sizeof(DESCRIPTION_HEADER)))/sizeof(ULONG)
  440. #endif
  441. #define NumTableEntriesFromXSDTPointer(p) (p->Header.Length-min(p->Header.Length,sizeof(DESCRIPTION_HEADER)))/sizeof(PHYSICAL_ADDRESS)
  442. #define APIC_SIGNATURE 0x43495041 // "APIC"
  443. #define SPIC_SIGNATURE 0x43495053 // "SPIC" = SAPIC (IA64 extensions to ACPI requirement)
  444. #define DSDT_SIGNATURE 0x54445344 // "DSDT"
  445. #define SSDT_SIGNATURE 0x54445353 // "SSDT"
  446. #define PSDT_SIGNATURE 0x54445350 // "PSDT"
  447. #define SBST_SIGNATURE 0x54534253 // "SBST"
  448. #define DBGP_SIGNATURE 0x50474244 // "DBGP"
  449. typedef struct _DSDT { // Differentiated System Description Table
  450. DESCRIPTION_HEADER Header;
  451. UCHAR DiffDefBlock[ANYSIZE_ARRAY]; // this is the AML describing the base system.
  452. } DSDT;
  453. typedef DSDT *PDSDT;
  454. // Resume normal structure packing
  455. #include <poppack.h>
  456. typedef struct _PROC_LOCAL_APIC {
  457. UCHAR NamespaceProcID;
  458. UCHAR ApicID;
  459. UCHAR NtNumber;
  460. BOOLEAN Started;
  461. BOOLEAN Enumerated;
  462. } PROC_LOCAL_APIC, *PPROC_LOCAL_APIC;
  463. extern PROC_LOCAL_APIC HalpProcLocalApicTable[];
  464. //
  465. // Debug Port Table
  466. //
  467. #pragma pack(1)
  468. typedef struct _DEBUG_PORT_TABLE {
  469. DESCRIPTION_HEADER Header;
  470. UCHAR InterfaceType; // Type of registry interface (0 = full 16550 interface)
  471. UCHAR Reserved0[3]; // should be 0
  472. GEN_ADDR BaseAddress; // Base address of the Debug Port register set
  473. // described using the Generic Register Address
  474. // Structure.
  475. // 0 - console redirection disabled.
  476. // e.g. COM1 (0x3F8) would be 0x1800000003F8
  477. // COM2 (Ox2F8) would be 0x1800000002F8
  478. UCHAR InterruptType; // Interrupt type(s) used by the UART.
  479. // bit 0 = PC-AT-compatible 8259 IRQ interrupt.
  480. // bit 1 = I/O APIC interrupt (Global System INterrupt)
  481. // bit 2 = I/O SAPIC interrupt (Global System Interrupt) (IRQ)
  482. // bit 3:7 = reserved (and must be 0)
  483. // Note: bit == 1 indicates support, bit == 0 indicates no support.
  484. //
  485. // Platforms with both a dual 8259 and an I/O APIC or I/O SAPIC
  486. // must set the IRQ bit (bit 0) and the corresponding Global
  487. // system interrupt bit. E.g. a system that supported 8259 and
  488. // SAPIC would be 0x5.
  489. UCHAR Irq; // 0 = none
  490. // 2 = 2
  491. // 3 = 3
  492. // ...
  493. // 16 = 16
  494. // 1, 17-255 reserved
  495. ULONG GlobalSystemInterruptVector;
  496. // The I/O APIC or I/O SAPIC Global System Interrupt used
  497. // by the UART.Valid only if Bit[1] or Bit[2] of the
  498. // Interrupt Type field is set.
  499. UCHAR BaudRate; // Baudrate for BIOS redirection
  500. // 3 = 9600
  501. // 4 = 19200
  502. // 6 = 57600
  503. // 7 = 115200
  504. // 0-2,5, 8-255 reserved
  505. UCHAR Parity; // 0 = no parity
  506. // 1-255 reserved
  507. UCHAR StopBits; // 1 = 1 stop bit
  508. // 0, 2-255 = reserved
  509. UCHAR FlowControl; // 0 = Hadware Flow Control
  510. // 1 - 255 = reserved.
  511. UCHAR TerminalType; // The terminal protocol the BIOS was using for
  512. // console redirection
  513. // 0 = VT100
  514. // 1 = Extended VT100
  515. // 2-255 = reserved
  516. UCHAR Language; // Language which the BIOS was redirecting
  517. // 0 = US Western English (standard ASCII)
  518. USHORT PciDeviceId; // Designates device ID of a PCI device that
  519. // contains a UART to be used as a headless
  520. // port.
  521. USHORT PciVendorId; // Designates vendor ID of a PCI device that
  522. // contains a UART to be used as a headless
  523. // port.
  524. UCHAR PciBusNumber; // Designates which PCI system bus the PCI device
  525. // resides on.
  526. UCHAR PciSlotNumber; // Designates which PCI slot the PCI device
  527. // resides in.
  528. UCHAR PciFunctionNumber; // Which PCI function number describes the UART.
  529. ULONG PciFlags; // PCI compatibility flags bitmask. Should be zero
  530. // by default.
  531. // 0x1 indicates operating system should NOT suppress
  532. // PnP device enumeration or disable power management
  533. // for this device.
  534. // bits 1-31 reserved.
  535. UCHAR Reserved1[4]; // should be 0
  536. } DEBUG_PORT_TABLE, *PDEBUG_PORT_TABLE;
  537. #pragma pack()
  538. //
  539. // BOOT Table -- based on Simple Boot Flag Specification 1.0
  540. //
  541. typedef struct _BOOT_TABLE {
  542. DESCRIPTION_HEADER Header;
  543. UCHAR CMOSIndex;
  544. UCHAR Reserved[3];
  545. } BOOT_TABLE, *PBOOT_TABLE;
  546. #define BOOT_SIGNATURE 0x544f4f42 // 'BOOT'
  547. //
  548. // Bits in the Boot Register
  549. //
  550. //
  551. // Set by OS to indicate that the bios need only configure boot devices
  552. //
  553. #define SBF_PNPOS_BIT 0
  554. #define SBF_PNPOS (1 << SBF_PNPOS_BIT)
  555. //
  556. // Set by BIOS to indicate beginning of boot, cleared by OS to indicate a successful boot
  557. //
  558. #define SBF_BOOTING_BIT 1
  559. #define SBF_BOOTING (1 << SBF_BOOTING_BIT)
  560. //
  561. // Set by BIOS to indicate a diagnostic boot
  562. //
  563. #define SBF_DIAG_BIT 2
  564. #define SBF_DIAG (1 << SBF_DIAG_BIT)
  565. //
  566. // Set to ensure ODD parity
  567. //
  568. #define SBF_PARITY_BIT 7
  569. #define SBF_PARITY (1 << SBF_PARITY_BIT)
  570. //
  571. // IPPT Table -- IA64 Platform Properties Table
  572. //
  573. typedef struct _IPPT_TABLE {
  574. DESCRIPTION_HEADER Header;
  575. ULONG Flags;
  576. ULONG Reserved[3];
  577. } IPPT_TABLE, *PIPPT_TABLE;
  578. #define IPPT_DISABLE_WRITE_COMBINING 0x01L
  579. #define IPPT_ENABLE_CROSS_PARTITION_IPI 0x02L
  580. #define IPPT_DISABLE_PTCG_TB_FLUSH 0x04L
  581. #define IPPT_DISABLE_UC_MAIN_MEMORY 0x08L
  582. #define IPPT_SIGNATURE 0x54505049 // 'IPPT'
  583. #endif // _ACPITBL_H