AcpiParser.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  1. /** @file
  2. Header file for ACPI parser
  3. Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef ACPIPARSER_H_
  7. #define ACPIPARSER_H_
  8. #define OUTPUT_FIELD_COLUMN_WIDTH 36
  9. /// The RSDP table signature is "RSD PTR " (8 bytes)
  10. /// However The signature for ACPI tables is 4 bytes.
  11. /// To work around this oddity define a signature type
  12. /// that allows us to process the log options.
  13. #define RSDP_TABLE_INFO SIGNATURE_32('R', 'S', 'D', 'P')
  14. /**
  15. This function increments the ACPI table error counter.
  16. **/
  17. VOID
  18. EFIAPI
  19. IncrementErrorCount (
  20. VOID
  21. );
  22. /**
  23. This function increments the ACPI table warning counter.
  24. **/
  25. VOID
  26. EFIAPI
  27. IncrementWarningCount (
  28. VOID
  29. );
  30. /**
  31. This function verifies the ACPI table checksum.
  32. This function verifies the checksum for the ACPI table and optionally
  33. prints the status.
  34. @param [in] Log If TRUE log the status of the checksum.
  35. @param [in] Ptr Pointer to the start of the table buffer.
  36. @param [in] Length The length of the buffer.
  37. @retval TRUE The checksum is OK.
  38. @retval FALSE The checksum failed.
  39. **/
  40. BOOLEAN
  41. EFIAPI
  42. VerifyChecksum (
  43. IN BOOLEAN Log,
  44. IN UINT8 *Ptr,
  45. IN UINT32 Length
  46. );
  47. /**
  48. This function performs a raw data dump of the ACPI table.
  49. @param [in] Ptr Pointer to the start of the table buffer.
  50. @param [in] Length The length of the buffer.
  51. **/
  52. VOID
  53. EFIAPI
  54. DumpRaw (
  55. IN UINT8 *Ptr,
  56. IN UINT32 Length
  57. );
  58. /**
  59. This function traces 1 byte of datum as specified in the format string.
  60. @param [in] Format The format string for tracing the data.
  61. @param [in] Ptr Pointer to the start of the buffer.
  62. **/
  63. VOID
  64. EFIAPI
  65. DumpUint8 (
  66. IN CONST CHAR16 *Format,
  67. IN UINT8 *Ptr
  68. );
  69. /**
  70. This function traces 2 bytes of data as specified in the format string.
  71. @param [in] Format The format string for tracing the data.
  72. @param [in] Ptr Pointer to the start of the buffer.
  73. **/
  74. VOID
  75. EFIAPI
  76. DumpUint16 (
  77. IN CONST CHAR16 *Format,
  78. IN UINT8 *Ptr
  79. );
  80. /**
  81. This function traces 4 bytes of data as specified in the format string.
  82. @param [in] Format The format string for tracing the data.
  83. @param [in] Ptr Pointer to the start of the buffer.
  84. **/
  85. VOID
  86. EFIAPI
  87. DumpUint32 (
  88. IN CONST CHAR16 *Format,
  89. IN UINT8 *Ptr
  90. );
  91. /**
  92. This function traces 8 bytes of data as specified by the format string.
  93. @param [in] Format The format string for tracing the data.
  94. @param [in] Ptr Pointer to the start of the buffer.
  95. **/
  96. VOID
  97. EFIAPI
  98. DumpUint64 (
  99. IN CONST CHAR16 *Format,
  100. IN UINT8 *Ptr
  101. );
  102. /**
  103. This function traces 3 characters which can be optionally
  104. formated using the format string if specified.
  105. If no format string is specified the Format must be NULL.
  106. @param [in] Format Optional format string for tracing the data.
  107. @param [in] Ptr Pointer to the start of the buffer.
  108. **/
  109. VOID
  110. EFIAPI
  111. Dump3Chars (
  112. IN CONST CHAR16 *Format OPTIONAL,
  113. IN UINT8 *Ptr
  114. );
  115. /**
  116. This function traces 4 characters which can be optionally
  117. formated using the format string if specified.
  118. If no format string is specified the Format must be NULL.
  119. @param [in] Format Optional format string for tracing the data.
  120. @param [in] Ptr Pointer to the start of the buffer.
  121. **/
  122. VOID
  123. EFIAPI
  124. Dump4Chars (
  125. IN CONST CHAR16 *Format OPTIONAL,
  126. IN UINT8 *Ptr
  127. );
  128. /**
  129. This function traces 6 characters which can be optionally
  130. formated using the format string if specified.
  131. If no format string is specified the Format must be NULL.
  132. @param [in] Format Optional format string for tracing the data.
  133. @param [in] Ptr Pointer to the start of the buffer.
  134. **/
  135. VOID
  136. EFIAPI
  137. Dump6Chars (
  138. IN CONST CHAR16 *Format OPTIONAL,
  139. IN UINT8 *Ptr
  140. );
  141. /**
  142. This function traces 8 characters which can be optionally
  143. formated using the format string if specified.
  144. If no format string is specified the Format must be NULL.
  145. @param [in] Format Optional format string for tracing the data.
  146. @param [in] Ptr Pointer to the start of the buffer.
  147. **/
  148. VOID
  149. EFIAPI
  150. Dump8Chars (
  151. IN CONST CHAR16 *Format OPTIONAL,
  152. IN UINT8 *Ptr
  153. );
  154. /**
  155. This function traces 12 characters which can be optionally
  156. formated using the format string if specified.
  157. If no format string is specified the Format must be NULL.
  158. @param [in] Format Optional format string for tracing the data.
  159. @param [in] Ptr Pointer to the start of the buffer.
  160. **/
  161. VOID
  162. EFIAPI
  163. Dump12Chars (
  164. IN CONST CHAR16 *Format OPTIONAL,
  165. IN UINT8 *Ptr
  166. );
  167. /**
  168. This function indents and prints the ACPI table Field Name.
  169. @param [in] Indent Number of spaces to add to the global table
  170. indent. The global table indent is 0 by default;
  171. however this value is updated on entry to the
  172. ParseAcpi() by adding the indent value provided to
  173. ParseAcpi() and restored back on exit. Therefore
  174. the total indent in the output is dependent on from
  175. where this function is called.
  176. @param [in] FieldName Pointer to the Field Name.
  177. **/
  178. VOID
  179. EFIAPI
  180. PrintFieldName (
  181. IN UINT32 Indent,
  182. IN CONST CHAR16 *FieldName
  183. );
  184. /**
  185. This function pointer is the template for customizing the trace output
  186. @param [in] Format Format string for tracing the data as specified by
  187. the 'Format' member of ACPI_PARSER.
  188. @param [in] Ptr Pointer to the start of the buffer.
  189. **/
  190. typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR16 *Format, UINT8 *Ptr);
  191. /**
  192. This function pointer is the template for validating an ACPI table field.
  193. @param [in] Ptr Pointer to the start of the field data.
  194. @param [in] Context Pointer to context specific information as specified by
  195. the 'Context' member of the ACPI_PARSER.
  196. e.g. this could be a pointer to the ACPI table header.
  197. **/
  198. typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, VOID *Context);
  199. /**
  200. The ACPI_PARSER structure describes the fields of an ACPI table and
  201. provides means for the parser to interpret and trace appropriately.
  202. The first three members are populated based on information present in
  203. in the ACPI table specifications. The remaining members describe how
  204. the parser should report the field information, validate the field data
  205. and/or update an external pointer to the field (ItemPtr).
  206. ParseAcpi() uses the format string specified by 'Format' for tracing
  207. the field data. If the field is more complex and requires additional
  208. processing for formatting and representation a print formatter function
  209. can be specified in 'PrintFormatter'.
  210. The PrintFormatter function may choose to use the format string
  211. specified by 'Format' or use its own internal format string.
  212. The 'Format' and 'PrintFormatter' members allow flexibility for
  213. representing the field data.
  214. **/
  215. typedef struct AcpiParser {
  216. /// String describing the ACPI table field
  217. /// (Field column from ACPI table spec)
  218. CONST CHAR16 *NameStr;
  219. /// The length of the field.
  220. /// (Byte Length column from ACPI table spec)
  221. UINT32 Length;
  222. /// The offset of the field from the start of the table.
  223. /// (Byte Offset column from ACPI table spec)
  224. UINT32 Offset;
  225. /// Optional Print() style format string for tracing the data. If not
  226. /// used this must be set to NULL.
  227. CONST CHAR16 *Format;
  228. /// Optional pointer to a print formatter function which
  229. /// is typically used to trace complex field information.
  230. /// If not used this must be set to NULL.
  231. /// The Format string is passed to the PrintFormatter function
  232. /// but may be ignored by the implementation code.
  233. FNPTR_PRINT_FORMATTER PrintFormatter;
  234. /// Optional pointer which may be set to request the parser to update
  235. /// a pointer to the field data. This value is set after the FieldValidator
  236. /// has been called and therefore should not be used by the FieldValidator.
  237. /// If unused this must be set to NULL.
  238. VOID **ItemPtr;
  239. /// Optional pointer to a field validator function.
  240. /// The function should directly report any appropriate error or warning
  241. /// and invoke the appropriate counter update function.
  242. /// If not used this parameter must be set to NULL.
  243. FNPTR_FIELD_VALIDATOR FieldValidator;
  244. /// Optional pointer to context specific information,
  245. /// which the Field Validator function can use to determine
  246. /// additional information about the ACPI table and make
  247. /// decisions about the field being validated.
  248. /// e.g. this could be a pointer to the ACPI table header
  249. VOID *Context;
  250. } ACPI_PARSER;
  251. /**
  252. A structure used to store the pointers to the members of the
  253. ACPI description header structure that was parsed.
  254. **/
  255. typedef struct AcpiDescriptionHeaderInfo {
  256. /// ACPI table signature
  257. UINT32 *Signature;
  258. /// Length of the ACPI table
  259. UINT32 *Length;
  260. /// Revision
  261. UINT8 *Revision;
  262. /// Checksum
  263. UINT8 *Checksum;
  264. /// OEM Id - length is 6 bytes
  265. UINT8 *OemId;
  266. /// OEM table Id
  267. UINT64 *OemTableId;
  268. /// OEM revision Id
  269. UINT32 *OemRevision;
  270. /// Creator Id
  271. UINT32 *CreatorId;
  272. /// Creator revision
  273. UINT32 *CreatorRevision;
  274. } ACPI_DESCRIPTION_HEADER_INFO;
  275. /**
  276. This function is used to parse an ACPI table buffer.
  277. The ACPI table buffer is parsed using the ACPI table parser information
  278. specified by a pointer to an array of ACPI_PARSER elements. This parser
  279. function iterates through each item on the ACPI_PARSER array and logs the
  280. ACPI table fields.
  281. This function can optionally be used to parse ACPI tables and fetch specific
  282. field values. The ItemPtr member of the ACPI_PARSER structure (where used)
  283. is updated by this parser function to point to the selected field data
  284. (e.g. useful for variable length nested fields).
  285. @param [in] Trace Trace the ACPI fields TRUE else only parse the
  286. table.
  287. @param [in] Indent Number of spaces to indent the output.
  288. @param [in] AsciiName Optional pointer to an ASCII string that describes
  289. the table being parsed.
  290. @param [in] Ptr Pointer to the start of the buffer.
  291. @param [in] Length Length of the buffer pointed by Ptr.
  292. @param [in] Parser Pointer to an array of ACPI_PARSER structure that
  293. describes the table being parsed.
  294. @param [in] ParserItems Number of items in the ACPI_PARSER array.
  295. @retval Number of bytes parsed.
  296. **/
  297. UINT32
  298. EFIAPI
  299. ParseAcpi (
  300. IN BOOLEAN Trace,
  301. IN UINT32 Indent,
  302. IN CONST CHAR8 *AsciiName OPTIONAL,
  303. IN UINT8 *Ptr,
  304. IN UINT32 Length,
  305. IN CONST ACPI_PARSER *Parser,
  306. IN UINT32 ParserItems
  307. );
  308. /**
  309. This is a helper macro to pass parameters to the Parser functions.
  310. @param [in] Parser The name of the ACPI_PARSER array describing the
  311. ACPI table fields.
  312. **/
  313. #define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0])
  314. /**
  315. This is a helper macro for describing the ACPI header fields.
  316. @param [out] Info Pointer to retrieve the ACPI table header information.
  317. **/
  318. #define PARSE_ACPI_HEADER(Info) \
  319. { L"Signature", 4, 0, NULL, Dump4Chars, \
  320. (VOID**)&(Info)->Signature , NULL, NULL }, \
  321. { L"Length", 4, 4, L"%d", NULL, \
  322. (VOID**)&(Info)->Length, NULL, NULL }, \
  323. { L"Revision", 1, 8, L"%d", NULL, \
  324. (VOID**)&(Info)->Revision, NULL, NULL }, \
  325. { L"Checksum", 1, 9, L"0x%X", NULL, \
  326. (VOID**)&(Info)->Checksum, NULL, NULL }, \
  327. { L"Oem ID", 6, 10, NULL, Dump6Chars, \
  328. (VOID**)&(Info)->OemId, NULL, NULL }, \
  329. { L"Oem Table ID", 8, 16, NULL, Dump8Chars, \
  330. (VOID**)&(Info)->OemTableId, NULL, NULL }, \
  331. { L"Oem Revision", 4, 24, L"0x%X", NULL, \
  332. (VOID**)&(Info)->OemRevision, NULL, NULL }, \
  333. { L"Creator ID", 4, 28, NULL, Dump4Chars, \
  334. (VOID**)&(Info)->CreatorId, NULL, NULL }, \
  335. { L"Creator Revision", 4, 32, L"0x%X", NULL, \
  336. (VOID**)&(Info)->CreatorRevision, NULL, NULL }
  337. /**
  338. This function indents and traces the GAS structure as described by the GasParser.
  339. @param [in] Ptr Pointer to the start of the buffer.
  340. @param [in] Indent Number of spaces to indent the output.
  341. @param [in] Length Length of the GAS structure buffer.
  342. @retval Number of bytes parsed.
  343. **/
  344. UINT32
  345. EFIAPI
  346. DumpGasStruct (
  347. IN UINT8 *Ptr,
  348. IN UINT32 Indent,
  349. IN UINT32 Length
  350. );
  351. /**
  352. This function traces the GAS structure as described by the GasParser.
  353. @param [in] Format Optional format string for tracing the data.
  354. @param [in] Ptr Pointer to the start of the buffer.
  355. **/
  356. VOID
  357. EFIAPI
  358. DumpGas (
  359. IN CONST CHAR16 *Format OPTIONAL,
  360. IN UINT8 *Ptr
  361. );
  362. /**
  363. This function traces the ACPI header as described by the AcpiHeaderParser.
  364. @param [in] Ptr Pointer to the start of the buffer.
  365. @retval Number of bytes parsed.
  366. **/
  367. UINT32
  368. EFIAPI
  369. DumpAcpiHeader (
  370. IN UINT8 *Ptr
  371. );
  372. /**
  373. This function parses the ACPI header as described by the AcpiHeaderParser.
  374. This function optionally returns the Signature, Length and revision of the
  375. ACPI table.
  376. @param [in] Ptr Pointer to the start of the buffer.
  377. @param [out] Signature Gets location of the ACPI table signature.
  378. @param [out] Length Gets location of the length of the ACPI table.
  379. @param [out] Revision Gets location of the revision of the ACPI table.
  380. @retval Number of bytes parsed.
  381. **/
  382. UINT32
  383. EFIAPI
  384. ParseAcpiHeader (
  385. IN UINT8 *Ptr,
  386. OUT CONST UINT32 **Signature,
  387. OUT CONST UINT32 **Length,
  388. OUT CONST UINT8 **Revision
  389. );
  390. /**
  391. This function parses the ACPI AEST table.
  392. When trace is enabled this function parses the AEST table and
  393. traces the ACPI table fields.
  394. This function also performs validation of the ACPI table fields.
  395. @param [in] Trace If TRUE, trace the ACPI fields.
  396. @param [in] Ptr Pointer to the start of the buffer.
  397. @param [in] AcpiTableLength Length of the ACPI table.
  398. @param [in] AcpiTableRevision Revision of the ACPI table.
  399. **/
  400. VOID
  401. EFIAPI
  402. ParseAcpiAest (
  403. IN BOOLEAN Trace,
  404. IN UINT8 *Ptr,
  405. IN UINT32 AcpiTableLength,
  406. IN UINT8 AcpiTableRevision
  407. );
  408. /**
  409. This function parses the ACPI BGRT table.
  410. When trace is enabled this function parses the BGRT table and
  411. traces the ACPI table fields.
  412. This function also performs validation of the ACPI table fields.
  413. @param [in] Trace If TRUE, trace the ACPI fields.
  414. @param [in] Ptr Pointer to the start of the buffer.
  415. @param [in] AcpiTableLength Length of the ACPI table.
  416. @param [in] AcpiTableRevision Revision of the ACPI table.
  417. **/
  418. VOID
  419. EFIAPI
  420. ParseAcpiBgrt (
  421. IN BOOLEAN Trace,
  422. IN UINT8 *Ptr,
  423. IN UINT32 AcpiTableLength,
  424. IN UINT8 AcpiTableRevision
  425. );
  426. /**
  427. This function parses the ACPI DBG2 table.
  428. When trace is enabled this function parses the DBG2 table and
  429. traces the ACPI table fields.
  430. This function also performs validation of the ACPI table fields.
  431. @param [in] Trace If TRUE, trace the ACPI fields.
  432. @param [in] Ptr Pointer to the start of the buffer.
  433. @param [in] AcpiTableLength Length of the ACPI table.
  434. @param [in] AcpiTableRevision Revision of the ACPI table.
  435. **/
  436. VOID
  437. EFIAPI
  438. ParseAcpiDbg2 (
  439. IN BOOLEAN Trace,
  440. IN UINT8 *Ptr,
  441. IN UINT32 AcpiTableLength,
  442. IN UINT8 AcpiTableRevision
  443. );
  444. /**
  445. This function parses the ACPI DSDT table.
  446. When trace is enabled this function parses the DSDT table and
  447. traces the ACPI table fields.
  448. For the DSDT table only the ACPI header fields are parsed and
  449. traced.
  450. @param [in] Trace If TRUE, trace the ACPI fields.
  451. @param [in] Ptr Pointer to the start of the buffer.
  452. @param [in] AcpiTableLength Length of the ACPI table.
  453. @param [in] AcpiTableRevision Revision of the ACPI table.
  454. **/
  455. VOID
  456. EFIAPI
  457. ParseAcpiDsdt (
  458. IN BOOLEAN Trace,
  459. IN UINT8 *Ptr,
  460. IN UINT32 AcpiTableLength,
  461. IN UINT8 AcpiTableRevision
  462. );
  463. /**
  464. This function parses the ACPI FACS table.
  465. When trace is enabled this function parses the FACS table and
  466. traces the ACPI table fields.
  467. This function also performs validation of the ACPI table fields.
  468. @param [in] Trace If TRUE, trace the ACPI fields.
  469. @param [in] Ptr Pointer to the start of the buffer.
  470. @param [in] AcpiTableLength Length of the ACPI table.
  471. @param [in] AcpiTableRevision Revision of the ACPI table.
  472. **/
  473. VOID
  474. EFIAPI
  475. ParseAcpiFacs (
  476. IN BOOLEAN Trace,
  477. IN UINT8 *Ptr,
  478. IN UINT32 AcpiTableLength,
  479. IN UINT8 AcpiTableRevision
  480. );
  481. /**
  482. This function parses the ACPI FADT table.
  483. This function parses the FADT table and optionally traces the ACPI
  484. table fields.
  485. This function also performs validation of the ACPI table fields.
  486. @param [in] Trace If TRUE, trace the ACPI fields.
  487. @param [in] Ptr Pointer to the start of the buffer.
  488. @param [in] AcpiTableLength Length of the ACPI table.
  489. @param [in] AcpiTableRevision Revision of the ACPI table.
  490. **/
  491. VOID
  492. EFIAPI
  493. ParseAcpiFadt (
  494. IN BOOLEAN Trace,
  495. IN UINT8 *Ptr,
  496. IN UINT32 AcpiTableLength,
  497. IN UINT8 AcpiTableRevision
  498. );
  499. /**
  500. This function parses the ACPI GTDT table.
  501. When trace is enabled this function parses the GTDT table and
  502. traces the ACPI table fields.
  503. This function also parses the following platform timer structures:
  504. - GT Block timer
  505. - Watchdog timer
  506. This function also performs validation of the ACPI table fields.
  507. @param [in] Trace If TRUE, trace the ACPI fields.
  508. @param [in] Ptr Pointer to the start of the buffer.
  509. @param [in] AcpiTableLength Length of the ACPI table.
  510. @param [in] AcpiTableRevision Revision of the ACPI table.
  511. **/
  512. VOID
  513. EFIAPI
  514. ParseAcpiGtdt (
  515. IN BOOLEAN Trace,
  516. IN UINT8 *Ptr,
  517. IN UINT32 AcpiTableLength,
  518. IN UINT8 AcpiTableRevision
  519. );
  520. /**
  521. This function parses the ACPI HMAT table.
  522. When trace is enabled this function parses the HMAT table and
  523. traces the ACPI table fields.
  524. This function parses the following HMAT structures:
  525. - Memory Proximity Domain Attributes Structure (Type 0)
  526. - System Locality Latency and Bandwidth Info Structure (Type 1)
  527. - Memory Side Cache Info structure (Type 2)
  528. This function also performs validation of the ACPI table fields.
  529. @param [in] Trace If TRUE, trace the ACPI fields.
  530. @param [in] Ptr Pointer to the start of the buffer.
  531. @param [in] AcpiTableLength Length of the ACPI table.
  532. @param [in] AcpiTableRevision Revision of the ACPI table.
  533. **/
  534. VOID
  535. EFIAPI
  536. ParseAcpiHmat (
  537. IN BOOLEAN Trace,
  538. IN UINT8 *Ptr,
  539. IN UINT32 AcpiTableLength,
  540. IN UINT8 AcpiTableRevision
  541. );
  542. /**
  543. This function parses the ACPI IORT table.
  544. When trace is enabled this function parses the IORT table and
  545. traces the ACPI fields.
  546. This function also parses the following nodes:
  547. - ITS Group
  548. - Named Component
  549. - Root Complex
  550. - SMMUv1/2
  551. - SMMUv3
  552. - PMCG
  553. This function also performs validation of the ACPI table fields.
  554. @param [in] Trace If TRUE, trace the ACPI fields.
  555. @param [in] Ptr Pointer to the start of the buffer.
  556. @param [in] AcpiTableLength Length of the ACPI table.
  557. @param [in] AcpiTableRevision Revision of the ACPI table.
  558. **/
  559. VOID
  560. EFIAPI
  561. ParseAcpiIort (
  562. IN BOOLEAN Trace,
  563. IN UINT8 *Ptr,
  564. IN UINT32 AcpiTableLength,
  565. IN UINT8 AcpiTableRevision
  566. );
  567. /**
  568. This function parses the ACPI MADT table.
  569. When trace is enabled this function parses the MADT table and
  570. traces the ACPI table fields.
  571. This function currently parses the following Interrupt Controller
  572. Structures:
  573. - GICC
  574. - GICD
  575. - GIC MSI Frame
  576. - GICR
  577. - GIC ITS
  578. This function also performs validation of the ACPI table fields.
  579. @param [in] Trace If TRUE, trace the ACPI fields.
  580. @param [in] Ptr Pointer to the start of the buffer.
  581. @param [in] AcpiTableLength Length of the ACPI table.
  582. @param [in] AcpiTableRevision Revision of the ACPI table.
  583. **/
  584. VOID
  585. EFIAPI
  586. ParseAcpiMadt (
  587. IN BOOLEAN Trace,
  588. IN UINT8 *Ptr,
  589. IN UINT32 AcpiTableLength,
  590. IN UINT8 AcpiTableRevision
  591. );
  592. /**
  593. This function parses the ACPI MCFG table.
  594. When trace is enabled this function parses the MCFG table and
  595. traces the ACPI table fields.
  596. This function also performs validation of the ACPI table fields.
  597. @param [in] Trace If TRUE, trace the ACPI fields.
  598. @param [in] Ptr Pointer to the start of the buffer.
  599. @param [in] AcpiTableLength Length of the ACPI table.
  600. @param [in] AcpiTableRevision Revision of the ACPI table.
  601. **/
  602. VOID
  603. EFIAPI
  604. ParseAcpiMcfg (
  605. IN BOOLEAN Trace,
  606. IN UINT8 *Ptr,
  607. IN UINT32 AcpiTableLength,
  608. IN UINT8 AcpiTableRevision
  609. );
  610. /**
  611. This function parses the ACPI PCCT table including its sub-structures
  612. of type 0 through 4.
  613. When trace is enabled this function parses the PCCT table and
  614. traces the ACPI table fields.
  615. This function also performs validation of the ACPI table fields.
  616. @param [in] Trace If TRUE, trace the ACPI fields.
  617. @param [in] Ptr Pointer to the start of the buffer.
  618. @param [in] AcpiTableLength Length of the ACPI table.
  619. @param [in] AcpiTableRevision Revision of the ACPI table.
  620. **/
  621. VOID
  622. EFIAPI
  623. ParseAcpiPcct (
  624. IN BOOLEAN Trace,
  625. IN UINT8 *Ptr,
  626. IN UINT32 AcpiTableLength,
  627. IN UINT8 AcpiTableRevision
  628. );
  629. /**
  630. This function parses the ACPI PPTT table.
  631. When trace is enabled this function parses the PPTT table and
  632. traces the ACPI table fields.
  633. This function also performs validation of the ACPI table fields.
  634. @param [in] Trace If TRUE, trace the ACPI fields.
  635. @param [in] Ptr Pointer to the start of the buffer.
  636. @param [in] AcpiTableLength Length of the ACPI table.
  637. @param [in] AcpiTableRevision Revision of the ACPI table.
  638. **/
  639. VOID
  640. EFIAPI
  641. ParseAcpiPptt (
  642. IN BOOLEAN Trace,
  643. IN UINT8 *Ptr,
  644. IN UINT32 AcpiTableLength,
  645. IN UINT8 AcpiTableRevision
  646. );
  647. /**
  648. This function parses the ACPI RSDP table.
  649. This function invokes the parser for the XSDT table.
  650. * Note - This function does not support parsing of RSDT table.
  651. This function also performs a RAW dump of the ACPI table and
  652. validates the checksum.
  653. @param [in] Trace If TRUE, trace the ACPI fields.
  654. @param [in] Ptr Pointer to the start of the buffer.
  655. @param [in] AcpiTableLength Length of the ACPI table.
  656. @param [in] AcpiTableRevision Revision of the ACPI table.
  657. **/
  658. VOID
  659. EFIAPI
  660. ParseAcpiRsdp (
  661. IN BOOLEAN Trace,
  662. IN UINT8 *Ptr,
  663. IN UINT32 AcpiTableLength,
  664. IN UINT8 AcpiTableRevision
  665. );
  666. /**
  667. This function parses the ACPI SLIT table.
  668. When trace is enabled this function parses the SLIT table and
  669. traces the ACPI table fields.
  670. This function also validates System Localities for the following:
  671. - Diagonal elements have a normalized value of 10
  672. - Relative distance from System Locality at i*N+j is same as
  673. j*N+i
  674. @param [in] Trace If TRUE, trace the ACPI fields.
  675. @param [in] Ptr Pointer to the start of the buffer.
  676. @param [in] AcpiTableLength Length of the ACPI table.
  677. @param [in] AcpiTableRevision Revision of the ACPI table.
  678. **/
  679. VOID
  680. EFIAPI
  681. ParseAcpiSlit (
  682. IN BOOLEAN Trace,
  683. IN UINT8 *Ptr,
  684. IN UINT32 AcpiTableLength,
  685. IN UINT8 AcpiTableRevision
  686. );
  687. /**
  688. This function parses the ACPI SPCR table.
  689. When trace is enabled this function parses the SPCR table and
  690. traces the ACPI table fields.
  691. This function also performs validations of the ACPI table fields.
  692. @param [in] Trace If TRUE, trace the ACPI fields.
  693. @param [in] Ptr Pointer to the start of the buffer.
  694. @param [in] AcpiTableLength Length of the ACPI table.
  695. @param [in] AcpiTableRevision Revision of the ACPI table.
  696. **/
  697. VOID
  698. EFIAPI
  699. ParseAcpiSpcr (
  700. IN BOOLEAN Trace,
  701. IN UINT8 *Ptr,
  702. IN UINT32 AcpiTableLength,
  703. IN UINT8 AcpiTableRevision
  704. );
  705. /**
  706. This function parses the ACPI SRAT table.
  707. When trace is enabled this function parses the SRAT table and
  708. traces the ACPI table fields.
  709. This function parses the following Resource Allocation Structures:
  710. - Processor Local APIC/SAPIC Affinity Structure
  711. - Memory Affinity Structure
  712. - Processor Local x2APIC Affinity Structure
  713. - GICC Affinity Structure
  714. This function also performs validation of the ACPI table fields.
  715. @param [in] Trace If TRUE, trace the ACPI fields.
  716. @param [in] Ptr Pointer to the start of the buffer.
  717. @param [in] AcpiTableLength Length of the ACPI table.
  718. @param [in] AcpiTableRevision Revision of the ACPI table.
  719. **/
  720. VOID
  721. EFIAPI
  722. ParseAcpiSrat (
  723. IN BOOLEAN Trace,
  724. IN UINT8 *Ptr,
  725. IN UINT32 AcpiTableLength,
  726. IN UINT8 AcpiTableRevision
  727. );
  728. /**
  729. This function parses the ACPI SSDT table.
  730. When trace is enabled this function parses the SSDT table and
  731. traces the ACPI table fields.
  732. For the SSDT table only the ACPI header fields are
  733. parsed and traced.
  734. @param [in] Trace If TRUE, trace the ACPI fields.
  735. @param [in] Ptr Pointer to the start of the buffer.
  736. @param [in] AcpiTableLength Length of the ACPI table.
  737. @param [in] AcpiTableRevision Revision of the ACPI table.
  738. **/
  739. VOID
  740. EFIAPI
  741. ParseAcpiSsdt (
  742. IN BOOLEAN Trace,
  743. IN UINT8 *Ptr,
  744. IN UINT32 AcpiTableLength,
  745. IN UINT8 AcpiTableRevision
  746. );
  747. /**
  748. This function parses the ACPI XSDT table
  749. and optionally traces the ACPI table fields.
  750. This function also performs validation of the XSDT table.
  751. @param [in] Trace If TRUE, trace the ACPI fields.
  752. @param [in] Ptr Pointer to the start of the buffer.
  753. @param [in] AcpiTableLength Length of the ACPI table.
  754. @param [in] AcpiTableRevision Revision of the ACPI table.
  755. **/
  756. VOID
  757. EFIAPI
  758. ParseAcpiXsdt (
  759. IN BOOLEAN Trace,
  760. IN UINT8 *Ptr,
  761. IN UINT32 AcpiTableLength,
  762. IN UINT8 AcpiTableRevision
  763. );
  764. #endif // ACPIPARSER_H_