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.

794 lines
34 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. ULONG Reserved2;
  191. struct {
  192. ULONG Enabled:1;
  193. ULONG HotPlug:1;
  194. ULONG Reserved:30;
  195. } Flags;
  196. UCHAR Reserved3[8];
  197. } MemoryAffinity;
  198. };
  199. } ACPI_SRAT_ENTRY, *PACPI_SRAT_ENTRY;
  200. typedef enum {
  201. SratProcessorLocalAPIC,
  202. SratMemory
  203. } SRAT_ENTRY_TYPE;
  204. #ifdef _IA64_
  205. // FLUSH WORKS IS FOR IA64
  206. #define FLUSH_WORKS_BIT 0
  207. #define FLUSH_WORKS (1 << FLUSH_WORKS_BIT)
  208. #endif // IA64
  209. // definition of FADT.flags bits
  210. // 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
  211. // C3 on MP machines
  212. #define WRITEBACKINVALIDATE_WORKS_BIT 0
  213. #define WRITEBACKINVALIDATE_WORKS (1 << WRITEBACKINVALIDATE_WORKS_BIT)
  214. // this flag indicates if wbinvd works EXCEPT that it does not invalidate the cache
  215. #define WRITEBACKINVALIDATE_DOESNT_INVALIDATE_BIT 1
  216. #define WRITEBACKINVALIDATE_DOESNT_INVALIDATE (1 << WRITEBACKINVALIDATE_DOESNT_INVALIDATE_BIT)
  217. // this flag indicates that the C1 state is supported on all processors.
  218. #define SYSTEM_SUPPORTS_C1_BIT 2
  219. #define SYSTEM_SUPPORTS_C1 (1 << SYSTEM_SUPPORTS_C1_BIT)
  220. // this one bit flag indicates whether support for the C2 state is restricted to uniprocessor machines
  221. #define P_LVL2_UP_ONLY_BIT 3
  222. #define P_LVL2_UP_ONLY (1 << P_LVL2_UP_ONLY_BIT)
  223. // this bit indicates whether the PWR button is treated as a fix feature (0) or a generic feature (1)
  224. #define PWR_BUTTON_GENERIC_BIT 4
  225. #define PWR_BUTTON_GENERIC (1 << PWR_BUTTON_GENERIC_BIT)
  226. #define SLEEP_BUTTON_GENERIC_BIT 5
  227. #define SLEEP_BUTTON_GENERIC (1 << SLEEP_BUTTON_GENERIC_BIT)
  228. // this bit indicates whether the RTC wakeup status is reported in fix register space (0) or not (1)
  229. #define RTC_WAKE_GENERIC_BIT 6
  230. #define RTC_WAKE_GENERIC (1 << RTC_WAKE_GENERIC_BIT)
  231. #define RTC_WAKE_FROM_S4_BIT 7
  232. #define RTC_WAKE_FROM_S4 (1 << RTC_WAKE_FROM_S4_BIT)
  233. // This bit indicates whether the machine implements a 24 or 32 bit timer.
  234. #define TMR_VAL_EXT_BIT 8
  235. #define TMR_VAL_EXT (1 << TMR_VAL_EXT_BIT)
  236. // This bit indicates whether the machine supports docking
  237. #define DCK_CAP_BIT 9
  238. #define DCK_CAP (1 << DCK_CAP_BIT)
  239. // This bit indicates whether the machine supports reset
  240. #define RESET_CAP_BIT 10
  241. #define RESET_CAP (1 << RESET_CAP_BIT)
  242. // This bit indicates whether the machine case can be opened
  243. #define SEALED_CASE_BIT 11
  244. #define SEALED_CASE_CAP (1 << SEALED_CASE_BIT)
  245. // This bit indicates whether the machine has no video
  246. #define HEADLESS_BIT 12
  247. #define HEADLESS_CAP (1 << HEADLESS_BIT)
  248. // spec defines maximum entry/exit latency values for C2 and C3, if the FADT indicates that these values are
  249. // exceeded then we do not use that C state.
  250. #define C2_MAX_LATENCY 100
  251. #define C3_MAX_LATENCY 1000
  252. //
  253. // Definition of FADT.boot_arch flags
  254. //
  255. #define LEGACY_DEVICES 1
  256. #define I8042 2
  257. #ifndef ANYSIZE_ARRAY
  258. #define ANYSIZE_ARRAY 1
  259. #endif
  260. // Multiple APIC description table
  261. typedef struct _MAPIC {
  262. DESCRIPTION_HEADER Header;
  263. ULONG LocalAPICAddress; // Physical Address at which each processor can access its local APIC
  264. ULONG Flags;
  265. ULONG APICTables[ANYSIZE_ARRAY]; // A list of APIC tables.
  266. } MAPIC;
  267. typedef MAPIC *PMAPIC;
  268. // Multiple APIC structure flags
  269. #define PCAT_COMPAT_BIT 0 // indicates that the system also has a dual 8259 pic setup.
  270. #define PCAT_COMPAT (1 << PCAT_COMPAT_BIT)
  271. // APIC Structure Types
  272. #define PROCESSOR_LOCAL_APIC 0
  273. #define IO_APIC 1
  274. #define ISA_VECTOR_OVERRIDE 2
  275. #define IO_NMI_SOURCE 3
  276. #define LOCAL_NMI_SOURCE 4
  277. #define ADDRESS_EXTENSION_STRUCTURE 5
  278. #define IO_SAPIC 6
  279. #define LOCAL_SAPIC 7
  280. #define PLATFORM_INTERRUPT_SOURCE 8
  281. #define PROCESSOR_LOCAL_APIC_LENGTH 8
  282. #define IO_APIC_LENGTH 12
  283. #define ISA_VECTOR_OVERRIDE_LENGTH 10
  284. #define IO_NMI_SOURCE_LENGTH 8
  285. #define LOCAL_NMI_SOURCE_LENGTH 6
  286. #define PLATFORM_INTERRUPT_SOURCE_LENGTH 16
  287. #define IO_SAPIC_LENGTH 16
  288. #define PROCESSOR_LOCAL_SAPIC_LENGTH 12
  289. // Platform Interrupt Types
  290. #define PLATFORM_INT_PMI 1
  291. #define PLATFORM_INT_INIT 2
  292. #define PLATFORM_INT_CPE 3
  293. // These defines come from the MPS 1.4 spec, section 4.3.4 and they are referenced as
  294. // such in the ACPI spec.
  295. #define PO_BITS 3
  296. #define POLARITY_HIGH 1
  297. #define POLARITY_LOW 3
  298. #define POLARITY_CONFORMS_WITH_BUS 0
  299. #define EL_BITS 0xc
  300. #define EL_BIT_SHIFT 2
  301. #define EL_EDGE_TRIGGERED 4
  302. #define EL_LEVEL_TRIGGERED 0xc
  303. #define EL_CONFORMS_WITH_BUS 0
  304. // The shared beginning info in all APIC Structures
  305. typedef struct _APICTABLE {
  306. UCHAR Type;
  307. UCHAR Length;
  308. } APICTABLE;
  309. typedef APICTABLE UNALIGNED *PAPICTABLE;
  310. typedef struct _PROCLOCALAPIC {
  311. UCHAR Type; // should be zero to identify a ProcessorLocalAPIC structure
  312. UCHAR Length; // better be 8
  313. UCHAR ACPIProcessorID; // ProcessorID for which this processor is listed in the ACPI processor declaration
  314. // operator.
  315. UCHAR APICID; // The processor's local APIC ID.
  316. ULONG Flags;
  317. } PROCLOCALAPIC;
  318. typedef PROCLOCALAPIC UNALIGNED *PPROCLOCALAPIC;
  319. // Processor Local APIC Flags
  320. #define PLAF_ENABLED_BIT 0
  321. #define PLAF_ENABLED (1 << PLAF_ENABLED_BIT)
  322. typedef struct _IOAPIC {
  323. UCHAR Type;
  324. UCHAR Length; // better be 12
  325. UCHAR IOAPICID;
  326. UCHAR Reserved;
  327. ULONG IOAPICAddress; // Physical address at which this IO APIC resides.
  328. ULONG SystemVectorBase; // system interrupt vector index for this APIC
  329. } IOAPIC;
  330. typedef IOAPIC UNALIGNED *PIOAPIC;
  331. // Interrupt Source Override
  332. typedef struct _ISA_VECTOR {
  333. UCHAR Type; // Must be 2
  334. UCHAR Length; // Must be 10
  335. UCHAR Bus; // Must be 0
  336. UCHAR Source; // BusRelative IRQ
  337. ULONG GlobalSystemInterruptVector; // Global IRQ
  338. USHORT Flags; // Same as MPS INTI Flags
  339. } ISA_VECTOR;
  340. typedef ISA_VECTOR UNALIGNED *PISA_VECTOR;
  341. // I/O Non-Maskable Source Interrupt
  342. typedef struct _IO_NMISOURCE {
  343. UCHAR Type; // must be 3
  344. UCHAR Length; // better be 8
  345. USHORT Flags; // Same as MPS INTI Flags
  346. ULONG GlobalSystemInterruptVector; // Interrupt connected to NMI
  347. } IO_NMISOURCE;
  348. typedef IO_NMISOURCE UNALIGNED *PIO_NMISOURCE;
  349. // Local Non-Maskable Interrupt Source
  350. typedef struct _LOCAL_NMISOURCE {
  351. UCHAR Type; // must be 4
  352. UCHAR Length; // better be 6
  353. UCHAR ProcessorID; // which processor? 0xff means all
  354. USHORT Flags;
  355. UCHAR LINTIN; // which LINTIN# signal on the processor
  356. } LOCAL_NMISOURCE;
  357. typedef LOCAL_NMISOURCE UNALIGNED *PLOCAL_NMISOURCE;
  358. typedef struct _PROCLOCALSAPIC {
  359. UCHAR Type; // PROCESSOR_LOCAL_SAPIC
  360. UCHAR Length; // PROCESSOR_LOCAL_SAPIC_LENGTH
  361. // operator.
  362. UCHAR ACPIProcessorID; // ProcessorID for which this processor is listed in the ACPI processor declaration
  363. UCHAR APICID; // The processor's local APIC ID.
  364. UCHAR APICEID; // The processor's local APIC EID.
  365. UCHAR Reserved[3];
  366. ULONG Flags;
  367. } PROCLOCALSAPIC;
  368. typedef PROCLOCALSAPIC UNALIGNED *PPROCLOCALSAPIC;
  369. typedef struct _IOSAPIC {
  370. UCHAR Type; // IO_SAPIC
  371. UCHAR Length; // IO_SAPIC_LENGTH
  372. USHORT Reserved;
  373. ULONG SystemVectorBase; // system interrupt vector index for this SAPIC
  374. ULONG_PTR IOSAPICAddress; // 64-bit Physical address at which this IO APIC resides.
  375. } IOSAPIC;
  376. typedef IOSAPIC UNALIGNED *PIOSAPIC;
  377. typedef struct _PLATFORM_INTERRUPT {
  378. UCHAR Type; // PLATFORM_INTERRUPT_SOURCE
  379. UCHAR Length; // PLATFORM_INTERRUPT_SOURCE_LENGTH
  380. USHORT Flags; // Same as MPS INTI Flags
  381. UCHAR InterruptType;
  382. UCHAR APICID;
  383. UCHAR ACPIEID;
  384. UCHAR IOSAPICVector;
  385. ULONG GlobalVector;
  386. ULONG Reserved;
  387. } PLATFORM_INTERRUPT;
  388. typedef PLATFORM_INTERRUPT UNALIGNED *PPLATFORM_INTERRUPT;
  389. //
  390. // Smart Battery
  391. //
  392. typedef struct _SMARTBATTTABLE {
  393. DESCRIPTION_HEADER Header;
  394. ULONG WarningEnergyLevel; // mWh at which the OEM suggests we warn the user that the battery is getting low.
  395. ULONG LowEnergyLevel; // mWh at which the OEM suggests we put the machine into a sleep state.
  396. ULONG CriticalEnergyLevel; // mWH at which the OEM suggests we do an emergency shutdown.
  397. } SMARTBATTTABLE;
  398. typedef SMARTBATTTABLE *PSMARTBATTTABLE;
  399. #define RSDT_SIGNATURE 0x54445352 // "RSDT"
  400. #define XSDT_SIGNATURE 0x54445358 // "XSDT"
  401. typedef struct _RSDT_32 { // Root System Description Table
  402. DESCRIPTION_HEADER Header;
  403. ULONG Tables[ANYSIZE_ARRAY]; // The structure contains an n length array of physical addresses each of which point to another table.
  404. } RSDT_32;
  405. typedef struct _RSDT_64 { // Root System Description Table
  406. DESCRIPTION_HEADER Header;
  407. ULONG Reserved; // 4 bytes reserved as per 64 bit extensions to ACPI spec v0.7
  408. ULONG_PTR Tables[ANYSIZE_ARRAY]; // The structure contains an n length array of physical addresses each of which point to another table.
  409. } RSDT_64;
  410. #ifdef _IA64_ // XXTF
  411. typedef RSDT_64 RSDT;
  412. #else
  413. typedef RSDT_32 RSDT;
  414. #endif // _IA64_ XXTF
  415. typedef RSDT *PRSDT;
  416. typedef struct _XSDT {
  417. DESCRIPTION_HEADER Header;
  418. UNALIGNED PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY];
  419. } XSDT, *PXSDT;
  420. // The below macro uses the min macro to protect against the case where we are running on machine which is compliant with
  421. // a spec prior to .99. If you had a .92 compliant header and one table pointer we would end of subtracting 32-36 resulting
  422. // 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
  423. // the length-length getting zero which will be harmless and cause us to fail to load (with a red screen on Win9x) which is
  424. // the best we can do in this case.
  425. #ifndef min
  426. #define min(a,b) (((a) < (b)) ? (a) : (b))
  427. #endif
  428. //
  429. // BUGBUG John Vert (jvert) 4/26/2000
  430. // alpha64 machines are still running with 32-bit RSDTs. Once that support is dropped we can
  431. // remove this hack.
  432. //
  433. #ifdef _IA64_
  434. #define NumTableEntriesFromRSDTPointer(p) (p->Header.Length-min(p->Header.Length,sizeof(DESCRIPTION_HEADER)))/sizeof(ULONG_PTR)
  435. #else
  436. #define NumTableEntriesFromRSDTPointer(p) (p->Header.Length-min(p->Header.Length,sizeof(DESCRIPTION_HEADER)))/sizeof(ULONG)
  437. #endif
  438. #define NumTableEntriesFromXSDTPointer(p) (p->Header.Length-min(p->Header.Length,sizeof(DESCRIPTION_HEADER)))/sizeof(PHYSICAL_ADDRESS)
  439. #define APIC_SIGNATURE 0x43495041 // "APIC"
  440. #define SPIC_SIGNATURE 0x43495053 // "SPIC" = SAPIC (IA64 extensions to ACPI requirement)
  441. #define DSDT_SIGNATURE 0x54445344 // "DSDT"
  442. #define SSDT_SIGNATURE 0x54445353 // "SSDT"
  443. #define PSDT_SIGNATURE 0x54445350 // "PSDT"
  444. #define SBST_SIGNATURE 0x54534253 // "SBST"
  445. #define DBGP_SIGNATURE 0x50474244 // "DBGP"
  446. #define WDTT_SIGNATURE 0x54524457 // "WDRT"
  447. typedef struct _DSDT { // Differentiated System Description Table
  448. DESCRIPTION_HEADER Header;
  449. UCHAR DiffDefBlock[ANYSIZE_ARRAY]; // this is the AML describing the base system.
  450. } DSDT;
  451. typedef DSDT *PDSDT;
  452. // Resume normal structure packing
  453. #include <poppack.h>
  454. typedef struct _PROC_LOCAL_APIC {
  455. UCHAR NamespaceProcID;
  456. UCHAR ApicID;
  457. UCHAR NtNumber;
  458. BOOLEAN Started;
  459. BOOLEAN Enumerated;
  460. } PROC_LOCAL_APIC, *PPROC_LOCAL_APIC;
  461. extern PROC_LOCAL_APIC HalpProcLocalApicTable[];
  462. //
  463. // Debug Port Table
  464. //
  465. #pragma pack(1)
  466. typedef struct _DEBUG_PORT_TABLE {
  467. DESCRIPTION_HEADER Header;
  468. UCHAR InterfaceType; // Type of registry interface (0 = full 16550 interface)
  469. UCHAR Reserved0[3]; // should be 0
  470. GEN_ADDR BaseAddress; // Base address of the Debug Port register set
  471. // described using the Generic Register Address
  472. // Structure.
  473. // 0 - console redirection disabled.
  474. // e.g. COM1 (0x3F8) would be 0x1800000003F8
  475. // COM2 (Ox2F8) would be 0x1800000002F8
  476. } DEBUG_PORT_TABLE, *PDEBUG_PORT_TABLE;
  477. #pragma pack()
  478. #pragma pack(1)
  479. typedef struct _SERIAL_PORT_REDIRECTION_TABLE {
  480. DESCRIPTION_HEADER Header;
  481. UCHAR InterfaceType; // Type of registry interface (0 = full 16550 interface)
  482. UCHAR Reserved0[3]; // should be 0
  483. GEN_ADDR BaseAddress; // Base address of the Debug Port register set
  484. // described using the Generic Register Address
  485. // Structure.
  486. // 0 - console redirection disabled.
  487. // e.g. COM1 (0x3F8) would be 0x1800000003F8
  488. // COM2 (Ox2F8) would be 0x1800000002F8
  489. UCHAR InterruptType; // Interrupt type(s) used by the UART.
  490. // bit 0 = PC-AT-compatible 8259 IRQ interrupt.
  491. // bit 1 = I/O APIC interrupt (Global System INterrupt)
  492. // bit 2 = I/O SAPIC interrupt (Global System Interrupt) (IRQ)
  493. // bit 3:7 = reserved (and must be 0)
  494. // Note: bit == 1 indicates support, bit == 0 indicates no support.
  495. //
  496. // Platforms with both a dual 8259 and an I/O APIC or I/O SAPIC
  497. // must set the IRQ bit (bit 0) and the corresponding Global
  498. // system interrupt bit. E.g. a system that supported 8259 and
  499. // SAPIC would be 0x5.
  500. UCHAR Irq; // 0 = none
  501. // 2 = 2
  502. // 3 = 3
  503. // ...
  504. // 16 = 16
  505. // 1, 17-255 reserved
  506. ULONG GlobalSystemInterruptVector;
  507. // The I/O APIC or I/O SAPIC Global System Interrupt used
  508. // by the UART.Valid only if Bit[1] or Bit[2] of the
  509. // Interrupt Type field is set.
  510. UCHAR BaudRate; // Baudrate for BIOS redirection
  511. // 3 = 9600
  512. // 4 = 19200
  513. // 6 = 57600
  514. // 7 = 115200
  515. // 0-2,5, 8-255 reserved
  516. UCHAR Parity; // 0 = no parity
  517. // 1-255 reserved
  518. UCHAR StopBits; // 1 = 1 stop bit
  519. // 0, 2-255 = reserved
  520. UCHAR FlowControl; // 0 = Hadware Flow Control
  521. // 1 - 255 = reserved.
  522. UCHAR TerminalType; // The terminal protocol the BIOS was using for
  523. // console redirection
  524. // 0 = VT100
  525. // 1 = Extended VT100
  526. // 2-255 = reserved
  527. UCHAR Language; // Language which the BIOS was redirecting
  528. // 0 = US Western English (standard ASCII)
  529. USHORT PciDeviceId; // Designates device ID of a PCI device that
  530. // contains a UART to be used as a headless
  531. // port.
  532. USHORT PciVendorId; // Designates vendor ID of a PCI device that
  533. // contains a UART to be used as a headless
  534. // port.
  535. UCHAR PciBusNumber; // Designates which PCI system bus the PCI device
  536. // resides on.
  537. UCHAR PciSlotNumber; // Designates which PCI slot the PCI device
  538. // resides in.
  539. UCHAR PciFunctionNumber; // Which PCI function number describes the UART.
  540. ULONG PciFlags; // PCI compatibility flags bitmask. Should be zero
  541. // by default.
  542. // 0x1 indicates operating system should NOT suppress
  543. // PnP device enumeration or disable power management
  544. // for this device.
  545. // bits 1-31 reserved.
  546. UCHAR PciSegment; // PCI segment number. For systems w/ < 255 PCI
  547. // busses, this number must be 0.
  548. UCHAR Reserved1[4]; // should be 0
  549. } SERIAL_PORT_REDIRECTION_TABLE, *PSERIAL_PORT_REDIRECTION_TABLE;
  550. #pragma pack()
  551. typedef struct _WATCHDOG_TIMER_RESOURCE_TABLE {
  552. DESCRIPTION_HEADER Header;
  553. GEN_ADDR ControlRegisterAddress; //
  554. GEN_ADDR CountRegisterAddress; //
  555. USHORT PciDeviceId; // Designates device ID of a PCI device that
  556. // contains a UART to be used as a headless
  557. // port.
  558. USHORT PciVendorId; // Designates vendor ID of a PCI device that
  559. // contains a UART to be used as a headless
  560. // port.
  561. UCHAR PciBusNumber; // Designates which PCI system bus the PCI device
  562. // resides on.
  563. UCHAR PciSlotNumber; // Designates which PCI slot the PCI device
  564. // resides in.
  565. UCHAR PciFunctionNumber; // Which PCI function number describes the UART.
  566. UCHAR PciSegment; //
  567. #if 0
  568. ULONG Filler; // Remove this when we get the new BIOS
  569. #endif
  570. USHORT MaxCount; //
  571. UCHAR Units; //
  572. } WATCHDOG_TIMER_RESOURCE_TABLE, *PWATCHDOG_TIMER_RESOURCE_TABLE;
  573. #pragma pack()
  574. //
  575. // BOOT Table -- based on Simple Boot Flag Specification 1.0
  576. //
  577. typedef struct _BOOT_TABLE {
  578. DESCRIPTION_HEADER Header;
  579. UCHAR CMOSIndex;
  580. UCHAR Reserved[3];
  581. } BOOT_TABLE, *PBOOT_TABLE;
  582. #define BOOT_SIGNATURE 0x544f4f42 // 'BOOT'
  583. //
  584. // Bits in the Boot Register
  585. //
  586. //
  587. // Set by OS to indicate that the bios need only configure boot devices
  588. //
  589. #define SBF_PNPOS_BIT 0
  590. #define SBF_PNPOS (1 << SBF_PNPOS_BIT)
  591. //
  592. // Set by BIOS to indicate beginning of boot, cleared by OS to indicate a successful boot
  593. //
  594. #define SBF_BOOTING_BIT 1
  595. #define SBF_BOOTING (1 << SBF_BOOTING_BIT)
  596. //
  597. // Set by BIOS to indicate a diagnostic boot
  598. //
  599. #define SBF_DIAG_BIT 2
  600. #define SBF_DIAG (1 << SBF_DIAG_BIT)
  601. //
  602. // Set to ensure ODD parity
  603. //
  604. #define SBF_PARITY_BIT 7
  605. #define SBF_PARITY (1 << SBF_PARITY_BIT)
  606. //
  607. // IPPT Table -- IA64 Platform Properties Table
  608. //
  609. typedef struct _IPPT_TABLE {
  610. DESCRIPTION_HEADER Header;
  611. ULONG Flags;
  612. ULONG Reserved[3];
  613. } IPPT_TABLE, *PIPPT_TABLE;
  614. #define IPPT_DISABLE_WRITE_COMBINING 0x01L
  615. #define IPPT_ENABLE_CROSS_PARTITION_IPI 0x02L
  616. #define IPPT_DISABLE_PTCG_TB_FLUSH 0x04L
  617. #define IPPT_DISABLE_UC_MAIN_MEMORY 0x08L
  618. #define IPPT_SIGNATURE 0x54505049 // 'IPPT'
  619. #endif // _ACPITBL_H