2018-06-04 03:14:51 +02:00
|
|
|
/** @file
|
2018-04-20 10:08:22 +02:00
|
|
|
Header file for ACPI table parser
|
|
|
|
|
2020-07-02 10:09:02 +02:00
|
|
|
Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
|
2019-04-04 01:07:06 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2018-04-20 10:08:22 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef ACPITABLEPARSER_H_
|
|
|
|
#define ACPITABLEPARSER_H_
|
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
The maximum number of ACPI table parsers.
|
2018-04-20 10:08:22 +02:00
|
|
|
*/
|
2021-12-05 23:54:13 +01:00
|
|
|
#define MAX_ACPI_TABLE_PARSERS 32
|
2018-04-20 10:08:22 +02:00
|
|
|
|
|
|
|
/** An invalid/NULL signature value.
|
|
|
|
*/
|
2021-12-05 23:54:13 +01:00
|
|
|
#define ACPI_PARSER_SIGNATURE_NULL 0
|
2018-04-20 10:08:22 +02:00
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
A function that parses the ACPI table.
|
2018-04-20 10:08:22 +02:00
|
|
|
|
|
|
|
@param [in] Trace If TRUE, trace the ACPI fields.
|
|
|
|
@param [in] Ptr Pointer to the start of the buffer.
|
|
|
|
@param [in] AcpiTableLength Length of the ACPI table.
|
|
|
|
@param [in] AcpiTableRevision Revision of the ACPI table.
|
2018-06-04 03:14:51 +02:00
|
|
|
**/
|
2018-04-20 10:08:22 +02:00
|
|
|
typedef
|
|
|
|
VOID
|
2021-12-05 23:54:13 +01:00
|
|
|
(EFIAPI *PARSE_ACPI_TABLE_PROC)(
|
2018-04-20 10:08:22 +02:00
|
|
|
IN BOOLEAN Trace,
|
2021-12-05 23:54:13 +01:00
|
|
|
IN UINT8 *Ptr,
|
2018-04-20 10:08:22 +02:00
|
|
|
IN UINT32 AcpiTableLength,
|
|
|
|
IN UINT8 AcpiTableRevision
|
|
|
|
);
|
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
The ACPI table parser information
|
|
|
|
**/
|
2018-04-20 10:08:22 +02:00
|
|
|
typedef struct AcpiTableParser {
|
|
|
|
/// ACPI table signature
|
2021-12-05 23:54:13 +01:00
|
|
|
UINT32 Signature;
|
2018-04-20 10:08:22 +02:00
|
|
|
|
|
|
|
/// The ACPI table parser function.
|
2021-12-05 23:54:13 +01:00
|
|
|
PARSE_ACPI_TABLE_PROC Parser;
|
2018-04-20 10:08:22 +02:00
|
|
|
} ACPI_TABLE_PARSER;
|
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
Register the ACPI table Parser
|
2018-04-20 10:08:22 +02:00
|
|
|
|
|
|
|
This function registers the ACPI table parser.
|
|
|
|
|
|
|
|
@param [in] Signature The ACPI table signature.
|
|
|
|
@param [in] ParserProc The ACPI table parser.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The parser is registered.
|
|
|
|
@retval EFI_INVALID_PARAMETER A parameter is invalid.
|
|
|
|
@retval EFI_ALREADY_STARTED The parser for the Table
|
|
|
|
was already registered.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES No space to register the
|
|
|
|
parser.
|
2018-06-04 03:14:51 +02:00
|
|
|
**/
|
2018-04-20 10:08:22 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
RegisterParser (
|
2021-12-05 23:54:13 +01:00
|
|
|
IN UINT32 Signature,
|
|
|
|
IN PARSE_ACPI_TABLE_PROC ParserProc
|
2018-06-04 03:14:51 +02:00
|
|
|
);
|
2018-04-20 10:08:22 +02:00
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
Deregister the ACPI table Parser
|
2018-04-20 10:08:22 +02:00
|
|
|
|
|
|
|
This function deregisters the ACPI table parser.
|
|
|
|
|
|
|
|
@param [in] Signature The ACPI table signature.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The parser was deregistered.
|
|
|
|
@retval EFI_INVALID_PARAMETER A parameter is invalid.
|
|
|
|
@retval EFI_NOT_FOUND A registered parser was not found.
|
2018-06-04 03:14:51 +02:00
|
|
|
**/
|
2018-04-20 10:08:22 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
DeregisterParser (
|
2021-12-05 23:54:13 +01:00
|
|
|
IN UINT32 Signature
|
2018-06-04 03:14:51 +02:00
|
|
|
);
|
2018-04-20 10:08:22 +02:00
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
This function processes the ACPI tables.
|
2018-04-20 10:08:22 +02:00
|
|
|
This function calls ProcessTableReportOptions() to list the ACPI
|
|
|
|
tables, perform binary dump of the tables and determine if the
|
|
|
|
ACPI fields should be traced.
|
|
|
|
|
|
|
|
This function also invokes the parser for the ACPI tables.
|
|
|
|
|
|
|
|
This function also performs a RAW dump of the ACPI table including
|
|
|
|
the unknown/unparsed ACPI tables and validates the checksum.
|
|
|
|
|
|
|
|
@param [in] Ptr Pointer to the start of the ACPI
|
|
|
|
table data buffer.
|
2018-06-04 03:14:51 +02:00
|
|
|
**/
|
2018-04-20 10:08:22 +02:00
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ProcessAcpiTable (
|
2021-12-05 23:54:13 +01:00
|
|
|
IN UINT8 *Ptr
|
2018-04-20 10:08:22 +02:00
|
|
|
);
|
|
|
|
|
2018-06-04 03:14:51 +02:00
|
|
|
/**
|
|
|
|
Get the ACPI table Parser
|
2018-04-20 10:08:22 +02:00
|
|
|
|
|
|
|
This function returns the ACPI table parser proc from the list of
|
|
|
|
registered parsers.
|
|
|
|
|
|
|
|
@param [in] Signature The ACPI table signature.
|
|
|
|
@param [out] ParserProc Pointer to a ACPI table parser proc.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The parser was returned successfully.
|
|
|
|
@retval EFI_INVALID_PARAMETER A parameter is invalid.
|
|
|
|
@retval EFI_NOT_FOUND A registered parser was not found.
|
2018-06-04 03:14:51 +02:00
|
|
|
**/
|
2018-04-20 10:08:22 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
GetParser (
|
2021-12-05 23:54:13 +01:00
|
|
|
IN UINT32 Signature,
|
|
|
|
OUT PARSE_ACPI_TABLE_PROC *ParserProc
|
2018-04-20 10:08:22 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif // ACPITABLEPARSER_H_
|