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