TianoCore EDK2 master
|
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseMemoryLib.h>
#include "AcpiParser.h"
#include "AcpiView.h"
#include "AcpiViewConfig.h"
Go to the source code of this file.
Functions | |
VOID | ResetErrorCount (VOID) |
UINT32 | GetErrorCount (VOID) |
VOID | ResetWarningCount (VOID) |
UINT32 | GetWarningCount (VOID) |
VOID EFIAPI | IncrementErrorCount (VOID) |
VOID EFIAPI | IncrementWarningCount (VOID) |
BOOLEAN EFIAPI | VerifyChecksum (IN BOOLEAN Log, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | DumpRaw (IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | DumpUint8 (IN CONST CHAR16 *Format, IN UINT8 *Ptr) |
VOID EFIAPI | DumpUint16 (IN CONST CHAR16 *Format, IN UINT8 *Ptr) |
VOID EFIAPI | DumpUint32 (IN CONST CHAR16 *Format, IN UINT8 *Ptr) |
VOID EFIAPI | DumpUint64 (IN CONST CHAR16 *Format, IN UINT8 *Ptr) |
VOID EFIAPI | Dump3Chars (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | Dump4Chars (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | Dump6Chars (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | Dump8Chars (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | Dump12Chars (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | Dump16Chars (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | DumpReserved (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | DumpReservedBits (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
VOID EFIAPI | PrintFieldName (IN UINT32 Indent, IN CONST CHAR16 *FieldName) |
UINT32 EFIAPI | ParseAcpi (IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems) |
UINT32 EFIAPI | DumpGasStruct (IN UINT8 *Ptr, IN UINT32 Indent, IN UINT32 Length) |
VOID EFIAPI | DumpGas (IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length) |
UINT32 EFIAPI | DumpAcpiHeader (IN UINT8 *Ptr) |
UINT32 EFIAPI | ParseAcpiHeader (IN UINT8 *Ptr, OUT CONST UINT32 **Signature, OUT CONST UINT32 **Length, OUT CONST UINT8 **Revision) |
UINT32 EFIAPI | ParseAcpiBitFields (IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems) |
Variables | |
STATIC UINT32 | gIndent |
STATIC UINT32 | mTableErrorCount |
STATIC UINT32 | mTableWarningCount |
STATIC ACPI_DESCRIPTION_HEADER_INFO | AcpiHdrInfo |
STATIC CONST ACPI_PARSER | AcpiHeaderParser [] |
STATIC CONST ACPI_PARSER | GasParser [] |
ACPI parser
Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AcpiParser.c.
This function traces 12 characters which can be optionally formated using the format string if specified.
If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 439 of file AcpiParser.c.
This function traces 16 characters which can be optionally formated using the format string if specified.
If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 474 of file AcpiParser.c.
This function traces 3 characters which can be optionally formated using the format string if specified.
If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 326 of file AcpiParser.c.
This function traces 4 characters which can be optionally formated using the format string if specified.
If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 352 of file AcpiParser.c.
This function traces 6 characters which can be optionally formated using the format string if specified.
If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 379 of file AcpiParser.c.
This function traces 8 characters which can be optionally formated using the format string if specified.
If no format string is specified the Format must be NULL.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 408 of file AcpiParser.c.
UINT32 EFIAPI DumpAcpiHeader | ( | IN UINT8 * | Ptr | ) |
This function traces the ACPI header as described by the AcpiHeaderParser.
[in] | Ptr | Pointer to the start of the buffer. |
Number | of bytes parsed. |
Definition at line 885 of file AcpiParser.c.
This function traces the GAS structure as described by the GasParser.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 867 of file AcpiParser.c.
This function indents and traces the GAS structure as described by the GasParser.
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Indent | Number of spaces to indent the output. |
[in] | Length | Length of the GAS structure buffer. |
Number | of bytes parsed. |
Definition at line 841 of file AcpiParser.c.
This function performs a raw data dump of the ACPI table.
[in] | Ptr | Pointer to the start of the table buffer. |
[in] | Length | The length of the buffer. |
Definition at line 184 of file AcpiParser.c.
This function traces reserved fields up to 8 bytes in length.
Format string is ignored by this function as the reserved field is printed byte by byte with intermittent spacing <eg: 0 0 0 0>. Use DumpxChars for any other use case.
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field. |
Definition at line 513 of file AcpiParser.c.
This function traces reserved fields up to 64 bits in length.
Format string is ignored by this function as the reserved field is printed byte by byte with intermittent spacing. eg: <0 0 0 0>. When the field length isn't a multiple of 8, the number of bytes are "ceil"-ed by one. eg for 27 bits <0 0 0 0>
[in] | Format | Optional format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the field as number of bits. |
Definition at line 615 of file AcpiParser.c.
This function traces 2 bytes of data as specified in the format string.
[in] | Format | The format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
Definition at line 264 of file AcpiParser.c.
This function traces 4 bytes of data as specified in the format string.
[in] | Format | The format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
Definition at line 280 of file AcpiParser.c.
This function traces 8 bytes of data as specified by the format string.
[in] | Format | The format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
Definition at line 296 of file AcpiParser.c.
This function traces 1 byte of data as specified in the format string.
[in] | Format | The format string for tracing the data. |
[in] | Ptr | Pointer to the start of the buffer. |
Definition at line 248 of file AcpiParser.c.
UINT32 GetErrorCount | ( | VOID | ) |
This function returns the ACPI table error count.
Returns | the count of errors detected in the ACPI tables. |
Definition at line 47 of file AcpiParser.c.
UINT32 GetWarningCount | ( | VOID | ) |
This function returns the ACPI table warning count.
Returns | the count of warning detected in the ACPI tables. |
Definition at line 71 of file AcpiParser.c.
VOID EFIAPI IncrementErrorCount | ( | VOID | ) |
This function increments the ACPI table error counter.
Definition at line 83 of file AcpiParser.c.
VOID EFIAPI IncrementWarningCount | ( | VOID | ) |
This function increments the ACPI table warning counter.
Definition at line 95 of file AcpiParser.c.
UINT32 EFIAPI ParseAcpi | ( | IN BOOLEAN | Trace, |
IN UINT32 | Indent, | ||
IN CONST CHAR8 *AsciiName | OPTIONAL, | ||
IN UINT8 * | Ptr, | ||
IN UINT32 | Length, | ||
IN CONST ACPI_PARSER * | Parser, | ||
IN UINT32 | ParserItems | ||
) |
This function is used to parse an ACPI table buffer.
The ACPI table buffer is parsed using the ACPI table parser information specified by a pointer to an array of ACPI_PARSER elements. This parser function iterates through each item on the ACPI_PARSER array and logs the ACPI table fields.
This function can optionally be used to parse ACPI tables and fetch specific field values. The ItemPtr member of the ACPI_PARSER structure (where used) is updated by this parser function to point to the selected field data (e.g. useful for variable length nested fields).
[in] | Trace | Trace the ACPI fields TRUE else only parse the table. |
[in] | Indent | Number of spaces to indent the output. |
[in] | AsciiName | Optional pointer to an ASCII string that describes the table being parsed. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length of the buffer pointed by Ptr. |
[in] | Parser | Pointer to an array of ACPI_PARSER structure that describes the table being parsed. |
[in] | ParserItems | Number of items in the ACPI_PARSER array. |
Number | of bytes parsed. |
Definition at line 683 of file AcpiParser.c.
UINT32 EFIAPI ParseAcpiBitFields | ( | IN BOOLEAN | Trace, |
IN UINT32 | Indent, | ||
IN CONST CHAR8 *AsciiName | OPTIONAL, | ||
IN UINT8 * | Ptr, | ||
IN UINT32 | Length, | ||
IN CONST ACPI_PARSER * | Parser, | ||
IN UINT32 | ParserItems | ||
) |
This function is used to parse an ACPI table bitfield buffer.
The ACPI table buffer is parsed using the ACPI table parser information specified by a pointer to an array of ACPI_PARSER elements. This parser function iterates through each item on the ACPI_PARSER array and logs the ACPI table bitfields.
This function can optionally be used to parse ACPI tables and fetch specific field values. The ItemPtr member of the ACPI_PARSER structure (where used) is updated by this parser function to point to the selected field data (e.g. useful for variable length nested fields).
ItemPtr member of ACPI_PARSER is not supported with this function.
[in] | Trace | Trace the ACPI fields TRUE else only parse the table. |
[in] | Indent | Number of spaces to indent the output. |
[in] | AsciiName | Optional pointer to an ASCII string that describes the table being parsed. |
[in] | Ptr | Pointer to the start of the buffer. |
[in] | Length | Length in bytes of the buffer pointed by Ptr. |
[in] | Parser | Pointer to an array of ACPI_PARSER structure that describes the table being parsed. |
[in] | ParserItems | Number of items in the ACPI_PARSER array. |
Number | of bits parsed. |
Definition at line 968 of file AcpiParser.c.
UINT32 EFIAPI ParseAcpiHeader | ( | IN UINT8 * | Ptr, |
OUT CONST UINT32 ** | Signature, | ||
OUT CONST UINT32 ** | Length, | ||
OUT CONST UINT8 ** | Revision | ||
) |
This function parses the ACPI header as described by the AcpiHeaderParser.
This function optionally returns the signature, length and revision of the ACPI table.
[in] | Ptr | Pointer to the start of the buffer. |
[out] | Signature | Gets location of the ACPI table signature. |
[out] | Length | Gets location of the length of the ACPI table. |
[out] | Revision | Gets location of the revision of the ACPI table. |
Number | of bytes parsed. |
Definition at line 914 of file AcpiParser.c.
This function indents and prints the ACPI table Field Name.
[in] | Indent | Number of spaces to add to the global table indent. The global table indent is 0 by default; however this value is updated on entry to the ParseAcpi() by adding the indent value provided to ParseAcpi() and restored back on exit. Therefore the total indent in the output is dependent on from where this function is called. |
[in] | FieldName | Pointer to the Field Name. |
Definition at line 641 of file AcpiParser.c.
VOID ResetErrorCount | ( | VOID | ) |
This function resets the ACPI table error counter to Zero.
Definition at line 34 of file AcpiParser.c.
VOID ResetWarningCount | ( | VOID | ) |
This function resets the ACPI table warning counter to Zero.
Definition at line 58 of file AcpiParser.c.
This function verifies the ACPI table checksum.
This function verifies the checksum for the ACPI table and optionally prints the status.
[in] | Log | If TRUE log the status of the checksum. |
[in] | Ptr | Pointer to the start of the table buffer. |
[in] | Length | The length of the buffer. |
TRUE | The checksum is OK. |
FALSE | The checksum failed. |
Definition at line 117 of file AcpiParser.c.
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo |
Definition at line 21 of file AcpiParser.c.
STATIC CONST ACPI_PARSER AcpiHeaderParser[] |
An ACPI_PARSER array describing the ACPI header.
Definition at line 26 of file AcpiParser.c.
STATIC CONST ACPI_PARSER GasParser[] |
An array describing the ACPI Generic Address Structure. The GasParser array is used by the ParseAcpi function to parse and/or trace the GAS structure.
Definition at line 822 of file AcpiParser.c.
STATIC UINT32 gIndent |
Definition at line 17 of file AcpiParser.c.
STATIC UINT32 mTableErrorCount |
Definition at line 18 of file AcpiParser.c.
STATIC UINT32 mTableWarningCount |
Definition at line 19 of file AcpiParser.c.