TianoCore EDK2 master
Loading...
Searching...
No Matches
AcpiTableGenerator.h File Reference

Go to the source code of this file.

Data Structures

struct  AcpiTableGenerator
 

Macros

#define IS_GENERATOR_TYPE_ACPI(TableGeneratorId)    (GET_TABLE_TYPE (TableGeneratorId) == ETableGeneratorTypeAcpi)
 
#define IS_VALID_STD_ACPI_GENERATOR_ID(TableGeneratorId)
 
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
 
#define CREATE_OEM_ACPI_TABLE_GEN_ID(TableId)
 
#define TABLE_GENERATOR_CREATOR_ID   SIGNATURE_32('D', 'Y', 'N', 'T')
 
#define TABLE_GENERATOR_CREATOR_ID_ARM   SIGNATURE_32('A', 'R', 'M', 'H')
 
#define ACPI_HEADER(Signature, Type, Revision)
 
#define DUMP_ACPI_TABLE_HEADER(AcpiHeader)
 

Typedefs

typedef TABLE_GENERATOR_ID ACPI_TABLE_GENERATOR_ID
 
typedef enum StdAcpiTableId ESTD_ACPI_TABLE_ID
 
typedef struct ConfigurationManagerProtocol EDKII_CONFIGURATION_MANAGER_PROTOCOL
 
typedef struct CmAStdObjAcpiTableInfo CM_STD_OBJ_ACPI_TABLE_INFO
 
typedef struct AcpiTableGenerator ACPI_TABLE_GENERATOR
 
typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_BUILD_TABLE) (IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **Table)
 
typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_FREE_TABLE) (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_BUILD_TABLEEX) (IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER ***Table, OUT UINTN *CONST TableCount)
 
typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_FREE_TABLEEX) (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER ***CONST Table, IN CONST UINTN TableCount)
 

Enumerations

enum  StdAcpiTableId {
  EStdAcpiTableIdReserved = 0x0000 , EStdAcpiTableIdRaw , EStdAcpiTableIdDsdt = EStdAcpiTableIdRaw , EStdAcpiTableIdSsdt = EStdAcpiTableIdRaw ,
  EStdAcpiTableIdFadt , EStdAcpiTableIdMadt , EStdAcpiTableIdGtdt , EStdAcpiTableIdDbg2 ,
  EStdAcpiTableIdSpcr , EStdAcpiTableIdMcfg , EStdAcpiTableIdIort , EStdAcpiTableIdPptt ,
  EStdAcpiTableIdSrat , EStdAcpiTableIdSsdtSerialPort , EStdAcpiTableIdSsdtCmn600 , EStdAcpiTableIdSsdtCpuTopology ,
  EStdAcpiTableIdSsdtPciExpress , EStdAcpiTableIdPcct , EStdAcpiTableIdTpm2 , EStdAcpiTableIdWsmt ,
  EStdAcpiTableIdHpet , EStdAcpiTableIdSsdtHpet , EStdAcpiTableIdSpmi , EStdAcpiTableIdMax
}
 

Functions

EFI_STATUS EFIAPI RegisterAcpiTableGenerator (IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
 
EFI_STATUS EFIAPI DeregisterAcpiTableGenerator (IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
 

Detailed Description

Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Glossary:
  • Cm or CM - Configuration Manager
  • Obj or OBJ - Object
  • Std or STD - Standard

Definition in file AcpiTableGenerator.h.

Macro Definition Documentation

◆ ACPI_HEADER

#define ACPI_HEADER (   Signature,
  Type,
  Revision 
)
Value:
{ \
Signature, /* UINT32 Signature */ \
sizeof (Type), /* UINT32 Length */ \
Revision, /* UINT8 Revision */ \
0, /* UINT8 Checksum */ \
{ 0, 0, 0, 0, 0, 0 }, /* UINT8 OemId[6] */ \
0, /* UINT64 OemTableId */ \
0, /* UINT32 OemRevision */ \
0, /* UINT32 CreatorId */ \
0 /* UINT32 CreatorRevision */ \
}

A macro to initialise the common header part of EFI ACPI tables as defined by the EFI_ACPI_DESCRIPTION_HEADER structure.

Parameters
[in]SignatureThe ACPI table signature.
[in]TypeThe ACPI table structure.
[in]RevisionThe ACPI table revision.

Definition at line 186 of file AcpiTableGenerator.h.

◆ CREATE_OEM_ACPI_TABLE_GEN_ID

#define CREATE_OEM_ACPI_TABLE_GEN_ID (   TableId)
Value:
TableId \
)
@ ETableGeneratorNameSpaceOem
OEM Namespace.
#define CREATE_TABLE_GEN_ID(TableType, TableNameSpaceId, TableId)
@ ETableGeneratorTypeAcpi
ACPI Table Generator Type.

This macro creates an OEM ACPI Table Generator ID.

Parameters
[in]TableIdThe table generator ID.
Returns
an OEM ACPI table generator ID.

Definition at line 162 of file AcpiTableGenerator.h.

◆ CREATE_STD_ACPI_TABLE_GEN_ID

#define CREATE_STD_ACPI_TABLE_GEN_ID (   TableId)
Value:
TableId \
)
@ ETableGeneratorNameSpaceStd
Standard Namespace.

This macro creates a standard ACPI Table Generator ID.

Parameters
[in]TableIdThe table generator ID.
Returns
a standard ACPI table generator ID.

Definition at line 149 of file AcpiTableGenerator.h.

◆ DUMP_ACPI_TABLE_HEADER

#define DUMP_ACPI_TABLE_HEADER (   AcpiHeader)
Value:
DEBUG (( \
DEBUG_INFO, \
"ACPI TABLE %c%c%c%c : Rev 0x%x : Length : 0x%x\n", \
(AcpiHeader->Signature & 0xFF), \
((AcpiHeader->Signature >> 8) & 0xFF), \
((AcpiHeader->Signature >> 16) & 0xFF), \
((AcpiHeader->Signature >> 24) & 0xFF), \
AcpiHeader->Revision, \
AcpiHeader->Length \
));
#define DEBUG(Expression)
Definition: DebugLib.h:434

A macro to dump the common header part of EFI ACPI tables as defined by the EFI_ACPI_DESCRIPTION_HEADER structure.

Parameters
[in]AcpiHeaderThe pointer to the ACPI table header.

Definition at line 203 of file AcpiTableGenerator.h.

◆ IS_GENERATOR_TYPE_ACPI

#define IS_GENERATOR_TYPE_ACPI (   TableGeneratorId)     (GET_TABLE_TYPE (TableGeneratorId) == ETableGeneratorTypeAcpi)

This macro checks if the Table Generator ID is for an ACPI Table Generator.

Parameters
[in]TableGeneratorIdThe table generator ID.
Returns
TRUE if the table generator ID is for an ACPI Table Generator.

Definition at line 124 of file AcpiTableGenerator.h.

◆ IS_VALID_STD_ACPI_GENERATOR_ID

#define IS_VALID_STD_ACPI_GENERATOR_ID (   TableGeneratorId)
Value:
( \
IS_GENERATOR_NAMESPACE_STD (TableGeneratorId) && \
IS_GENERATOR_TYPE_ACPI (TableGeneratorId) && \
((GET_TABLE_ID (GeneratorId) >= EStdAcpiTableIdRaw) && \
(GET_TABLE_ID (GeneratorId) < EStdAcpiTableIdMax)) \
)
@ EStdAcpiTableIdRaw
RAW Generator.
#define GET_TABLE_ID(TableGeneratorId)

This macro checks if the Table Generator ID is for a standard ACPI Table Generator.

Parameters
[in]TableGeneratorIdThe table generator ID.
Returns
TRUE if the table generator ID is for a standard ACPI Table Generator.

Definition at line 135 of file AcpiTableGenerator.h.

◆ TABLE_GENERATOR_CREATOR_ID

#define TABLE_GENERATOR_CREATOR_ID   SIGNATURE_32('D', 'Y', 'N', 'T')

The generic creator ID for the ACPI tables generated using the standard ACPI table generators.

Definition at line 172 of file AcpiTableGenerator.h.

◆ TABLE_GENERATOR_CREATOR_ID_ARM

#define TABLE_GENERATOR_CREATOR_ID_ARM   SIGNATURE_32('A', 'R', 'M', 'H')

The Creator ID for the ACPI tables generated using the standard ACPI table generators for ARM.

Definition at line 177 of file AcpiTableGenerator.h.

Typedef Documentation

◆ ACPI_TABLE_GENERATOR

The ACPI_TABLE_GENERATOR structure provides an interface that the Table Manager can use to invoke the functions to build ACPI tables.

Note: Although the Generator is required to implement at least one pair of interfaces (BuildAcpiTable & FreeTableResources or BuildAcpiTableEx & FreeTableResourcesEx) for generating the ACPI table(s), if both pair of interfaces are implemented the extended version will take precedence.

Definition at line 219 of file AcpiTableGenerator.h.

◆ ACPI_TABLE_GENERATOR_BUILD_TABLE

typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_BUILD_TABLE) (IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **Table)

This function pointer describes the interface to ACPI table build functions provided by the ACPI table generator and called by the Table Manager to build an ACPI table.

Parameters
[in]ThisPointer to the ACPI table generator.
[in]AcpiTableInfoPointer to the ACPI table information.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol interface.
[out]TablePointer to the generated ACPI table.
Returns
EFI_SUCCESS If the table is generated successfully or other failure codes as returned by the generator.

Definition at line 234 of file AcpiTableGenerator.h.

◆ ACPI_TABLE_GENERATOR_BUILD_TABLEEX

typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_BUILD_TABLEEX) (IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER ***Table, OUT UINTN *CONST TableCount)

This function pointer describes an extended interface to build ACPI Tables. The ACPI table generator can generate multiple ACPI Tables and return a pointer to the list of ACPI tables. The FreeTableResourcesEx() must be called to free any resources that may have been allocated using this interface.

Parameters
[in]ThisPointer to the ACPI table generator.
[in]AcpiTableInfoPointer to the ACPI table information.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol interface.
[out]TablePointer to a list of generated ACPI table(s).
[out]TableCountNumber of generated ACPI table(s).
Returns
EFI_SUCCESS If the table is generated successfully or other failure codes as returned by the generator.

Definition at line 277 of file AcpiTableGenerator.h.

◆ ACPI_TABLE_GENERATOR_FREE_TABLE

typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_FREE_TABLE) (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)

This function pointer describes the interface used by the Table Manager to give the generator an opportunity to free any resources allocated for building the ACPI table.

Parameters
[in]ThisPointer to the ACPI table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to the ACPI Table.
Returns
EFI_SUCCESS If freed successfully or other failure codes as returned by the generator.

Definition at line 254 of file AcpiTableGenerator.h.

◆ ACPI_TABLE_GENERATOR_FREE_TABLEEX

typedef EFI_STATUS(EFIAPI * ACPI_TABLE_GENERATOR_FREE_TABLEEX) (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER ***CONST Table, IN CONST UINTN TableCount)

This function pointer describes an extended interface used by the Table Manager to give the generator an opportunity to free any resources allocated for building the ACPI table. This interface must be used in conjunction with the BuildAcpiTableEx interface.

Parameters
[in]ThisPointer to the ACPI table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to the list of ACPI Table(s).
[in]TableCountNumber of ACPI table(s).
Returns
EFI_SUCCESS If freed successfully or other failure codes as returned by the generator.

Definition at line 300 of file AcpiTableGenerator.h.

◆ ACPI_TABLE_GENERATOR_ID

The Dynamic Tables Framework provisions two classes of ACPI table generators.

  • Standard generators: The ACPI table generators implemented by the Dynamic Tables Framework.
  • OEM generators: The ACPI table generators customized by the OEM.

The Dynamic Tables Framework implements the following ACPI table generators:

  • RAW : This is the simplest ACPI table generator. It simply installs the ACPI table provided in the AcpiTableData member of the CM_STD_OBJ_ACPI_TABLE_INFO. The ACPI table data is provided by the Configuration Manager and is generated using an implementation defined mechanism.
  • DSDT : The DSDT generator is a clone of the RAW generator. The difference is in the way the ACPI Table Data is generated from an AML file.
  • SSDT : The SSDT generator is a clone of the RAW generator. The difference is in the way the ACPI Table Data is generated from an AML file.
  • FADT : The FADT generator collates the required platform information from the Configuration Manager and builds the FADT table.
  • MADT : The MADT generator collates the GIC information from the Configuration Manager and builds the MADT table.
  • GTDT : The GTDT generator collates the Timer information from the Configuration Manager and builds the GTDT table.
  • DBG2 : The DBG2 generator collates the debug serial port information from the Configuration Manager and builds the DBG2 table.
  • SPCR : The SPCR generator collates the serial port information from the Configuration Manager and builds the SPCR table.
  • MCFG : The MCFG generator collates the PCI configuration space information from the Configuration Manager and builds the MCFG table.
  • IORT : The IORT generator collates the IO Topology information from the Configuration Manager and builds the IORT table.
  • PPTT : The PPTT generator collates the processor topology information from the Configuration Manager and builds the PPTT table.
  • SRAT : The SRAT generator collates the system resource affinity information from the Configuration Manager and builds the SRAT table.
  • SSDT Serial-Port: The SSDT Serial generator collates the Serial port information from the Configuration Manager and patches the SSDT Serial Port template to build the SSDT Serial port table.
  • SSDT CMN-600: The SSDT CMN-600 generator collates the CMN-600 information from the Configuration Manager and patches the SSDT CMN-600 template to build the SSDT CMN-600 table.
  • SSDT Cpu-Topology: The SSDT Cpu-Topology generator collates the cpu and LPI information from the Configuration Manager and generates a SSDT table describing the CPU hierarchy.
  • SSDT Pci-Express: The SSDT Pci Express generator collates the Pci Express information from the Configuration Manager and generates a SSDT table describing a Pci Express bus.
  • WSMT : The WSMT generator collates the WSMT protection flag information from the Configuration Manager and builds the WSMT table.
  • SPMI : The SPMI generator collects the SPMI interface and optionally SPMI interrupt and deviceid (or uid) information from the Configuration Manager and builds the SPMI table. The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.

Definition at line 85 of file AcpiTableGenerator.h.

◆ CM_STD_OBJ_ACPI_TABLE_INFO

Definition at line 218 of file AcpiTableGenerator.h.

◆ EDKII_CONFIGURATION_MANAGER_PROTOCOL

Forward declarations.

The EDKII_CONFIGURATION_MANAGER_PROTOCOL structure describes the Configuration Manager Protocol interface.

Definition at line 217 of file AcpiTableGenerator.h.

◆ ESTD_ACPI_TABLE_ID

The ESTD_ACPI_TABLE_ID enum describes the ACPI table IDs reserved for the standard generators.

Enumeration Type Documentation

◆ StdAcpiTableId

The ESTD_ACPI_TABLE_ID enum describes the ACPI table IDs reserved for the standard generators.

Enumerator
EStdAcpiTableIdReserved 

Reserved.

EStdAcpiTableIdRaw 

RAW Generator.

EStdAcpiTableIdDsdt 

DSDT Generator.

EStdAcpiTableIdSsdt 

SSDT Generator.

EStdAcpiTableIdFadt 

FADT Generator.

EStdAcpiTableIdMadt 

MADT Generator.

EStdAcpiTableIdGtdt 

GTDT Generator.

EStdAcpiTableIdDbg2 

DBG2 Generator.

EStdAcpiTableIdSpcr 

SPCR Generator.

EStdAcpiTableIdMcfg 

MCFG Generator.

EStdAcpiTableIdIort 

IORT Generator.

EStdAcpiTableIdPptt 

PPTT Generator.

EStdAcpiTableIdSrat 

SRAT Generator.

EStdAcpiTableIdSsdtSerialPort 

SSDT Serial-Port Generator.

EStdAcpiTableIdSsdtCmn600 

SSDT Cmn-600 Generator.

EStdAcpiTableIdSsdtCpuTopology 

SSDT Cpu Topology.

EStdAcpiTableIdSsdtPciExpress 

SSDT Pci Express Generator.

EStdAcpiTableIdPcct 

PCCT Generator.

EStdAcpiTableIdTpm2 

TPM2 Generator.

EStdAcpiTableIdWsmt 

WSMT Generator.

EStdAcpiTableIdHpet 

HPET Generator.

EStdAcpiTableIdSsdtHpet 

SSDT HPET Generator.

EStdAcpiTableIdSpmi 

SPMI Generator.

Definition at line 90 of file AcpiTableGenerator.h.

Function Documentation

◆ DeregisterAcpiTableGenerator()

EFI_STATUS EFIAPI DeregisterAcpiTableGenerator ( IN CONST ACPI_TABLE_GENERATOR *CONST  Generator)

Deregister ACPI generator.

This function is called by the ACPI table generator to deregister itself from the ACPI table factory.

Parameters
[in]GeneratorPointer to the ACPI table generator.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERThe generator is invalid.
EFI_NOT_FOUNDThe requested generator is not found in the list of registered generators.

Definition at line 174 of file AcpiTableFactory.c.

◆ RegisterAcpiTableGenerator()

EFI_STATUS EFIAPI RegisterAcpiTableGenerator ( IN CONST ACPI_TABLE_GENERATOR *CONST  Generator)

Register ACPI table factory generator.

The ACPI table factory maintains a list of the Standard and OEM ACPI table generators.

Parameters
[in]GeneratorPointer to the ACPI table generator.
Return values
EFI_SUCCESSThe Generator was registered successfully.
EFI_INVALID_PARAMETERThe Generator ID is invalid or the Generator pointer is NULL.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 110 of file AcpiTableFactory.c.