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