actbl1.h 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  1. /******************************************************************************
  2. *
  3. * Name: actbl1.h - Additional ACPI table definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2015, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACTBL1_H__
  43. #define __ACTBL1_H__
  44. /*******************************************************************************
  45. *
  46. * Additional ACPI Tables (1)
  47. *
  48. * These tables are not consumed directly by the ACPICA subsystem, but are
  49. * included here to support device drivers and the AML disassembler.
  50. *
  51. * The tables in this file are fully defined within the ACPI specification.
  52. *
  53. ******************************************************************************/
  54. /*
  55. * Values for description table header signatures for tables defined in this
  56. * file. Useful because they make it more difficult to inadvertently type in
  57. * the wrong signature.
  58. */
  59. #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
  60. #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
  61. #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
  62. #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
  63. #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
  64. #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
  65. #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
  66. #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
  67. #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
  68. #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
  69. #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
  70. #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
  71. /*
  72. * All tables must be byte-packed to match the ACPI specification, since
  73. * the tables are provided by the system BIOS.
  74. */
  75. #pragma pack(1)
  76. /*
  77. * Note: C bitfields are not used for this reason:
  78. *
  79. * "Bitfields are great and easy to read, but unfortunately the C language
  80. * does not specify the layout of bitfields in memory, which means they are
  81. * essentially useless for dealing with packed data in on-disk formats or
  82. * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
  83. * this decision was a design error in C. Ritchie could have picked an order
  84. * and stuck with it." Norman Ramsey.
  85. * See http://stackoverflow.com/a/1053662/41661
  86. */
  87. /*******************************************************************************
  88. *
  89. * Common subtable headers
  90. *
  91. ******************************************************************************/
  92. /* Generic subtable header (used in MADT, SRAT, etc.) */
  93. typedef struct acpi_subtable_header
  94. {
  95. UINT8 Type;
  96. UINT8 Length;
  97. } ACPI_SUBTABLE_HEADER;
  98. /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
  99. typedef struct acpi_whea_header
  100. {
  101. UINT8 Action;
  102. UINT8 Instruction;
  103. UINT8 Flags;
  104. UINT8 Reserved;
  105. ACPI_GENERIC_ADDRESS RegisterRegion;
  106. UINT64 Value; /* Value used with Read/Write register */
  107. UINT64 Mask; /* Bitmask required for this register instruction */
  108. } ACPI_WHEA_HEADER;
  109. /*******************************************************************************
  110. *
  111. * BERT - Boot Error Record Table (ACPI 4.0)
  112. * Version 1
  113. *
  114. ******************************************************************************/
  115. typedef struct acpi_table_bert
  116. {
  117. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  118. UINT32 RegionLength; /* Length of the boot error region */
  119. UINT64 Address; /* Physical address of the error region */
  120. } ACPI_TABLE_BERT;
  121. /* Boot Error Region (not a subtable, pointed to by Address field above) */
  122. typedef struct acpi_bert_region
  123. {
  124. UINT32 BlockStatus; /* Type of error information */
  125. UINT32 RawDataOffset; /* Offset to raw error data */
  126. UINT32 RawDataLength; /* Length of raw error data */
  127. UINT32 DataLength; /* Length of generic error data */
  128. UINT32 ErrorSeverity; /* Severity code */
  129. } ACPI_BERT_REGION;
  130. /* Values for BlockStatus flags above */
  131. #define ACPI_BERT_UNCORRECTABLE (1)
  132. #define ACPI_BERT_CORRECTABLE (1<<1)
  133. #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
  134. #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
  135. #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  136. /* Values for ErrorSeverity above */
  137. enum AcpiBertErrorSeverity
  138. {
  139. ACPI_BERT_ERROR_CORRECTABLE = 0,
  140. ACPI_BERT_ERROR_FATAL = 1,
  141. ACPI_BERT_ERROR_CORRECTED = 2,
  142. ACPI_BERT_ERROR_NONE = 3,
  143. ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
  144. };
  145. /*
  146. * Note: The generic error data that follows the ErrorSeverity field above
  147. * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
  148. */
  149. /*******************************************************************************
  150. *
  151. * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
  152. * Version 1
  153. *
  154. ******************************************************************************/
  155. typedef struct acpi_table_cpep
  156. {
  157. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  158. UINT64 Reserved;
  159. } ACPI_TABLE_CPEP;
  160. /* Subtable */
  161. typedef struct acpi_cpep_polling
  162. {
  163. ACPI_SUBTABLE_HEADER Header;
  164. UINT8 Id; /* Processor ID */
  165. UINT8 Eid; /* Processor EID */
  166. UINT32 Interval; /* Polling interval (msec) */
  167. } ACPI_CPEP_POLLING;
  168. /*******************************************************************************
  169. *
  170. * ECDT - Embedded Controller Boot Resources Table
  171. * Version 1
  172. *
  173. ******************************************************************************/
  174. typedef struct acpi_table_ecdt
  175. {
  176. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  177. ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register */
  178. ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */
  179. UINT32 Uid; /* Unique ID - must be same as the EC _UID method */
  180. UINT8 Gpe; /* The GPE for the EC */
  181. UINT8 Id[1]; /* Full namepath of the EC in the ACPI namespace */
  182. } ACPI_TABLE_ECDT;
  183. /*******************************************************************************
  184. *
  185. * EINJ - Error Injection Table (ACPI 4.0)
  186. * Version 1
  187. *
  188. ******************************************************************************/
  189. typedef struct acpi_table_einj
  190. {
  191. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  192. UINT32 HeaderLength;
  193. UINT8 Flags;
  194. UINT8 Reserved[3];
  195. UINT32 Entries;
  196. } ACPI_TABLE_EINJ;
  197. /* EINJ Injection Instruction Entries (actions) */
  198. typedef struct acpi_einj_entry
  199. {
  200. ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
  201. } ACPI_EINJ_ENTRY;
  202. /* Masks for Flags field above */
  203. #define ACPI_EINJ_PRESERVE (1)
  204. /* Values for Action field above */
  205. enum AcpiEinjActions
  206. {
  207. ACPI_EINJ_BEGIN_OPERATION = 0,
  208. ACPI_EINJ_GET_TRIGGER_TABLE = 1,
  209. ACPI_EINJ_SET_ERROR_TYPE = 2,
  210. ACPI_EINJ_GET_ERROR_TYPE = 3,
  211. ACPI_EINJ_END_OPERATION = 4,
  212. ACPI_EINJ_EXECUTE_OPERATION = 5,
  213. ACPI_EINJ_CHECK_BUSY_STATUS = 6,
  214. ACPI_EINJ_GET_COMMAND_STATUS = 7,
  215. ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
  216. ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
  217. ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
  218. };
  219. /* Values for Instruction field above */
  220. enum AcpiEinjInstructions
  221. {
  222. ACPI_EINJ_READ_REGISTER = 0,
  223. ACPI_EINJ_READ_REGISTER_VALUE = 1,
  224. ACPI_EINJ_WRITE_REGISTER = 2,
  225. ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
  226. ACPI_EINJ_NOOP = 4,
  227. ACPI_EINJ_FLUSH_CACHELINE = 5,
  228. ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
  229. };
  230. typedef struct acpi_einj_error_type_with_addr
  231. {
  232. UINT32 ErrorType;
  233. UINT32 VendorStructOffset;
  234. UINT32 Flags;
  235. UINT32 ApicId;
  236. UINT64 Address;
  237. UINT64 Range;
  238. UINT32 PcieId;
  239. } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
  240. typedef struct acpi_einj_vendor
  241. {
  242. UINT32 Length;
  243. UINT32 PcieId;
  244. UINT16 VendorId;
  245. UINT16 DeviceId;
  246. UINT8 RevisionId;
  247. UINT8 Reserved[3];
  248. } ACPI_EINJ_VENDOR;
  249. /* EINJ Trigger Error Action Table */
  250. typedef struct acpi_einj_trigger
  251. {
  252. UINT32 HeaderSize;
  253. UINT32 Revision;
  254. UINT32 TableSize;
  255. UINT32 EntryCount;
  256. } ACPI_EINJ_TRIGGER;
  257. /* Command status return values */
  258. enum AcpiEinjCommandStatus
  259. {
  260. ACPI_EINJ_SUCCESS = 0,
  261. ACPI_EINJ_FAILURE = 1,
  262. ACPI_EINJ_INVALID_ACCESS = 2,
  263. ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
  264. };
  265. /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
  266. #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
  267. #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
  268. #define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
  269. #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
  270. #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
  271. #define ACPI_EINJ_MEMORY_FATAL (1<<5)
  272. #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
  273. #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
  274. #define ACPI_EINJ_PCIX_FATAL (1<<8)
  275. #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
  276. #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
  277. #define ACPI_EINJ_PLATFORM_FATAL (1<<11)
  278. #define ACPI_EINJ_VENDOR_DEFINED (1<<31)
  279. /*******************************************************************************
  280. *
  281. * ERST - Error Record Serialization Table (ACPI 4.0)
  282. * Version 1
  283. *
  284. ******************************************************************************/
  285. typedef struct acpi_table_erst
  286. {
  287. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  288. UINT32 HeaderLength;
  289. UINT32 Reserved;
  290. UINT32 Entries;
  291. } ACPI_TABLE_ERST;
  292. /* ERST Serialization Entries (actions) */
  293. typedef struct acpi_erst_entry
  294. {
  295. ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
  296. } ACPI_ERST_ENTRY;
  297. /* Masks for Flags field above */
  298. #define ACPI_ERST_PRESERVE (1)
  299. /* Values for Action field above */
  300. enum AcpiErstActions
  301. {
  302. ACPI_ERST_BEGIN_WRITE = 0,
  303. ACPI_ERST_BEGIN_READ = 1,
  304. ACPI_ERST_BEGIN_CLEAR = 2,
  305. ACPI_ERST_END = 3,
  306. ACPI_ERST_SET_RECORD_OFFSET = 4,
  307. ACPI_ERST_EXECUTE_OPERATION = 5,
  308. ACPI_ERST_CHECK_BUSY_STATUS = 6,
  309. ACPI_ERST_GET_COMMAND_STATUS = 7,
  310. ACPI_ERST_GET_RECORD_ID = 8,
  311. ACPI_ERST_SET_RECORD_ID = 9,
  312. ACPI_ERST_GET_RECORD_COUNT = 10,
  313. ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
  314. ACPI_ERST_NOT_USED = 12,
  315. ACPI_ERST_GET_ERROR_RANGE = 13,
  316. ACPI_ERST_GET_ERROR_LENGTH = 14,
  317. ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
  318. ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
  319. };
  320. /* Values for Instruction field above */
  321. enum AcpiErstInstructions
  322. {
  323. ACPI_ERST_READ_REGISTER = 0,
  324. ACPI_ERST_READ_REGISTER_VALUE = 1,
  325. ACPI_ERST_WRITE_REGISTER = 2,
  326. ACPI_ERST_WRITE_REGISTER_VALUE = 3,
  327. ACPI_ERST_NOOP = 4,
  328. ACPI_ERST_LOAD_VAR1 = 5,
  329. ACPI_ERST_LOAD_VAR2 = 6,
  330. ACPI_ERST_STORE_VAR1 = 7,
  331. ACPI_ERST_ADD = 8,
  332. ACPI_ERST_SUBTRACT = 9,
  333. ACPI_ERST_ADD_VALUE = 10,
  334. ACPI_ERST_SUBTRACT_VALUE = 11,
  335. ACPI_ERST_STALL = 12,
  336. ACPI_ERST_STALL_WHILE_TRUE = 13,
  337. ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
  338. ACPI_ERST_GOTO = 15,
  339. ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
  340. ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
  341. ACPI_ERST_MOVE_DATA = 18,
  342. ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
  343. };
  344. /* Command status return values */
  345. enum AcpiErstCommandStatus
  346. {
  347. ACPI_ERST_SUCESS = 0,
  348. ACPI_ERST_NO_SPACE = 1,
  349. ACPI_ERST_NOT_AVAILABLE = 2,
  350. ACPI_ERST_FAILURE = 3,
  351. ACPI_ERST_RECORD_EMPTY = 4,
  352. ACPI_ERST_NOT_FOUND = 5,
  353. ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
  354. };
  355. /* Error Record Serialization Information */
  356. typedef struct acpi_erst_info
  357. {
  358. UINT16 Signature; /* Should be "ER" */
  359. UINT8 Data[48];
  360. } ACPI_ERST_INFO;
  361. /*******************************************************************************
  362. *
  363. * HEST - Hardware Error Source Table (ACPI 4.0)
  364. * Version 1
  365. *
  366. ******************************************************************************/
  367. typedef struct acpi_table_hest
  368. {
  369. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  370. UINT32 ErrorSourceCount;
  371. } ACPI_TABLE_HEST;
  372. /* HEST subtable header */
  373. typedef struct acpi_hest_header
  374. {
  375. UINT16 Type;
  376. UINT16 SourceId;
  377. } ACPI_HEST_HEADER;
  378. /* Values for Type field above for subtables */
  379. enum AcpiHestTypes
  380. {
  381. ACPI_HEST_TYPE_IA32_CHECK = 0,
  382. ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
  383. ACPI_HEST_TYPE_IA32_NMI = 2,
  384. ACPI_HEST_TYPE_NOT_USED3 = 3,
  385. ACPI_HEST_TYPE_NOT_USED4 = 4,
  386. ACPI_HEST_TYPE_NOT_USED5 = 5,
  387. ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
  388. ACPI_HEST_TYPE_AER_ENDPOINT = 7,
  389. ACPI_HEST_TYPE_AER_BRIDGE = 8,
  390. ACPI_HEST_TYPE_GENERIC_ERROR = 9,
  391. ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
  392. };
  393. /*
  394. * HEST substructures contained in subtables
  395. */
  396. /*
  397. * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
  398. * ACPI_HEST_IA_CORRECTED structures.
  399. */
  400. typedef struct acpi_hest_ia_error_bank
  401. {
  402. UINT8 BankNumber;
  403. UINT8 ClearStatusOnInit;
  404. UINT8 StatusFormat;
  405. UINT8 Reserved;
  406. UINT32 ControlRegister;
  407. UINT64 ControlData;
  408. UINT32 StatusRegister;
  409. UINT32 AddressRegister;
  410. UINT32 MiscRegister;
  411. } ACPI_HEST_IA_ERROR_BANK;
  412. /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
  413. typedef struct acpi_hest_aer_common
  414. {
  415. UINT16 Reserved1;
  416. UINT8 Flags;
  417. UINT8 Enabled;
  418. UINT32 RecordsToPreallocate;
  419. UINT32 MaxSectionsPerRecord;
  420. UINT32 Bus; /* Bus and Segment numbers */
  421. UINT16 Device;
  422. UINT16 Function;
  423. UINT16 DeviceControl;
  424. UINT16 Reserved2;
  425. UINT32 UncorrectableMask;
  426. UINT32 UncorrectableSeverity;
  427. UINT32 CorrectableMask;
  428. UINT32 AdvancedCapabilities;
  429. } ACPI_HEST_AER_COMMON;
  430. /* Masks for HEST Flags fields */
  431. #define ACPI_HEST_FIRMWARE_FIRST (1)
  432. #define ACPI_HEST_GLOBAL (1<<1)
  433. /*
  434. * Macros to access the bus/segment numbers in Bus field above:
  435. * Bus number is encoded in bits 7:0
  436. * Segment number is encoded in bits 23:8
  437. */
  438. #define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
  439. #define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
  440. /* Hardware Error Notification */
  441. typedef struct acpi_hest_notify
  442. {
  443. UINT8 Type;
  444. UINT8 Length;
  445. UINT16 ConfigWriteEnable;
  446. UINT32 PollInterval;
  447. UINT32 Vector;
  448. UINT32 PollingThresholdValue;
  449. UINT32 PollingThresholdWindow;
  450. UINT32 ErrorThresholdValue;
  451. UINT32 ErrorThresholdWindow;
  452. } ACPI_HEST_NOTIFY;
  453. /* Values for Notify Type field above */
  454. enum AcpiHestNotifyTypes
  455. {
  456. ACPI_HEST_NOTIFY_POLLED = 0,
  457. ACPI_HEST_NOTIFY_EXTERNAL = 1,
  458. ACPI_HEST_NOTIFY_LOCAL = 2,
  459. ACPI_HEST_NOTIFY_SCI = 3,
  460. ACPI_HEST_NOTIFY_NMI = 4,
  461. ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
  462. ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
  463. ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */
  464. };
  465. /* Values for ConfigWriteEnable bitfield above */
  466. #define ACPI_HEST_TYPE (1)
  467. #define ACPI_HEST_POLL_INTERVAL (1<<1)
  468. #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
  469. #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
  470. #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
  471. #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
  472. /*
  473. * HEST subtables
  474. */
  475. /* 0: IA32 Machine Check Exception */
  476. typedef struct acpi_hest_ia_machine_check
  477. {
  478. ACPI_HEST_HEADER Header;
  479. UINT16 Reserved1;
  480. UINT8 Flags;
  481. UINT8 Enabled;
  482. UINT32 RecordsToPreallocate;
  483. UINT32 MaxSectionsPerRecord;
  484. UINT64 GlobalCapabilityData;
  485. UINT64 GlobalControlData;
  486. UINT8 NumHardwareBanks;
  487. UINT8 Reserved3[7];
  488. } ACPI_HEST_IA_MACHINE_CHECK;
  489. /* 1: IA32 Corrected Machine Check */
  490. typedef struct acpi_hest_ia_corrected
  491. {
  492. ACPI_HEST_HEADER Header;
  493. UINT16 Reserved1;
  494. UINT8 Flags;
  495. UINT8 Enabled;
  496. UINT32 RecordsToPreallocate;
  497. UINT32 MaxSectionsPerRecord;
  498. ACPI_HEST_NOTIFY Notify;
  499. UINT8 NumHardwareBanks;
  500. UINT8 Reserved2[3];
  501. } ACPI_HEST_IA_CORRECTED;
  502. /* 2: IA32 Non-Maskable Interrupt */
  503. typedef struct acpi_hest_ia_nmi
  504. {
  505. ACPI_HEST_HEADER Header;
  506. UINT32 Reserved;
  507. UINT32 RecordsToPreallocate;
  508. UINT32 MaxSectionsPerRecord;
  509. UINT32 MaxRawDataLength;
  510. } ACPI_HEST_IA_NMI;
  511. /* 3,4,5: Not used */
  512. /* 6: PCI Express Root Port AER */
  513. typedef struct acpi_hest_aer_root
  514. {
  515. ACPI_HEST_HEADER Header;
  516. ACPI_HEST_AER_COMMON Aer;
  517. UINT32 RootErrorCommand;
  518. } ACPI_HEST_AER_ROOT;
  519. /* 7: PCI Express AER (AER Endpoint) */
  520. typedef struct acpi_hest_aer
  521. {
  522. ACPI_HEST_HEADER Header;
  523. ACPI_HEST_AER_COMMON Aer;
  524. } ACPI_HEST_AER;
  525. /* 8: PCI Express/PCI-X Bridge AER */
  526. typedef struct acpi_hest_aer_bridge
  527. {
  528. ACPI_HEST_HEADER Header;
  529. ACPI_HEST_AER_COMMON Aer;
  530. UINT32 UncorrectableMask2;
  531. UINT32 UncorrectableSeverity2;
  532. UINT32 AdvancedCapabilities2;
  533. } ACPI_HEST_AER_BRIDGE;
  534. /* 9: Generic Hardware Error Source */
  535. typedef struct acpi_hest_generic
  536. {
  537. ACPI_HEST_HEADER Header;
  538. UINT16 RelatedSourceId;
  539. UINT8 Reserved;
  540. UINT8 Enabled;
  541. UINT32 RecordsToPreallocate;
  542. UINT32 MaxSectionsPerRecord;
  543. UINT32 MaxRawDataLength;
  544. ACPI_GENERIC_ADDRESS ErrorStatusAddress;
  545. ACPI_HEST_NOTIFY Notify;
  546. UINT32 ErrorBlockLength;
  547. } ACPI_HEST_GENERIC;
  548. /* Generic Error Status block */
  549. typedef struct acpi_hest_generic_status
  550. {
  551. UINT32 BlockStatus;
  552. UINT32 RawDataOffset;
  553. UINT32 RawDataLength;
  554. UINT32 DataLength;
  555. UINT32 ErrorSeverity;
  556. } ACPI_HEST_GENERIC_STATUS;
  557. /* Values for BlockStatus flags above */
  558. #define ACPI_HEST_UNCORRECTABLE (1)
  559. #define ACPI_HEST_CORRECTABLE (1<<1)
  560. #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
  561. #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
  562. #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
  563. /* Generic Error Data entry */
  564. typedef struct acpi_hest_generic_data
  565. {
  566. UINT8 SectionType[16];
  567. UINT32 ErrorSeverity;
  568. UINT16 Revision;
  569. UINT8 ValidationBits;
  570. UINT8 Flags;
  571. UINT32 ErrorDataLength;
  572. UINT8 FruId[16];
  573. UINT8 FruText[20];
  574. } ACPI_HEST_GENERIC_DATA;
  575. /*******************************************************************************
  576. *
  577. * MADT - Multiple APIC Description Table
  578. * Version 3
  579. *
  580. ******************************************************************************/
  581. typedef struct acpi_table_madt
  582. {
  583. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  584. UINT32 Address; /* Physical address of local APIC */
  585. UINT32 Flags;
  586. } ACPI_TABLE_MADT;
  587. /* Masks for Flags field above */
  588. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  589. /* Values for PCATCompat flag */
  590. #define ACPI_MADT_DUAL_PIC 0
  591. #define ACPI_MADT_MULTIPLE_APIC 1
  592. /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
  593. enum AcpiMadtType
  594. {
  595. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  596. ACPI_MADT_TYPE_IO_APIC = 1,
  597. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  598. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  599. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  600. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  601. ACPI_MADT_TYPE_IO_SAPIC = 6,
  602. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  603. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  604. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  605. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  606. ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
  607. ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
  608. ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
  609. ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
  610. ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
  611. ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
  612. };
  613. /*
  614. * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
  615. */
  616. /* 0: Processor Local APIC */
  617. typedef struct acpi_madt_local_apic
  618. {
  619. ACPI_SUBTABLE_HEADER Header;
  620. UINT8 ProcessorId; /* ACPI processor id */
  621. UINT8 Id; /* Processor's local APIC id */
  622. UINT32 LapicFlags;
  623. } ACPI_MADT_LOCAL_APIC;
  624. /* 1: IO APIC */
  625. typedef struct acpi_madt_io_apic
  626. {
  627. ACPI_SUBTABLE_HEADER Header;
  628. UINT8 Id; /* I/O APIC ID */
  629. UINT8 Reserved; /* Reserved - must be zero */
  630. UINT32 Address; /* APIC physical address */
  631. UINT32 GlobalIrqBase; /* Global system interrupt where INTI lines start */
  632. } ACPI_MADT_IO_APIC;
  633. /* 2: Interrupt Override */
  634. typedef struct acpi_madt_interrupt_override
  635. {
  636. ACPI_SUBTABLE_HEADER Header;
  637. UINT8 Bus; /* 0 - ISA */
  638. UINT8 SourceIrq; /* Interrupt source (IRQ) */
  639. UINT32 GlobalIrq; /* Global system interrupt */
  640. UINT16 IntiFlags;
  641. } ACPI_MADT_INTERRUPT_OVERRIDE;
  642. /* 3: NMI Source */
  643. typedef struct acpi_madt_nmi_source
  644. {
  645. ACPI_SUBTABLE_HEADER Header;
  646. UINT16 IntiFlags;
  647. UINT32 GlobalIrq; /* Global system interrupt */
  648. } ACPI_MADT_NMI_SOURCE;
  649. /* 4: Local APIC NMI */
  650. typedef struct acpi_madt_local_apic_nmi
  651. {
  652. ACPI_SUBTABLE_HEADER Header;
  653. UINT8 ProcessorId; /* ACPI processor id */
  654. UINT16 IntiFlags;
  655. UINT8 Lint; /* LINTn to which NMI is connected */
  656. } ACPI_MADT_LOCAL_APIC_NMI;
  657. /* 5: Address Override */
  658. typedef struct acpi_madt_local_apic_override
  659. {
  660. ACPI_SUBTABLE_HEADER Header;
  661. UINT16 Reserved; /* Reserved, must be zero */
  662. UINT64 Address; /* APIC physical address */
  663. } ACPI_MADT_LOCAL_APIC_OVERRIDE;
  664. /* 6: I/O Sapic */
  665. typedef struct acpi_madt_io_sapic
  666. {
  667. ACPI_SUBTABLE_HEADER Header;
  668. UINT8 Id; /* I/O SAPIC ID */
  669. UINT8 Reserved; /* Reserved, must be zero */
  670. UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */
  671. UINT64 Address; /* SAPIC physical address */
  672. } ACPI_MADT_IO_SAPIC;
  673. /* 7: Local Sapic */
  674. typedef struct acpi_madt_local_sapic
  675. {
  676. ACPI_SUBTABLE_HEADER Header;
  677. UINT8 ProcessorId; /* ACPI processor id */
  678. UINT8 Id; /* SAPIC ID */
  679. UINT8 Eid; /* SAPIC EID */
  680. UINT8 Reserved[3]; /* Reserved, must be zero */
  681. UINT32 LapicFlags;
  682. UINT32 Uid; /* Numeric UID - ACPI 3.0 */
  683. char UidString[1]; /* String UID - ACPI 3.0 */
  684. } ACPI_MADT_LOCAL_SAPIC;
  685. /* 8: Platform Interrupt Source */
  686. typedef struct acpi_madt_interrupt_source
  687. {
  688. ACPI_SUBTABLE_HEADER Header;
  689. UINT16 IntiFlags;
  690. UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */
  691. UINT8 Id; /* Processor ID */
  692. UINT8 Eid; /* Processor EID */
  693. UINT8 IoSapicVector; /* Vector value for PMI interrupts */
  694. UINT32 GlobalIrq; /* Global system interrupt */
  695. UINT32 Flags; /* Interrupt Source Flags */
  696. } ACPI_MADT_INTERRUPT_SOURCE;
  697. /* Masks for Flags field above */
  698. #define ACPI_MADT_CPEI_OVERRIDE (1)
  699. /* 9: Processor Local X2APIC (ACPI 4.0) */
  700. typedef struct acpi_madt_local_x2apic
  701. {
  702. ACPI_SUBTABLE_HEADER Header;
  703. UINT16 Reserved; /* Reserved - must be zero */
  704. UINT32 LocalApicId; /* Processor x2APIC ID */
  705. UINT32 LapicFlags;
  706. UINT32 Uid; /* ACPI processor UID */
  707. } ACPI_MADT_LOCAL_X2APIC;
  708. /* 10: Local X2APIC NMI (ACPI 4.0) */
  709. typedef struct acpi_madt_local_x2apic_nmi
  710. {
  711. ACPI_SUBTABLE_HEADER Header;
  712. UINT16 IntiFlags;
  713. UINT32 Uid; /* ACPI processor UID */
  714. UINT8 Lint; /* LINTn to which NMI is connected */
  715. UINT8 Reserved[3]; /* Reserved - must be zero */
  716. } ACPI_MADT_LOCAL_X2APIC_NMI;
  717. /* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
  718. typedef struct acpi_madt_generic_interrupt
  719. {
  720. ACPI_SUBTABLE_HEADER Header;
  721. UINT16 Reserved; /* Reserved - must be zero */
  722. UINT32 CpuInterfaceNumber;
  723. UINT32 Uid;
  724. UINT32 Flags;
  725. UINT32 ParkingVersion;
  726. UINT32 PerformanceInterrupt;
  727. UINT64 ParkedAddress;
  728. UINT64 BaseAddress;
  729. UINT64 GicvBaseAddress;
  730. UINT64 GichBaseAddress;
  731. UINT32 VgicInterrupt;
  732. UINT64 GicrBaseAddress;
  733. UINT64 ArmMpidr;
  734. UINT8 EfficiencyClass;
  735. UINT8 Reserved2[3];
  736. } ACPI_MADT_GENERIC_INTERRUPT;
  737. /* Masks for Flags field above */
  738. /* ACPI_MADT_ENABLED (1) Processor is usable if set */
  739. #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
  740. #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
  741. /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
  742. typedef struct acpi_madt_generic_distributor
  743. {
  744. ACPI_SUBTABLE_HEADER Header;
  745. UINT16 Reserved; /* Reserved - must be zero */
  746. UINT32 GicId;
  747. UINT64 BaseAddress;
  748. UINT32 GlobalIrqBase;
  749. UINT8 Version;
  750. UINT8 Reserved2[3]; /* Reserved - must be zero */
  751. } ACPI_MADT_GENERIC_DISTRIBUTOR;
  752. /* Values for Version field above */
  753. enum AcpiMadtGicVersion
  754. {
  755. ACPI_MADT_GIC_VERSION_NONE = 0,
  756. ACPI_MADT_GIC_VERSION_V1 = 1,
  757. ACPI_MADT_GIC_VERSION_V2 = 2,
  758. ACPI_MADT_GIC_VERSION_V3 = 3,
  759. ACPI_MADT_GIC_VERSION_V4 = 4,
  760. ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
  761. };
  762. /* 13: Generic MSI Frame (ACPI 5.1) */
  763. typedef struct acpi_madt_generic_msi_frame
  764. {
  765. ACPI_SUBTABLE_HEADER Header;
  766. UINT16 Reserved; /* Reserved - must be zero */
  767. UINT32 MsiFrameId;
  768. UINT64 BaseAddress;
  769. UINT32 Flags;
  770. UINT16 SpiCount;
  771. UINT16 SpiBase;
  772. } ACPI_MADT_GENERIC_MSI_FRAME;
  773. /* Masks for Flags field above */
  774. #define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
  775. /* 14: Generic Redistributor (ACPI 5.1) */
  776. typedef struct acpi_madt_generic_redistributor
  777. {
  778. ACPI_SUBTABLE_HEADER Header;
  779. UINT16 Reserved; /* reserved - must be zero */
  780. UINT64 BaseAddress;
  781. UINT32 Length;
  782. } ACPI_MADT_GENERIC_REDISTRIBUTOR;
  783. /* 15: Generic Translator (ACPI 6.0) */
  784. typedef struct acpi_madt_generic_translator
  785. {
  786. ACPI_SUBTABLE_HEADER Header;
  787. UINT16 Reserved; /* reserved - must be zero */
  788. UINT32 TranslationId;
  789. UINT64 BaseAddress;
  790. UINT32 Reserved2;
  791. } ACPI_MADT_GENERIC_TRANSLATOR;
  792. /*
  793. * Common flags fields for MADT subtables
  794. */
  795. /* MADT Local APIC flags */
  796. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  797. /* MADT MPS INTI flags (IntiFlags) */
  798. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  799. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  800. /* Values for MPS INTI flags */
  801. #define ACPI_MADT_POLARITY_CONFORMS 0
  802. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  803. #define ACPI_MADT_POLARITY_RESERVED 2
  804. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  805. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  806. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  807. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  808. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  809. /*******************************************************************************
  810. *
  811. * MSCT - Maximum System Characteristics Table (ACPI 4.0)
  812. * Version 1
  813. *
  814. ******************************************************************************/
  815. typedef struct acpi_table_msct
  816. {
  817. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  818. UINT32 ProximityOffset; /* Location of proximity info struct(s) */
  819. UINT32 MaxProximityDomains;/* Max number of proximity domains */
  820. UINT32 MaxClockDomains; /* Max number of clock domains */
  821. UINT64 MaxAddress; /* Max physical address in system */
  822. } ACPI_TABLE_MSCT;
  823. /* Subtable - Maximum Proximity Domain Information. Version 1 */
  824. typedef struct acpi_msct_proximity
  825. {
  826. UINT8 Revision;
  827. UINT8 Length;
  828. UINT32 RangeStart; /* Start of domain range */
  829. UINT32 RangeEnd; /* End of domain range */
  830. UINT32 ProcessorCapacity;
  831. UINT64 MemoryCapacity; /* In bytes */
  832. } ACPI_MSCT_PROXIMITY;
  833. /*******************************************************************************
  834. *
  835. * NFIT - NVDIMM Interface Table (ACPI 6.0)
  836. * Version 1
  837. *
  838. ******************************************************************************/
  839. typedef struct acpi_table_nfit
  840. {
  841. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  842. UINT32 Reserved; /* Reserved, must be zero */
  843. } ACPI_TABLE_NFIT;
  844. /* Subtable header for NFIT */
  845. typedef struct acpi_nfit_header
  846. {
  847. UINT16 Type;
  848. UINT16 Length;
  849. } ACPI_NFIT_HEADER;
  850. /* Values for subtable type in ACPI_NFIT_HEADER */
  851. enum AcpiNfitType
  852. {
  853. ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
  854. ACPI_NFIT_TYPE_MEMORY_MAP = 1,
  855. ACPI_NFIT_TYPE_INTERLEAVE = 2,
  856. ACPI_NFIT_TYPE_SMBIOS = 3,
  857. ACPI_NFIT_TYPE_CONTROL_REGION = 4,
  858. ACPI_NFIT_TYPE_DATA_REGION = 5,
  859. ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
  860. ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
  861. };
  862. /*
  863. * NFIT Subtables
  864. */
  865. /* 0: System Physical Address Range Structure */
  866. typedef struct acpi_nfit_system_address
  867. {
  868. ACPI_NFIT_HEADER Header;
  869. UINT16 RangeIndex;
  870. UINT16 Flags;
  871. UINT32 Reserved; /* Reseved, must be zero */
  872. UINT32 ProximityDomain;
  873. UINT8 RangeGuid[16];
  874. UINT64 Address;
  875. UINT64 Length;
  876. UINT64 MemoryMapping;
  877. } ACPI_NFIT_SYSTEM_ADDRESS;
  878. /* Flags */
  879. #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
  880. #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
  881. /* Range Type GUIDs appear in the include/acuuid.h file */
  882. /* 1: Memory Device to System Address Range Map Structure */
  883. typedef struct acpi_nfit_memory_map
  884. {
  885. ACPI_NFIT_HEADER Header;
  886. UINT32 DeviceHandle;
  887. UINT16 PhysicalId;
  888. UINT16 RegionId;
  889. UINT16 RangeIndex;
  890. UINT16 RegionIndex;
  891. UINT64 RegionSize;
  892. UINT64 RegionOffset;
  893. UINT64 Address;
  894. UINT16 InterleaveIndex;
  895. UINT16 InterleaveWays;
  896. UINT16 Flags;
  897. UINT16 Reserved; /* Reserved, must be zero */
  898. } ACPI_NFIT_MEMORY_MAP;
  899. /* Flags */
  900. #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
  901. #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
  902. #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
  903. #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
  904. #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
  905. #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
  906. /* 2: Interleave Structure */
  907. typedef struct acpi_nfit_interleave
  908. {
  909. ACPI_NFIT_HEADER Header;
  910. UINT16 InterleaveIndex;
  911. UINT16 Reserved; /* Reserved, must be zero */
  912. UINT32 LineCount;
  913. UINT32 LineSize;
  914. UINT32 LineOffset[1]; /* Variable length */
  915. } ACPI_NFIT_INTERLEAVE;
  916. /* 3: SMBIOS Management Information Structure */
  917. typedef struct acpi_nfit_smbios
  918. {
  919. ACPI_NFIT_HEADER Header;
  920. UINT32 Reserved; /* Reserved, must be zero */
  921. UINT8 Data[1]; /* Variable length */
  922. } ACPI_NFIT_SMBIOS;
  923. /* 4: NVDIMM Control Region Structure */
  924. typedef struct acpi_nfit_control_region
  925. {
  926. ACPI_NFIT_HEADER Header;
  927. UINT16 RegionIndex;
  928. UINT16 VendorId;
  929. UINT16 DeviceId;
  930. UINT16 RevisionId;
  931. UINT16 SubsystemVendorId;
  932. UINT16 SubsystemDeviceId;
  933. UINT16 SubsystemRevisionId;
  934. UINT8 Reserved[6]; /* Reserved, must be zero */
  935. UINT32 SerialNumber;
  936. UINT16 Code;
  937. UINT16 Windows;
  938. UINT64 WindowSize;
  939. UINT64 CommandOffset;
  940. UINT64 CommandSize;
  941. UINT64 StatusOffset;
  942. UINT64 StatusSize;
  943. UINT16 Flags;
  944. UINT8 Reserved1[6]; /* Reserved, must be zero */
  945. } ACPI_NFIT_CONTROL_REGION;
  946. /* Flags */
  947. #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
  948. /* 5: NVDIMM Block Data Window Region Structure */
  949. typedef struct acpi_nfit_data_region
  950. {
  951. ACPI_NFIT_HEADER Header;
  952. UINT16 RegionIndex;
  953. UINT16 Windows;
  954. UINT64 Offset;
  955. UINT64 Size;
  956. UINT64 Capacity;
  957. UINT64 StartAddress;
  958. } ACPI_NFIT_DATA_REGION;
  959. /* 6: Flush Hint Address Structure */
  960. typedef struct acpi_nfit_flush_address
  961. {
  962. ACPI_NFIT_HEADER Header;
  963. UINT32 DeviceHandle;
  964. UINT16 HintCount;
  965. UINT8 Reserved[6]; /* Reserved, must be zero */
  966. UINT64 HintAddress[1]; /* Variable length */
  967. } ACPI_NFIT_FLUSH_ADDRESS;
  968. /*******************************************************************************
  969. *
  970. * SBST - Smart Battery Specification Table
  971. * Version 1
  972. *
  973. ******************************************************************************/
  974. typedef struct acpi_table_sbst
  975. {
  976. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  977. UINT32 WarningLevel;
  978. UINT32 LowLevel;
  979. UINT32 CriticalLevel;
  980. } ACPI_TABLE_SBST;
  981. /*******************************************************************************
  982. *
  983. * SLIT - System Locality Distance Information Table
  984. * Version 1
  985. *
  986. ******************************************************************************/
  987. typedef struct acpi_table_slit
  988. {
  989. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  990. UINT64 LocalityCount;
  991. UINT8 Entry[1]; /* Real size = localities^2 */
  992. } ACPI_TABLE_SLIT;
  993. /*******************************************************************************
  994. *
  995. * SRAT - System Resource Affinity Table
  996. * Version 3
  997. *
  998. ******************************************************************************/
  999. typedef struct acpi_table_srat
  1000. {
  1001. ACPI_TABLE_HEADER Header; /* Common ACPI table header */
  1002. UINT32 TableRevision; /* Must be value '1' */
  1003. UINT64 Reserved; /* Reserved, must be zero */
  1004. } ACPI_TABLE_SRAT;
  1005. /* Values for subtable type in ACPI_SUBTABLE_HEADER */
  1006. enum AcpiSratType
  1007. {
  1008. ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  1009. ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  1010. ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
  1011. ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
  1012. ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
  1013. };
  1014. /*
  1015. * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
  1016. */
  1017. /* 0: Processor Local APIC/SAPIC Affinity */
  1018. typedef struct acpi_srat_cpu_affinity
  1019. {
  1020. ACPI_SUBTABLE_HEADER Header;
  1021. UINT8 ProximityDomainLo;
  1022. UINT8 ApicId;
  1023. UINT32 Flags;
  1024. UINT8 LocalSapicEid;
  1025. UINT8 ProximityDomainHi[3];
  1026. UINT32 ClockDomain;
  1027. } ACPI_SRAT_CPU_AFFINITY;
  1028. /* Flags */
  1029. #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
  1030. /* 1: Memory Affinity */
  1031. typedef struct acpi_srat_mem_affinity
  1032. {
  1033. ACPI_SUBTABLE_HEADER Header;
  1034. UINT32 ProximityDomain;
  1035. UINT16 Reserved; /* Reserved, must be zero */
  1036. UINT64 BaseAddress;
  1037. UINT64 Length;
  1038. UINT32 Reserved1;
  1039. UINT32 Flags;
  1040. UINT64 Reserved2; /* Reserved, must be zero */
  1041. } ACPI_SRAT_MEM_AFFINITY;
  1042. /* Flags */
  1043. #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
  1044. #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
  1045. #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
  1046. /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
  1047. typedef struct acpi_srat_x2apic_cpu_affinity
  1048. {
  1049. ACPI_SUBTABLE_HEADER Header;
  1050. UINT16 Reserved; /* Reserved, must be zero */
  1051. UINT32 ProximityDomain;
  1052. UINT32 ApicId;
  1053. UINT32 Flags;
  1054. UINT32 ClockDomain;
  1055. UINT32 Reserved2;
  1056. } ACPI_SRAT_X2APIC_CPU_AFFINITY;
  1057. /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
  1058. #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
  1059. /* 3: GICC Affinity (ACPI 5.1) */
  1060. typedef struct acpi_srat_gicc_affinity
  1061. {
  1062. ACPI_SUBTABLE_HEADER Header;
  1063. UINT32 ProximityDomain;
  1064. UINT32 AcpiProcessorUid;
  1065. UINT32 Flags;
  1066. UINT32 ClockDomain;
  1067. } ACPI_SRAT_GICC_AFFINITY;
  1068. /* Flags for ACPI_SRAT_GICC_AFFINITY */
  1069. #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
  1070. /* Reset to default packing */
  1071. #pragma pack()
  1072. #endif /* __ACTBL1_H__ */