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