TianoCore EDK2 master
Loading...
Searching...
No Matches
McfgGenerator.c File Reference

Go to the source code of this file.

Macros

#define MCFG_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Typedefs

typedef EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER MCFG_TABLE
 
typedef EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE MCFG_CFG_SPACE_ADDR
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPciConfigSpaceInfo, CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO)
 
STATIC VOID AddPciConfigurationSpaceList (IN MCFG_TABLE *CONST Mcfg, IN CONST UINT32 PciCfgSpaceOffset, IN CONST CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO *PciCfgSpaceInfoList, IN UINT32 PciCfgSpaceCount)
 
STATIC EFI_STATUS EFIAPI BuildMcfgTable (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, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
STATIC EFI_STATUS EFIAPI FreeMcfgTableResources (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)
 
EFI_STATUS EFIAPI AcpiMcfgLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiMcfgLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST ACPI_TABLE_GENERATOR McfgGenerator
 

Detailed Description

MCFG Table Generator

Copyright (c) 2017 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • PCI Firmware Specification - Revision 3.2, January 26, 2015.

Definition in file McfgGenerator.c.

Macro Definition Documentation

◆ MCFG_GENERATOR_REVISION

#define MCFG_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the MCFG Table Generator revision.

Definition at line 291 of file McfgGenerator.c.

Typedef Documentation

◆ MCFG_CFG_SPACE_ADDR

This typedef is used to shorten the name of the Enhanced Configuration Space address structure.

Definition at line 47 of file McfgGenerator.c.

◆ MCFG_TABLE

ARM standard MCFG Generator

Requirements: The following Configuration Manager Object(s) are required by this Generator:

  • EArchCommonObjPciConfigSpaceInfo This typedef is used to shorten the name of the MCFG Table header structure.

Definition at line 40 of file McfgGenerator.c.

Function Documentation

◆ AcpiMcfgLibConstructor()

EFI_STATUS EFIAPI AcpiMcfgLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Register the Generator with the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is registered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 335 of file McfgGenerator.c.

◆ AcpiMcfgLibDestructor()

EFI_STATUS EFIAPI AcpiMcfgLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Deregister the Generator from the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is deregistered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe Generator is not registered.

Definition at line 359 of file McfgGenerator.c.

◆ AddPciConfigurationSpaceList()

STATIC VOID AddPciConfigurationSpaceList ( IN MCFG_TABLE *CONST  Mcfg,
IN CONST UINT32  PciCfgSpaceOffset,
IN CONST CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO PciCfgSpaceInfoList,
IN UINT32  PciCfgSpaceCount 
)

Add the PCI Enhanced Configuration Space Information to the MCFG Table.

Parameters
[in]McfgPointer to MCFG Table.
[in]PciCfgSpaceOffsetOffset for the PCI Configuration Space Info structure in the MCFG Table.
[in]PciCfgSpaceInfoListPointer to the PCI Configuration Space Info List.
[in]PciCfgSpaceCountCount of PCI Configuration Space Info.

Definition at line 70 of file McfgGenerator.c.

◆ BuildMcfgTable()

Construct the MCFG ACPI table.

This function invokes the Configuration Manager protocol interface to get the required hardware information for generating the ACPI table.

If this function allocates any resources then they must be freed in the FreeXXXXTableResources function.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[out]TablePointer to the constructed ACPI Table.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

Definition at line 122 of file McfgGenerator.c.

◆ FreeMcfgTableResources()

Free any resources allocated for constructing the MCFG

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to the ACPI Table.
Return values
EFI_SUCCESSThe resources were freed successfully.
EFI_INVALID_PARAMETERThe table pointer is NULL or invalid.

Definition at line 265 of file McfgGenerator.c.

◆ GET_OBJECT_LIST()

Retrieve the PCI Configuration Space Information.

Variable Documentation

◆ McfgGenerator

Initial value:
= {
L"ACPI.STD.MCFG.GENERATOR",
}
#define EFI_ACPI_6_2_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE
Definition: Acpi62.h:2906
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdMcfg
MCFG Generator.
STATIC EFI_STATUS EFIAPI BuildMcfgTable(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, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
#define MCFG_GENERATOR_REVISION
STATIC EFI_STATUS EFIAPI FreeMcfgTableResources(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)
#define NULL
Definition: Base.h:319
#define EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION

The interface for the MCFG Table Generator.

Definition at line 297 of file McfgGenerator.c.