]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct()
[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
58cc0ffe
KK
408 @param [in] Length Length of the GAS structure buffer.\r
409\r
410 @retval Number of bytes parsed.\r
a6eaba4d 411**/\r
58cc0ffe 412UINT32\r
ee4dc24f
RN
413EFIAPI\r
414DumpGasStruct (\r
415 IN UINT8* Ptr,\r
58cc0ffe
KK
416 IN UINT32 Indent,\r
417 IN UINT32 Length\r
ee4dc24f
RN
418 );\r
419\r
a6eaba4d
DB
420/**\r
421 This function traces the GAS structure as described by the GasParser.\r
ee4dc24f
RN
422\r
423 @param [in] Format Optional format string for tracing the data.\r
424 @param [in] Ptr Pointer to the start of the buffer.\r
a6eaba4d 425**/\r
ee4dc24f
RN
426VOID\r
427EFIAPI\r
428DumpGas (\r
429 IN CONST CHAR16* Format OPTIONAL,\r
430 IN UINT8* Ptr\r
431 );\r
432\r
a6eaba4d
DB
433/**\r
434 This function traces the ACPI header as described by the AcpiHeaderParser.\r
ee4dc24f
RN
435\r
436 @param [in] Ptr Pointer to the start of the buffer.\r
437\r
438 @retval Number of bytes parsed.\r
a6eaba4d 439**/\r
ee4dc24f
RN
440UINT32\r
441EFIAPI\r
442DumpAcpiHeader (\r
443 IN UINT8* Ptr\r
444 );\r
445\r
a6eaba4d
DB
446/**\r
447 This function parses the ACPI header as described by the AcpiHeaderParser.\r
ee4dc24f
RN
448\r
449 This function optionally returns the Signature, Length and revision of the\r
450 ACPI table.\r
451\r
452 @param [in] Ptr Pointer to the start of the buffer.\r
453 @param [out] Signature Gets location of the ACPI table signature.\r
454 @param [out] Length Gets location of the length of the ACPI table.\r
455 @param [out] Revision Gets location of the revision of the ACPI table.\r
456\r
457 @retval Number of bytes parsed.\r
a6eaba4d 458**/\r
ee4dc24f
RN
459UINT32\r
460EFIAPI\r
461ParseAcpiHeader (\r
462 IN UINT8* Ptr,\r
463 OUT CONST UINT32** Signature,\r
464 OUT CONST UINT32** Length,\r
465 OUT CONST UINT8** Revision\r
466 );\r
467\r
a6eaba4d
DB
468/**\r
469 This function parses the ACPI BGRT table.\r
ee4dc24f
RN
470 When trace is enabled this function parses the BGRT table and\r
471 traces the ACPI table fields.\r
472\r
473 This function also performs validation of the ACPI table fields.\r
474\r
475 @param [in] Trace If TRUE, trace the ACPI fields.\r
476 @param [in] Ptr Pointer to the start of the buffer.\r
477 @param [in] AcpiTableLength Length of the ACPI table.\r
478 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 479**/\r
ee4dc24f
RN
480VOID\r
481EFIAPI\r
482ParseAcpiBgrt (\r
483 IN BOOLEAN Trace,\r
484 IN UINT8* Ptr,\r
485 IN UINT32 AcpiTableLength,\r
486 IN UINT8 AcpiTableRevision\r
487 );\r
488\r
a6eaba4d
DB
489/**\r
490 This function parses the ACPI DBG2 table.\r
ee4dc24f
RN
491 When trace is enabled this function parses the DBG2 table and\r
492 traces the ACPI table fields.\r
493\r
494 This function also performs validation of the ACPI table fields.\r
495\r
496 @param [in] Trace If TRUE, trace the ACPI fields.\r
497 @param [in] Ptr Pointer to the start of the buffer.\r
498 @param [in] AcpiTableLength Length of the ACPI table.\r
499 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 500**/\r
ee4dc24f
RN
501VOID\r
502EFIAPI\r
503ParseAcpiDbg2 (\r
504 IN BOOLEAN Trace,\r
505 IN UINT8* Ptr,\r
506 IN UINT32 AcpiTableLength,\r
507 IN UINT8 AcpiTableRevision\r
508 );\r
509\r
a6eaba4d
DB
510/**\r
511 This function parses the ACPI DSDT table.\r
ee4dc24f
RN
512 When trace is enabled this function parses the DSDT table and\r
513 traces the ACPI table fields.\r
514 For the DSDT table only the ACPI header fields are parsed and\r
515 traced.\r
516\r
517 @param [in] Trace If TRUE, trace the ACPI fields.\r
518 @param [in] Ptr Pointer to the start of the buffer.\r
519 @param [in] AcpiTableLength Length of the ACPI table.\r
520 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 521**/\r
ee4dc24f
RN
522VOID\r
523EFIAPI\r
524ParseAcpiDsdt (\r
525 IN BOOLEAN Trace,\r
526 IN UINT8* Ptr,\r
527 IN UINT32 AcpiTableLength,\r
528 IN UINT8 AcpiTableRevision\r
529 );\r
530\r
a6eaba4d
DB
531/**\r
532 This function parses the ACPI FADT table.\r
ee4dc24f
RN
533 This function parses the FADT table and optionally traces the ACPI\r
534 table fields.\r
535\r
536 This function also performs validation of the ACPI table fields.\r
537\r
538 @param [in] Trace If TRUE, trace the ACPI fields.\r
539 @param [in] Ptr Pointer to the start of the buffer.\r
540 @param [in] AcpiTableLength Length of the ACPI table.\r
541 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 542**/\r
ee4dc24f
RN
543VOID\r
544EFIAPI\r
545ParseAcpiFadt (\r
546 IN BOOLEAN Trace,\r
547 IN UINT8* Ptr,\r
548 IN UINT32 AcpiTableLength,\r
549 IN UINT8 AcpiTableRevision\r
550 );\r
551\r
a6eaba4d
DB
552/**\r
553 This function parses the ACPI GTDT table.\r
ee4dc24f
RN
554 When trace is enabled this function parses the GTDT table and\r
555 traces the ACPI table fields.\r
556\r
557 This function also parses the following platform timer structures:\r
558 - GT Block timer\r
559 - Watchdog timer\r
560\r
561 This function also performs validation of the ACPI table fields.\r
562\r
563 @param [in] Trace If TRUE, trace the ACPI fields.\r
564 @param [in] Ptr Pointer to the start of the buffer.\r
565 @param [in] AcpiTableLength Length of the ACPI table.\r
566 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 567**/\r
ee4dc24f
RN
568VOID\r
569EFIAPI\r
570ParseAcpiGtdt (\r
571 IN BOOLEAN Trace,\r
572 IN UINT8* Ptr,\r
573 IN UINT32 AcpiTableLength,\r
574 IN UINT8 AcpiTableRevision\r
575 );\r
576\r
a6eaba4d
DB
577/**\r
578 This function parses the ACPI IORT table.\r
ee4dc24f
RN
579 When trace is enabled this function parses the IORT table and\r
580 traces the ACPI fields.\r
581\r
582 This function also parses the following nodes:\r
583 - ITS Group\r
584 - Named Component\r
585 - Root Complex\r
586 - SMMUv1/2\r
587 - SMMUv3\r
588 - PMCG\r
589\r
590 This function also performs validation of the ACPI table fields.\r
591\r
592 @param [in] Trace If TRUE, trace the ACPI fields.\r
593 @param [in] Ptr Pointer to the start of the buffer.\r
594 @param [in] AcpiTableLength Length of the ACPI table.\r
595 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 596**/\r
ee4dc24f
RN
597VOID\r
598EFIAPI\r
599ParseAcpiIort (\r
600 IN BOOLEAN Trace,\r
601 IN UINT8* Ptr,\r
602 IN UINT32 AcpiTableLength,\r
603 IN UINT8 AcpiTableRevision\r
604 );\r
605\r
a6eaba4d
DB
606/**\r
607 This function parses the ACPI MADT table.\r
ee4dc24f
RN
608 When trace is enabled this function parses the MADT table and\r
609 traces the ACPI table fields.\r
610\r
611 This function currently parses the following Interrupt Controller\r
612 Structures:\r
613 - GICC\r
614 - GICD\r
615 - GIC MSI Frame\r
616 - GICR\r
617 - GIC ITS\r
618\r
619 This function also performs validation of the ACPI table fields.\r
620\r
621 @param [in] Trace If TRUE, trace the ACPI fields.\r
622 @param [in] Ptr Pointer to the start of the buffer.\r
623 @param [in] AcpiTableLength Length of the ACPI table.\r
624 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 625**/\r
ee4dc24f
RN
626VOID\r
627EFIAPI\r
628ParseAcpiMadt (\r
629 IN BOOLEAN Trace,\r
630 IN UINT8* Ptr,\r
631 IN UINT32 AcpiTableLength,\r
632 IN UINT8 AcpiTableRevision\r
633 );\r
634\r
a6eaba4d
DB
635/**\r
636 This function parses the ACPI MCFG table.\r
ee4dc24f
RN
637 When trace is enabled this function parses the MCFG table and\r
638 traces the ACPI table fields.\r
639\r
640 This function also performs validation of the ACPI table fields.\r
641\r
642 @param [in] Trace If TRUE, trace the ACPI fields.\r
643 @param [in] Ptr Pointer to the start of the buffer.\r
644 @param [in] AcpiTableLength Length of the ACPI table.\r
645 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 646**/\r
ee4dc24f
RN
647VOID\r
648EFIAPI\r
649ParseAcpiMcfg (\r
650 IN BOOLEAN Trace,\r
651 IN UINT8* Ptr,\r
652 IN UINT32 AcpiTableLength,\r
653 IN UINT8 AcpiTableRevision\r
654 );\r
655\r
d4d2fdf2
KK
656/**\r
657 This function parses the ACPI PPTT table.\r
658 When trace is enabled this function parses the PPTT table and\r
659 traces the ACPI table fields.\r
660\r
661 This function also performs validation of the ACPI table fields.\r
662\r
663 @param [in] Trace If TRUE, trace the ACPI fields.\r
664 @param [in] Ptr Pointer to the start of the buffer.\r
665 @param [in] AcpiTableLength Length of the ACPI table.\r
666 @param [in] AcpiTableRevision Revision of the ACPI table.\r
667**/\r
668VOID\r
669EFIAPI\r
670ParseAcpiPptt (\r
671 IN BOOLEAN Trace,\r
672 IN UINT8* Ptr,\r
673 IN UINT32 AcpiTableLength,\r
674 IN UINT8 AcpiTableRevision\r
675 );\r
676\r
a6eaba4d
DB
677/**\r
678 This function parses the ACPI RSDP table.\r
ee4dc24f
RN
679\r
680 This function invokes the parser for the XSDT table.\r
681 * Note - This function does not support parsing of RSDT table.\r
682\r
683 This function also performs a RAW dump of the ACPI table and\r
684 validates the checksum.\r
685\r
686 @param [in] Trace If TRUE, trace the ACPI fields.\r
687 @param [in] Ptr Pointer to the start of the buffer.\r
688 @param [in] AcpiTableLength Length of the ACPI table.\r
689 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 690**/\r
ee4dc24f
RN
691VOID\r
692EFIAPI\r
693ParseAcpiRsdp (\r
694 IN BOOLEAN Trace,\r
695 IN UINT8* Ptr,\r
696 IN UINT32 AcpiTableLength,\r
697 IN UINT8 AcpiTableRevision\r
698 );\r
699\r
a6eaba4d
DB
700/**\r
701 This function parses the ACPI SLIT table.\r
ee4dc24f
RN
702 When trace is enabled this function parses the SLIT table and\r
703 traces the ACPI table fields.\r
704\r
705 This function also validates System Localities for the following:\r
706 - Diagonal elements have a normalized value of 10\r
707 - Relative distance from System Locality at i*N+j is same as\r
708 j*N+i\r
709\r
710 @param [in] Trace If TRUE, trace the ACPI fields.\r
711 @param [in] Ptr Pointer to the start of the buffer.\r
712 @param [in] AcpiTableLength Length of the ACPI table.\r
713 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 714**/\r
ee4dc24f
RN
715VOID\r
716EFIAPI\r
717ParseAcpiSlit (\r
718 IN BOOLEAN Trace,\r
719 IN UINT8* Ptr,\r
720 IN UINT32 AcpiTableLength,\r
721 IN UINT8 AcpiTableRevision\r
722 );\r
723\r
a6eaba4d
DB
724/**\r
725 This function parses the ACPI SPCR table.\r
ee4dc24f
RN
726 When trace is enabled this function parses the SPCR table and\r
727 traces the ACPI table fields.\r
728\r
729 This function also performs validations of the ACPI table fields.\r
730\r
731 @param [in] Trace If TRUE, trace the ACPI fields.\r
732 @param [in] Ptr Pointer to the start of the buffer.\r
733 @param [in] AcpiTableLength Length of the ACPI table.\r
734 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 735**/\r
ee4dc24f
RN
736VOID\r
737EFIAPI\r
738ParseAcpiSpcr (\r
739 IN BOOLEAN Trace,\r
740 IN UINT8* Ptr,\r
741 IN UINT32 AcpiTableLength,\r
742 IN UINT8 AcpiTableRevision\r
743 );\r
744\r
a6eaba4d
DB
745/**\r
746 This function parses the ACPI SRAT table.\r
ee4dc24f
RN
747 When trace is enabled this function parses the SRAT table and\r
748 traces the ACPI table fields.\r
749\r
750 This function parses the following Resource Allocation Structures:\r
751 - Processor Local APIC/SAPIC Affinity Structure\r
752 - Memory Affinity Structure\r
753 - Processor Local x2APIC Affinity Structure\r
754 - GICC Affinity Structure\r
755\r
756 This function also performs validation of the ACPI table fields.\r
757\r
758 @param [in] Trace If TRUE, trace the ACPI fields.\r
759 @param [in] Ptr Pointer to the start of the buffer.\r
760 @param [in] AcpiTableLength Length of the ACPI table.\r
761 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 762**/\r
ee4dc24f
RN
763VOID\r
764EFIAPI\r
765ParseAcpiSrat (\r
766 IN BOOLEAN Trace,\r
767 IN UINT8* Ptr,\r
768 IN UINT32 AcpiTableLength,\r
769 IN UINT8 AcpiTableRevision\r
770 );\r
771\r
a6eaba4d
DB
772/**\r
773 This function parses the ACPI SSDT table.\r
ee4dc24f
RN
774 When trace is enabled this function parses the SSDT table and\r
775 traces the ACPI table fields.\r
776 For the SSDT table only the ACPI header fields are\r
777 parsed and traced.\r
778\r
779 @param [in] Trace If TRUE, trace the ACPI fields.\r
780 @param [in] Ptr Pointer to the start of the buffer.\r
781 @param [in] AcpiTableLength Length of the ACPI table.\r
782 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 783**/\r
ee4dc24f
RN
784VOID\r
785EFIAPI\r
786ParseAcpiSsdt (\r
787 IN BOOLEAN Trace,\r
788 IN UINT8* Ptr,\r
789 IN UINT32 AcpiTableLength,\r
790 IN UINT8 AcpiTableRevision\r
791 );\r
792\r
a6eaba4d
DB
793/**\r
794 This function parses the ACPI XSDT table\r
ee4dc24f
RN
795 and optionally traces the ACPI table fields.\r
796\r
797 This function also performs validation of the XSDT table.\r
798\r
799 @param [in] Trace If TRUE, trace the ACPI fields.\r
800 @param [in] Ptr Pointer to the start of the buffer.\r
801 @param [in] AcpiTableLength Length of the ACPI table.\r
802 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 803**/\r
ee4dc24f
RN
804VOID\r
805EFIAPI\r
806ParseAcpiXsdt (\r
807 IN BOOLEAN Trace,\r
808 IN UINT8* Ptr,\r
809 IN UINT32 AcpiTableLength,\r
810 IN UINT8 AcpiTableRevision\r
811 );\r
812\r
813#endif // ACPIPARSER_H_\r