]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
ShellPkg: acpiview: Remove duplicate ACPI structure size definitions
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / AcpiParser.h
CommitLineData
a6eaba4d 1/** @file\r
ee4dc24f
RN
2 Header file for ACPI parser\r
3\r
0b9026a8 4 Copyright (c) 2016 - 2020, 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
710ff749
KK
187/**\r
188 This function traces 12 characters which can be optionally\r
189 formated using the format string if specified.\r
190\r
191 If no format string is specified the Format must be NULL.\r
192\r
193 @param [in] Format Optional format string for tracing the data.\r
194 @param [in] Ptr Pointer to the start of the buffer.\r
195**/\r
196VOID\r
197EFIAPI\r
198Dump12Chars (\r
199 IN CONST CHAR16* Format OPTIONAL,\r
200 IN UINT8* Ptr\r
201 );\r
202\r
a6eaba4d
DB
203/**\r
204 This function indents and prints the ACPI table Field Name.\r
ee4dc24f
RN
205\r
206 @param [in] Indent Number of spaces to add to the global table\r
207 indent. The global table indent is 0 by default;\r
208 however this value is updated on entry to the\r
209 ParseAcpi() by adding the indent value provided to\r
210 ParseAcpi() and restored back on exit. Therefore\r
211 the total indent in the output is dependent on from\r
212 where this function is called.\r
213 @param [in] FieldName Pointer to the Field Name.\r
a6eaba4d 214**/\r
ee4dc24f
RN
215VOID\r
216EFIAPI\r
217PrintFieldName (\r
218 IN UINT32 Indent,\r
219 IN CONST CHAR16* FieldName\r
a6eaba4d 220 );\r
ee4dc24f 221\r
a6eaba4d
DB
222/**\r
223 This function pointer is the template for customizing the trace output\r
ee4dc24f
RN
224\r
225 @param [in] Format Format string for tracing the data as specified by\r
226 the 'Format' member of ACPI_PARSER.\r
227 @param [in] Ptr Pointer to the start of the buffer.\r
a6eaba4d 228**/\r
ee4dc24f
RN
229typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR16* Format, UINT8* Ptr);\r
230\r
a6eaba4d
DB
231/**\r
232 This function pointer is the template for validating an ACPI table field.\r
ee4dc24f
RN
233\r
234 @param [in] Ptr Pointer to the start of the field data.\r
235 @param [in] Context Pointer to context specific information as specified by\r
236 the 'Context' member of the ACPI_PARSER.\r
237 e.g. this could be a pointer to the ACPI table header.\r
a6eaba4d 238**/\r
ee4dc24f
RN
239typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* Ptr, VOID* Context);\r
240\r
a6eaba4d
DB
241/**\r
242 The ACPI_PARSER structure describes the fields of an ACPI table and\r
243 provides means for the parser to interpret and trace appropriately.\r
ee4dc24f
RN
244\r
245 The first three members are populated based on information present in\r
246 in the ACPI table specifications. The remaining members describe how\r
247 the parser should report the field information, validate the field data\r
248 and/or update an external pointer to the field (ItemPtr).\r
249\r
250 ParseAcpi() uses the format string specified by 'Format' for tracing\r
251 the field data. If the field is more complex and requires additional\r
252 processing for formatting and representation a print formatter function\r
253 can be specified in 'PrintFormatter'.\r
254 The PrintFormatter function may choose to use the format string\r
255 specified by 'Format' or use its own internal format string.\r
256\r
257 The 'Format' and 'PrintFormatter' members allow flexibility for\r
258 representing the field data.\r
a6eaba4d 259**/\r
ee4dc24f
RN
260typedef struct AcpiParser {\r
261\r
262 /// String describing the ACPI table field\r
263 /// (Field column from ACPI table spec)\r
264 CONST CHAR16* NameStr;\r
265\r
266 /// The length of the field.\r
267 /// (Byte Length column from ACPI table spec)\r
268 UINT32 Length;\r
269\r
270 /// The offset of the field from the start of the table.\r
271 /// (Byte Offset column from ACPI table spec)\r
272 UINT32 Offset;\r
273\r
274 /// Optional Print() style format string for tracing the data. If not\r
275 /// used this must be set to NULL.\r
276 CONST CHAR16* Format;\r
277\r
278 /// Optional pointer to a print formatter function which\r
279 /// is typically used to trace complex field information.\r
280 /// If not used this must be set to NULL.\r
281 /// The Format string is passed to the PrintFormatter function\r
282 /// but may be ignored by the implementation code.\r
283 FNPTR_PRINT_FORMATTER PrintFormatter;\r
284\r
285 /// Optional pointer which may be set to request the parser to update\r
286 /// a pointer to the field data. If unused this must be set to NULL.\r
287 VOID** ItemPtr;\r
288\r
289 /// Optional pointer to a field validator function.\r
290 /// The function should directly report any appropriate error or warning\r
291 /// and invoke the appropriate counter update function.\r
292 /// If not used this parameter must be set to NULL.\r
293 FNPTR_FIELD_VALIDATOR FieldValidator;\r
294\r
295 /// Optional pointer to context specific information,\r
296 /// which the Field Validator function can use to determine\r
297 /// additional information about the ACPI table and make\r
298 /// decisions about the field being validated.\r
299 /// e.g. this could be a pointer to the ACPI table header\r
300 VOID* Context;\r
301} ACPI_PARSER;\r
302\r
a6eaba4d
DB
303/**\r
304 A structure used to store the pointers to the members of the\r
305 ACPI description header structure that was parsed.\r
306**/\r
ee4dc24f
RN
307typedef struct AcpiDescriptionHeaderInfo {\r
308 /// ACPI table signature\r
309 UINT32* Signature;\r
310 /// Length of the ACPI table\r
311 UINT32* Length;\r
312 /// Revision\r
313 UINT8* Revision;\r
314 /// Checksum\r
315 UINT8* Checksum;\r
316 /// OEM Id - length is 6 bytes\r
317 UINT8* OemId;\r
318 /// OEM table Id\r
319 UINT64* OemTableId;\r
320 /// OEM revision Id\r
321 UINT32* OemRevision;\r
322 /// Creator Id\r
323 UINT32* CreatorId;\r
324 /// Creator revision\r
325 UINT32* CreatorRevision;\r
326} ACPI_DESCRIPTION_HEADER_INFO;\r
327\r
a6eaba4d
DB
328/**\r
329 This function is used to parse an ACPI table buffer.\r
ee4dc24f
RN
330\r
331 The ACPI table buffer is parsed using the ACPI table parser information\r
332 specified by a pointer to an array of ACPI_PARSER elements. This parser\r
333 function iterates through each item on the ACPI_PARSER array and logs the\r
334 ACPI table fields.\r
335\r
336 This function can optionally be used to parse ACPI tables and fetch specific\r
337 field values. The ItemPtr member of the ACPI_PARSER structure (where used)\r
338 is updated by this parser function to point to the selected field data\r
339 (e.g. useful for variable length nested fields).\r
340\r
341 @param [in] Trace Trace the ACPI fields TRUE else only parse the\r
342 table.\r
343 @param [in] Indent Number of spaces to indent the output.\r
344 @param [in] AsciiName Optional pointer to an ASCII string that describes\r
345 the table being parsed.\r
346 @param [in] Ptr Pointer to the start of the buffer.\r
347 @param [in] Length Length of the buffer pointed by Ptr.\r
348 @param [in] Parser Pointer to an array of ACPI_PARSER structure that\r
349 describes the table being parsed.\r
350 @param [in] ParserItems Number of items in the ACPI_PARSER array.\r
351\r
352 @retval Number of bytes parsed.\r
a6eaba4d 353**/\r
ee4dc24f
RN
354UINT32\r
355EFIAPI\r
356ParseAcpi (\r
357 IN BOOLEAN Trace,\r
358 IN UINT32 Indent,\r
359 IN CONST CHAR8* AsciiName OPTIONAL,\r
360 IN UINT8* Ptr,\r
361 IN UINT32 Length,\r
362 IN CONST ACPI_PARSER* Parser,\r
363 IN UINT32 ParserItems\r
a6eaba4d 364 );\r
ee4dc24f 365\r
a6eaba4d
DB
366/**\r
367 This is a helper macro to pass parameters to the Parser functions.\r
ee4dc24f
RN
368\r
369 @param [in] Parser The name of the ACPI_PARSER array describing the\r
370 ACPI table fields.\r
a6eaba4d 371**/\r
ee4dc24f
RN
372#define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0])\r
373\r
a6eaba4d
DB
374/**\r
375 This is a helper macro for describing the ACPI header fields.\r
ee4dc24f
RN
376\r
377 @param [out] Info Pointer to retrieve the ACPI table header information.\r
a6eaba4d 378**/\r
ee4dc24f
RN
379#define PARSE_ACPI_HEADER(Info) \\r
380 { L"Signature", 4, 0, NULL, Dump4Chars, \\r
381 (VOID**)&(Info)->Signature , NULL, NULL }, \\r
382 { L"Length", 4, 4, L"%d", NULL, \\r
383 (VOID**)&(Info)->Length, NULL, NULL }, \\r
384 { L"Revision", 1, 8, L"%d", NULL, \\r
385 (VOID**)&(Info)->Revision, NULL, NULL }, \\r
386 { L"Checksum", 1, 9, L"0x%X", NULL, \\r
387 (VOID**)&(Info)->Checksum, NULL, NULL }, \\r
388 { L"Oem ID", 6, 10, NULL, Dump6Chars, \\r
389 (VOID**)&(Info)->OemId, NULL, NULL }, \\r
390 { L"Oem Table ID", 8, 16, NULL, Dump8Chars, \\r
391 (VOID**)&(Info)->OemTableId, NULL, NULL }, \\r
392 { L"Oem Revision", 4, 24, L"0x%X", NULL, \\r
393 (VOID**)&(Info)->OemRevision, NULL, NULL }, \\r
394 { L"Creator ID", 4, 28, NULL, Dump4Chars, \\r
395 (VOID**)&(Info)->CreatorId, NULL, NULL }, \\r
396 { L"Creator Revision", 4, 32, L"0x%X", NULL, \\r
397 (VOID**)&(Info)->CreatorRevision, NULL, NULL }\r
398\r
a6eaba4d
DB
399/**\r
400 This function indents and traces the GAS structure as described by the GasParser.\r
ee4dc24f
RN
401\r
402 @param [in] Ptr Pointer to the start of the buffer.\r
403 @param [in] Indent Number of spaces to indent the output.\r
58cc0ffe
KK
404 @param [in] Length Length of the GAS structure buffer.\r
405\r
406 @retval Number of bytes parsed.\r
a6eaba4d 407**/\r
58cc0ffe 408UINT32\r
ee4dc24f
RN
409EFIAPI\r
410DumpGasStruct (\r
411 IN UINT8* Ptr,\r
58cc0ffe
KK
412 IN UINT32 Indent,\r
413 IN UINT32 Length\r
ee4dc24f
RN
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
d5cf0fba
SM
527/**\r
528 This function parses the ACPI FACS table.\r
529 When trace is enabled this function parses the FACS table and\r
530 traces the ACPI 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
538**/\r
539VOID\r
540EFIAPI\r
541ParseAcpiFacs (\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 FADT table.\r
ee4dc24f
RN
550 This function parses the FADT table and optionally traces the ACPI\r
551 table fields.\r
552\r
553 This function also performs validation of the ACPI table fields.\r
554\r
555 @param [in] Trace If TRUE, trace the ACPI fields.\r
556 @param [in] Ptr Pointer to the start of the buffer.\r
557 @param [in] AcpiTableLength Length of the ACPI table.\r
558 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 559**/\r
ee4dc24f
RN
560VOID\r
561EFIAPI\r
562ParseAcpiFadt (\r
563 IN BOOLEAN Trace,\r
564 IN UINT8* Ptr,\r
565 IN UINT32 AcpiTableLength,\r
566 IN UINT8 AcpiTableRevision\r
567 );\r
568\r
a6eaba4d
DB
569/**\r
570 This function parses the ACPI GTDT table.\r
ee4dc24f
RN
571 When trace is enabled this function parses the GTDT table and\r
572 traces the ACPI table fields.\r
573\r
574 This function also parses the following platform timer structures:\r
575 - GT Block timer\r
576 - Watchdog timer\r
577\r
578 This function also performs validation of the ACPI table fields.\r
579\r
580 @param [in] Trace If TRUE, trace the ACPI fields.\r
581 @param [in] Ptr Pointer to the start of the buffer.\r
582 @param [in] AcpiTableLength Length of the ACPI table.\r
583 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 584**/\r
ee4dc24f
RN
585VOID\r
586EFIAPI\r
587ParseAcpiGtdt (\r
588 IN BOOLEAN Trace,\r
589 IN UINT8* Ptr,\r
590 IN UINT32 AcpiTableLength,\r
591 IN UINT8 AcpiTableRevision\r
592 );\r
593\r
a6eaba4d
DB
594/**\r
595 This function parses the ACPI IORT table.\r
ee4dc24f
RN
596 When trace is enabled this function parses the IORT table and\r
597 traces the ACPI fields.\r
598\r
599 This function also parses the following nodes:\r
600 - ITS Group\r
601 - Named Component\r
602 - Root Complex\r
603 - SMMUv1/2\r
604 - SMMUv3\r
605 - PMCG\r
606\r
607 This function also performs validation of the ACPI table fields.\r
608\r
609 @param [in] Trace If TRUE, trace the ACPI fields.\r
610 @param [in] Ptr Pointer to the start of the buffer.\r
611 @param [in] AcpiTableLength Length of the ACPI table.\r
612 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 613**/\r
ee4dc24f
RN
614VOID\r
615EFIAPI\r
616ParseAcpiIort (\r
617 IN BOOLEAN Trace,\r
618 IN UINT8* Ptr,\r
619 IN UINT32 AcpiTableLength,\r
620 IN UINT8 AcpiTableRevision\r
621 );\r
622\r
a6eaba4d
DB
623/**\r
624 This function parses the ACPI MADT table.\r
ee4dc24f
RN
625 When trace is enabled this function parses the MADT table and\r
626 traces the ACPI table fields.\r
627\r
628 This function currently parses the following Interrupt Controller\r
629 Structures:\r
630 - GICC\r
631 - GICD\r
632 - GIC MSI Frame\r
633 - GICR\r
634 - GIC ITS\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
645ParseAcpiMadt (\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
a6eaba4d
DB
652/**\r
653 This function parses the ACPI MCFG table.\r
ee4dc24f
RN
654 When trace is enabled this function parses the MCFG 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
a6eaba4d 663**/\r
ee4dc24f
RN
664VOID\r
665EFIAPI\r
666ParseAcpiMcfg (\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
d4d2fdf2
KK
673/**\r
674 This function parses the ACPI PPTT table.\r
675 When trace is enabled this function parses the PPTT table and\r
676 traces the ACPI table fields.\r
677\r
678 This function also performs validation of the ACPI table fields.\r
679\r
680 @param [in] Trace If TRUE, trace the ACPI fields.\r
681 @param [in] Ptr Pointer to the start of the buffer.\r
682 @param [in] AcpiTableLength Length of the ACPI table.\r
683 @param [in] AcpiTableRevision Revision of the ACPI table.\r
684**/\r
685VOID\r
686EFIAPI\r
687ParseAcpiPptt (\r
688 IN BOOLEAN Trace,\r
689 IN UINT8* Ptr,\r
690 IN UINT32 AcpiTableLength,\r
691 IN UINT8 AcpiTableRevision\r
692 );\r
693\r
a6eaba4d
DB
694/**\r
695 This function parses the ACPI RSDP table.\r
ee4dc24f
RN
696\r
697 This function invokes the parser for the XSDT table.\r
698 * Note - This function does not support parsing of RSDT table.\r
699\r
700 This function also performs a RAW dump of the ACPI table and\r
701 validates the checksum.\r
702\r
703 @param [in] Trace If TRUE, trace the ACPI fields.\r
704 @param [in] Ptr Pointer to the start of the buffer.\r
705 @param [in] AcpiTableLength Length of the ACPI table.\r
706 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 707**/\r
ee4dc24f
RN
708VOID\r
709EFIAPI\r
710ParseAcpiRsdp (\r
711 IN BOOLEAN Trace,\r
712 IN UINT8* Ptr,\r
713 IN UINT32 AcpiTableLength,\r
714 IN UINT8 AcpiTableRevision\r
715 );\r
716\r
a6eaba4d
DB
717/**\r
718 This function parses the ACPI SLIT table.\r
ee4dc24f
RN
719 When trace is enabled this function parses the SLIT table and\r
720 traces the ACPI table fields.\r
721\r
722 This function also validates System Localities for the following:\r
723 - Diagonal elements have a normalized value of 10\r
724 - Relative distance from System Locality at i*N+j is same as\r
725 j*N+i\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
734ParseAcpiSlit (\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 SPCR table.\r
ee4dc24f
RN
743 When trace is enabled this function parses the SPCR table and\r
744 traces the ACPI table fields.\r
745\r
746 This function also performs validations of the ACPI table fields.\r
747\r
748 @param [in] Trace If TRUE, trace the ACPI fields.\r
749 @param [in] Ptr Pointer to the start of the buffer.\r
750 @param [in] AcpiTableLength Length of the ACPI table.\r
751 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 752**/\r
ee4dc24f
RN
753VOID\r
754EFIAPI\r
755ParseAcpiSpcr (\r
756 IN BOOLEAN Trace,\r
757 IN UINT8* Ptr,\r
758 IN UINT32 AcpiTableLength,\r
759 IN UINT8 AcpiTableRevision\r
760 );\r
761\r
a6eaba4d
DB
762/**\r
763 This function parses the ACPI SRAT table.\r
ee4dc24f
RN
764 When trace is enabled this function parses the SRAT table and\r
765 traces the ACPI table fields.\r
766\r
767 This function parses the following Resource Allocation Structures:\r
768 - Processor Local APIC/SAPIC Affinity Structure\r
769 - Memory Affinity Structure\r
770 - Processor Local x2APIC Affinity Structure\r
771 - GICC Affinity Structure\r
772\r
773 This function also performs validation of the ACPI table fields.\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
782ParseAcpiSrat (\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 SSDT table.\r
ee4dc24f
RN
791 When trace is enabled this function parses the SSDT table and\r
792 traces the ACPI table fields.\r
793 For the SSDT table only the ACPI header fields are\r
794 parsed and traced.\r
795\r
796 @param [in] Trace If TRUE, trace the ACPI fields.\r
797 @param [in] Ptr Pointer to the start of the buffer.\r
798 @param [in] AcpiTableLength Length of the ACPI table.\r
799 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 800**/\r
ee4dc24f
RN
801VOID\r
802EFIAPI\r
803ParseAcpiSsdt (\r
804 IN BOOLEAN Trace,\r
805 IN UINT8* Ptr,\r
806 IN UINT32 AcpiTableLength,\r
807 IN UINT8 AcpiTableRevision\r
808 );\r
809\r
a6eaba4d
DB
810/**\r
811 This function parses the ACPI XSDT table\r
ee4dc24f
RN
812 and optionally traces the ACPI table fields.\r
813\r
814 This function also performs validation of the XSDT table.\r
815\r
816 @param [in] Trace If TRUE, trace the ACPI fields.\r
817 @param [in] Ptr Pointer to the start of the buffer.\r
818 @param [in] AcpiTableLength Length of the ACPI table.\r
819 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 820**/\r
ee4dc24f
RN
821VOID\r
822EFIAPI\r
823ParseAcpiXsdt (\r
824 IN BOOLEAN Trace,\r
825 IN UINT8* Ptr,\r
826 IN UINT32 AcpiTableLength,\r
827 IN UINT8 AcpiTableRevision\r
828 );\r
829\r
830#endif // ACPIPARSER_H_\r