]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
6deee3542e09bc18b03fdd18dece5b6f9725839c
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / AcpiParser.h
1 /** @file
2 Header file for ACPI parser
3
4 Copyright (c) 2016 - 2019, 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
262 /// String describing the ACPI table field
263 /// (Field column from ACPI table spec)
264 CONST CHAR16* NameStr;
265
266 /// The length of the field.
267 /// (Byte Length column from ACPI table spec)
268 UINT32 Length;
269
270 /// The offset of the field from the start of the table.
271 /// (Byte Offset column from ACPI table spec)
272 UINT32 Offset;
273
274 /// Optional Print() style format string for tracing the data. If not
275 /// used this must be set to NULL.
276 CONST CHAR16* Format;
277
278 /// Optional pointer to a print formatter function which
279 /// is typically used to trace complex field information.
280 /// If not used this must be set to NULL.
281 /// The Format string is passed to the PrintFormatter function
282 /// but may be ignored by the implementation code.
283 FNPTR_PRINT_FORMATTER PrintFormatter;
284
285 /// Optional pointer which may be set to request the parser to update
286 /// a pointer to the field data. If unused this must be set to NULL.
287 VOID** ItemPtr;
288
289 /// Optional pointer to a field validator function.
290 /// The function should directly report any appropriate error or warning
291 /// and invoke the appropriate counter update function.
292 /// If not used this parameter must be set to NULL.
293 FNPTR_FIELD_VALIDATOR FieldValidator;
294
295 /// Optional pointer to context specific information,
296 /// which the Field Validator function can use to determine
297 /// additional information about the ACPI table and make
298 /// decisions about the field being validated.
299 /// e.g. this could be a pointer to the ACPI table header
300 VOID* Context;
301 } ACPI_PARSER;
302
303 /**
304 A structure used to store the pointers to the members of the
305 ACPI description header structure that was parsed.
306 **/
307 typedef struct AcpiDescriptionHeaderInfo {
308 /// ACPI table signature
309 UINT32* Signature;
310 /// Length of the ACPI table
311 UINT32* Length;
312 /// Revision
313 UINT8* Revision;
314 /// Checksum
315 UINT8* Checksum;
316 /// OEM Id - length is 6 bytes
317 UINT8* OemId;
318 /// OEM table Id
319 UINT64* OemTableId;
320 /// OEM revision Id
321 UINT32* OemRevision;
322 /// Creator Id
323 UINT32* CreatorId;
324 /// Creator revision
325 UINT32* CreatorRevision;
326 } ACPI_DESCRIPTION_HEADER_INFO;
327
328 /**
329 This function is used to parse an ACPI table buffer.
330
331 The ACPI table buffer is parsed using the ACPI table parser information
332 specified by a pointer to an array of ACPI_PARSER elements. This parser
333 function iterates through each item on the ACPI_PARSER array and logs the
334 ACPI table fields.
335
336 This function can optionally be used to parse ACPI tables and fetch specific
337 field values. The ItemPtr member of the ACPI_PARSER structure (where used)
338 is updated by this parser function to point to the selected field data
339 (e.g. useful for variable length nested fields).
340
341 @param [in] Trace Trace the ACPI fields TRUE else only parse the
342 table.
343 @param [in] Indent Number of spaces to indent the output.
344 @param [in] AsciiName Optional pointer to an ASCII string that describes
345 the table being parsed.
346 @param [in] Ptr Pointer to the start of the buffer.
347 @param [in] Length Length of the buffer pointed by Ptr.
348 @param [in] Parser Pointer to an array of ACPI_PARSER structure that
349 describes the table being parsed.
350 @param [in] ParserItems Number of items in the ACPI_PARSER array.
351
352 @retval Number of bytes parsed.
353 **/
354 UINT32
355 EFIAPI
356 ParseAcpi (
357 IN BOOLEAN Trace,
358 IN UINT32 Indent,
359 IN CONST CHAR8* AsciiName OPTIONAL,
360 IN UINT8* Ptr,
361 IN UINT32 Length,
362 IN CONST ACPI_PARSER* Parser,
363 IN UINT32 ParserItems
364 );
365
366 /**
367 This is a helper macro to pass parameters to the Parser functions.
368
369 @param [in] Parser The name of the ACPI_PARSER array describing the
370 ACPI table fields.
371 **/
372 #define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0])
373
374 /**
375 This is a helper macro for describing the ACPI header fields.
376
377 @param [out] Info Pointer to retrieve the ACPI table header information.
378 **/
379 #define PARSE_ACPI_HEADER(Info) \
380 { L"Signature", 4, 0, NULL, Dump4Chars, \
381 (VOID**)&(Info)->Signature , NULL, NULL }, \
382 { L"Length", 4, 4, L"%d", NULL, \
383 (VOID**)&(Info)->Length, NULL, NULL }, \
384 { L"Revision", 1, 8, L"%d", NULL, \
385 (VOID**)&(Info)->Revision, NULL, NULL }, \
386 { L"Checksum", 1, 9, L"0x%X", NULL, \
387 (VOID**)&(Info)->Checksum, NULL, NULL }, \
388 { L"Oem ID", 6, 10, NULL, Dump6Chars, \
389 (VOID**)&(Info)->OemId, NULL, NULL }, \
390 { L"Oem Table ID", 8, 16, NULL, Dump8Chars, \
391 (VOID**)&(Info)->OemTableId, NULL, NULL }, \
392 { L"Oem Revision", 4, 24, L"0x%X", NULL, \
393 (VOID**)&(Info)->OemRevision, NULL, NULL }, \
394 { L"Creator ID", 4, 28, NULL, Dump4Chars, \
395 (VOID**)&(Info)->CreatorId, NULL, NULL }, \
396 { L"Creator Revision", 4, 32, L"0x%X", NULL, \
397 (VOID**)&(Info)->CreatorRevision, NULL, NULL }
398
399 /**
400 Length of the ACPI GAS structure.
401
402 NOTE: This might normally be defined as
403 sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE).
404 However, we deliberately minimise any reference to the EDK2 ACPI
405 headers in an attempt to provide cross checking.
406 **/
407 #define GAS_LENGTH 12
408
409 /**
410 Length of the ACPI Header structure.
411
412 NOTE: This might normally be defined as
413 sizeof (EFI_ACPI_DESCRIPTION_HEADER).
414 However, we deliberately minimise any reference to the EDK2 ACPI
415 headers in an attempt to provide cross checking.
416 **/
417 #define ACPI_DESCRIPTION_HEADER_LENGTH 36
418
419 /**
420 This function indents and traces the GAS structure as described by the GasParser.
421
422 @param [in] Ptr Pointer to the start of the buffer.
423 @param [in] Indent Number of spaces to indent the output.
424 @param [in] Length Length of the GAS structure buffer.
425
426 @retval Number of bytes parsed.
427 **/
428 UINT32
429 EFIAPI
430 DumpGasStruct (
431 IN UINT8* Ptr,
432 IN UINT32 Indent,
433 IN UINT32 Length
434 );
435
436 /**
437 This function traces the GAS structure as described by the GasParser.
438
439 @param [in] Format Optional format string for tracing the data.
440 @param [in] Ptr Pointer to the start of the buffer.
441 **/
442 VOID
443 EFIAPI
444 DumpGas (
445 IN CONST CHAR16* Format OPTIONAL,
446 IN UINT8* Ptr
447 );
448
449 /**
450 This function traces the ACPI header as described by the AcpiHeaderParser.
451
452 @param [in] Ptr Pointer to the start of the buffer.
453
454 @retval Number of bytes parsed.
455 **/
456 UINT32
457 EFIAPI
458 DumpAcpiHeader (
459 IN UINT8* Ptr
460 );
461
462 /**
463 This function parses the ACPI header as described by the AcpiHeaderParser.
464
465 This function optionally returns the Signature, Length and revision of the
466 ACPI table.
467
468 @param [in] Ptr Pointer to the start of the buffer.
469 @param [out] Signature Gets location of the ACPI table signature.
470 @param [out] Length Gets location of the length of the ACPI table.
471 @param [out] Revision Gets location of the revision of the ACPI table.
472
473 @retval Number of bytes parsed.
474 **/
475 UINT32
476 EFIAPI
477 ParseAcpiHeader (
478 IN UINT8* Ptr,
479 OUT CONST UINT32** Signature,
480 OUT CONST UINT32** Length,
481 OUT CONST UINT8** Revision
482 );
483
484 /**
485 This function parses the ACPI BGRT table.
486 When trace is enabled this function parses the BGRT table and
487 traces the ACPI table fields.
488
489 This function also performs validation of the ACPI table fields.
490
491 @param [in] Trace If TRUE, trace the ACPI fields.
492 @param [in] Ptr Pointer to the start of the buffer.
493 @param [in] AcpiTableLength Length of the ACPI table.
494 @param [in] AcpiTableRevision Revision of the ACPI table.
495 **/
496 VOID
497 EFIAPI
498 ParseAcpiBgrt (
499 IN BOOLEAN Trace,
500 IN UINT8* Ptr,
501 IN UINT32 AcpiTableLength,
502 IN UINT8 AcpiTableRevision
503 );
504
505 /**
506 This function parses the ACPI DBG2 table.
507 When trace is enabled this function parses the DBG2 table and
508 traces the ACPI table fields.
509
510 This function also performs validation of the ACPI table fields.
511
512 @param [in] Trace If TRUE, trace the ACPI fields.
513 @param [in] Ptr Pointer to the start of the buffer.
514 @param [in] AcpiTableLength Length of the ACPI table.
515 @param [in] AcpiTableRevision Revision of the ACPI table.
516 **/
517 VOID
518 EFIAPI
519 ParseAcpiDbg2 (
520 IN BOOLEAN Trace,
521 IN UINT8* Ptr,
522 IN UINT32 AcpiTableLength,
523 IN UINT8 AcpiTableRevision
524 );
525
526 /**
527 This function parses the ACPI DSDT table.
528 When trace is enabled this function parses the DSDT table and
529 traces the ACPI table fields.
530 For the DSDT table only the ACPI header fields are parsed and
531 traced.
532
533 @param [in] Trace If TRUE, trace the ACPI fields.
534 @param [in] Ptr Pointer to the start of the buffer.
535 @param [in] AcpiTableLength Length of the ACPI table.
536 @param [in] AcpiTableRevision Revision of the ACPI table.
537 **/
538 VOID
539 EFIAPI
540 ParseAcpiDsdt (
541 IN BOOLEAN Trace,
542 IN UINT8* Ptr,
543 IN UINT32 AcpiTableLength,
544 IN UINT8 AcpiTableRevision
545 );
546
547 /**
548 This function parses the ACPI FACS table.
549 When trace is enabled this function parses the FACS table and
550 traces the ACPI table fields.
551
552 This function also performs validation of the ACPI table fields.
553
554 @param [in] Trace If TRUE, trace the ACPI fields.
555 @param [in] Ptr Pointer to the start of the buffer.
556 @param [in] AcpiTableLength Length of the ACPI table.
557 @param [in] AcpiTableRevision Revision of the ACPI table.
558 **/
559 VOID
560 EFIAPI
561 ParseAcpiFacs (
562 IN BOOLEAN Trace,
563 IN UINT8* Ptr,
564 IN UINT32 AcpiTableLength,
565 IN UINT8 AcpiTableRevision
566 );
567
568 /**
569 This function parses the ACPI FADT table.
570 This function parses the FADT table and optionally traces the ACPI
571 table fields.
572
573 This function also performs validation of the ACPI table fields.
574
575 @param [in] Trace If TRUE, trace the ACPI fields.
576 @param [in] Ptr Pointer to the start of the buffer.
577 @param [in] AcpiTableLength Length of the ACPI table.
578 @param [in] AcpiTableRevision Revision of the ACPI table.
579 **/
580 VOID
581 EFIAPI
582 ParseAcpiFadt (
583 IN BOOLEAN Trace,
584 IN UINT8* Ptr,
585 IN UINT32 AcpiTableLength,
586 IN UINT8 AcpiTableRevision
587 );
588
589 /**
590 This function parses the ACPI GTDT table.
591 When trace is enabled this function parses the GTDT table and
592 traces the ACPI table fields.
593
594 This function also parses the following platform timer structures:
595 - GT Block timer
596 - Watchdog timer
597
598 This function also performs validation of the ACPI table fields.
599
600 @param [in] Trace If TRUE, trace the ACPI fields.
601 @param [in] Ptr Pointer to the start of the buffer.
602 @param [in] AcpiTableLength Length of the ACPI table.
603 @param [in] AcpiTableRevision Revision of the ACPI table.
604 **/
605 VOID
606 EFIAPI
607 ParseAcpiGtdt (
608 IN BOOLEAN Trace,
609 IN UINT8* Ptr,
610 IN UINT32 AcpiTableLength,
611 IN UINT8 AcpiTableRevision
612 );
613
614 /**
615 This function parses the ACPI IORT table.
616 When trace is enabled this function parses the IORT table and
617 traces the ACPI fields.
618
619 This function also parses the following nodes:
620 - ITS Group
621 - Named Component
622 - Root Complex
623 - SMMUv1/2
624 - SMMUv3
625 - PMCG
626
627 This function also performs validation of the ACPI table fields.
628
629 @param [in] Trace If TRUE, trace the ACPI fields.
630 @param [in] Ptr Pointer to the start of the buffer.
631 @param [in] AcpiTableLength Length of the ACPI table.
632 @param [in] AcpiTableRevision Revision of the ACPI table.
633 **/
634 VOID
635 EFIAPI
636 ParseAcpiIort (
637 IN BOOLEAN Trace,
638 IN UINT8* Ptr,
639 IN UINT32 AcpiTableLength,
640 IN UINT8 AcpiTableRevision
641 );
642
643 /**
644 This function parses the ACPI MADT table.
645 When trace is enabled this function parses the MADT table and
646 traces the ACPI table fields.
647
648 This function currently parses the following Interrupt Controller
649 Structures:
650 - GICC
651 - GICD
652 - GIC MSI Frame
653 - GICR
654 - GIC ITS
655
656 This function also performs validation of the ACPI table fields.
657
658 @param [in] Trace If TRUE, trace the ACPI fields.
659 @param [in] Ptr Pointer to the start of the buffer.
660 @param [in] AcpiTableLength Length of the ACPI table.
661 @param [in] AcpiTableRevision Revision of the ACPI table.
662 **/
663 VOID
664 EFIAPI
665 ParseAcpiMadt (
666 IN BOOLEAN Trace,
667 IN UINT8* Ptr,
668 IN UINT32 AcpiTableLength,
669 IN UINT8 AcpiTableRevision
670 );
671
672 /**
673 This function parses the ACPI MCFG table.
674 When trace is enabled this function parses the MCFG table and
675 traces the ACPI table fields.
676
677 This function also performs validation of the ACPI table fields.
678
679 @param [in] Trace If TRUE, trace the ACPI fields.
680 @param [in] Ptr Pointer to the start of the buffer.
681 @param [in] AcpiTableLength Length of the ACPI table.
682 @param [in] AcpiTableRevision Revision of the ACPI table.
683 **/
684 VOID
685 EFIAPI
686 ParseAcpiMcfg (
687 IN BOOLEAN Trace,
688 IN UINT8* Ptr,
689 IN UINT32 AcpiTableLength,
690 IN UINT8 AcpiTableRevision
691 );
692
693 /**
694 This function parses the ACPI PPTT table.
695 When trace is enabled this function parses the PPTT table and
696 traces the ACPI table fields.
697
698 This function also performs validation of the ACPI table fields.
699
700 @param [in] Trace If TRUE, trace the ACPI fields.
701 @param [in] Ptr Pointer to the start of the buffer.
702 @param [in] AcpiTableLength Length of the ACPI table.
703 @param [in] AcpiTableRevision Revision of the ACPI table.
704 **/
705 VOID
706 EFIAPI
707 ParseAcpiPptt (
708 IN BOOLEAN Trace,
709 IN UINT8* Ptr,
710 IN UINT32 AcpiTableLength,
711 IN UINT8 AcpiTableRevision
712 );
713
714 /**
715 This function parses the ACPI RSDP table.
716
717 This function invokes the parser for the XSDT table.
718 * Note - This function does not support parsing of RSDT table.
719
720 This function also performs a RAW dump of the ACPI table and
721 validates the checksum.
722
723 @param [in] Trace If TRUE, trace the ACPI fields.
724 @param [in] Ptr Pointer to the start of the buffer.
725 @param [in] AcpiTableLength Length of the ACPI table.
726 @param [in] AcpiTableRevision Revision of the ACPI table.
727 **/
728 VOID
729 EFIAPI
730 ParseAcpiRsdp (
731 IN BOOLEAN Trace,
732 IN UINT8* Ptr,
733 IN UINT32 AcpiTableLength,
734 IN UINT8 AcpiTableRevision
735 );
736
737 /**
738 This function parses the ACPI SLIT table.
739 When trace is enabled this function parses the SLIT table and
740 traces the ACPI table fields.
741
742 This function also validates System Localities for the following:
743 - Diagonal elements have a normalized value of 10
744 - Relative distance from System Locality at i*N+j is same as
745 j*N+i
746
747 @param [in] Trace If TRUE, trace the ACPI fields.
748 @param [in] Ptr Pointer to the start of the buffer.
749 @param [in] AcpiTableLength Length of the ACPI table.
750 @param [in] AcpiTableRevision Revision of the ACPI table.
751 **/
752 VOID
753 EFIAPI
754 ParseAcpiSlit (
755 IN BOOLEAN Trace,
756 IN UINT8* Ptr,
757 IN UINT32 AcpiTableLength,
758 IN UINT8 AcpiTableRevision
759 );
760
761 /**
762 This function parses the ACPI SPCR table.
763 When trace is enabled this function parses the SPCR table and
764 traces the ACPI table fields.
765
766 This function also performs validations of the ACPI table fields.
767
768 @param [in] Trace If TRUE, trace the ACPI fields.
769 @param [in] Ptr Pointer to the start of the buffer.
770 @param [in] AcpiTableLength Length of the ACPI table.
771 @param [in] AcpiTableRevision Revision of the ACPI table.
772 **/
773 VOID
774 EFIAPI
775 ParseAcpiSpcr (
776 IN BOOLEAN Trace,
777 IN UINT8* Ptr,
778 IN UINT32 AcpiTableLength,
779 IN UINT8 AcpiTableRevision
780 );
781
782 /**
783 This function parses the ACPI SRAT table.
784 When trace is enabled this function parses the SRAT table and
785 traces the ACPI table fields.
786
787 This function parses the following Resource Allocation Structures:
788 - Processor Local APIC/SAPIC Affinity Structure
789 - Memory Affinity Structure
790 - Processor Local x2APIC Affinity Structure
791 - GICC Affinity Structure
792
793 This function also performs validation of the ACPI table fields.
794
795 @param [in] Trace If TRUE, trace the ACPI fields.
796 @param [in] Ptr Pointer to the start of the buffer.
797 @param [in] AcpiTableLength Length of the ACPI table.
798 @param [in] AcpiTableRevision Revision of the ACPI table.
799 **/
800 VOID
801 EFIAPI
802 ParseAcpiSrat (
803 IN BOOLEAN Trace,
804 IN UINT8* Ptr,
805 IN UINT32 AcpiTableLength,
806 IN UINT8 AcpiTableRevision
807 );
808
809 /**
810 This function parses the ACPI SSDT table.
811 When trace is enabled this function parses the SSDT table and
812 traces the ACPI table fields.
813 For the SSDT table only the ACPI header fields are
814 parsed and traced.
815
816 @param [in] Trace If TRUE, trace the ACPI fields.
817 @param [in] Ptr Pointer to the start of the buffer.
818 @param [in] AcpiTableLength Length of the ACPI table.
819 @param [in] AcpiTableRevision Revision of the ACPI table.
820 **/
821 VOID
822 EFIAPI
823 ParseAcpiSsdt (
824 IN BOOLEAN Trace,
825 IN UINT8* Ptr,
826 IN UINT32 AcpiTableLength,
827 IN UINT8 AcpiTableRevision
828 );
829
830 /**
831 This function parses the ACPI XSDT table
832 and optionally traces the ACPI table fields.
833
834 This function also performs validation of the XSDT table.
835
836 @param [in] Trace If TRUE, trace the ACPI fields.
837 @param [in] Ptr Pointer to the start of the buffer.
838 @param [in] AcpiTableLength Length of the ACPI table.
839 @param [in] AcpiTableRevision Revision of the ACPI table.
840 **/
841 VOID
842 EFIAPI
843 ParseAcpiXsdt (
844 IN BOOLEAN Trace,
845 IN UINT8* Ptr,
846 IN UINT32 AcpiTableLength,
847 IN UINT8 AcpiTableRevision
848 );
849
850 #endif // ACPIPARSER_H_