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