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