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