72 IN CONST UINT32 PciCfgSpaceOffset,
74 IN UINT32 PciCfgSpaceCount
79 ASSERT (Mcfg !=
NULL);
80 ASSERT (PciCfgSpaceInfoList !=
NULL);
84 while (PciCfgSpaceCount-- != 0) {
86 PciCfgSpace->BaseAddress = PciCfgSpaceInfoList->BaseAddress;
87 PciCfgSpace->PciSegmentGroupNumber =
88 PciCfgSpaceInfoList->PciSegmentGroupNumber;
89 PciCfgSpace->StartBusNumber = PciCfgSpaceInfoList->StartBusNumber;
90 PciCfgSpace->EndBusNumber = PciCfgSpaceInfoList->EndBusNumber;
91 PciCfgSpace->Reserved = EFI_ACPI_RESERVED_DWORD;
93 PciCfgSpaceInfoList++;
131 UINT32 ConfigurationSpaceCount;
135 ASSERT (This !=
NULL);
136 ASSERT (AcpiTableInfo !=
NULL);
137 ASSERT (CfgMgrProtocol !=
NULL);
138 ASSERT (Table !=
NULL);
139 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
140 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
142 if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
143 (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
147 "ERROR: MCFG: Requested table revision = %d, is not supported."
148 "Supported table revision: Minimum = %d, Maximum = %d\n",
149 AcpiTableInfo->AcpiTableRevision,
150 This->MinAcpiTableRevision,
151 This->AcpiTableRevision
153 return EFI_INVALID_PARAMETER;
157 Status = GetEArchCommonObjPciConfigSpaceInfo (
160 &PciConfigSpaceInfoList,
161 &ConfigurationSpaceCount
163 if (EFI_ERROR (Status)) {
166 "ERROR: MCFG: Failed to get PCI Configuration Space Information." \
173 if (ConfigurationSpaceCount == 0) {
176 "ERROR: MCFG: Configuration Space Count = %d\n",
177 ConfigurationSpaceCount
179 Status = EFI_INVALID_PARAMETER;
180 ASSERT (ConfigurationSpaceCount != 0);
186 "MCFG: Configuration Space Count = %d\n",
187 ConfigurationSpaceCount
195 if (*Table ==
NULL) {
196 Status = EFI_OUT_OF_RESOURCES;
199 "ERROR: MCFG: Failed to allocate memory for MCFG Table, Size = %d," \
210 "MCFG: Mcfg = 0x%p TableSize = 0x%x\n",
222 if (EFI_ERROR (Status)) {
225 "ERROR: MCFG: Failed to add ACPI header. Status = %r\n",
231 Mcfg->Reserved = EFI_ACPI_RESERVED_QWORD;
236 PciConfigSpaceInfoList,
237 ConfigurationSpaceCount
243 if (*Table !=
NULL) {
272 ASSERT (This !=
NULL);
273 ASSERT (AcpiTableInfo !=
NULL);
274 ASSERT (CfgMgrProtocol !=
NULL);
275 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
276 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
278 if ((Table ==
NULL) || (*Table ==
NULL)) {
279 DEBUG ((DEBUG_ERROR,
"ERROR: MCFG: Invalid Table Pointer\n"));
280 ASSERT ((Table !=
NULL) && (*Table !=
NULL));
281 return EFI_INVALID_PARAMETER;
291#define MCFG_GENERATOR_REVISION CREATE_REVISION (1, 0)
301 L
"ACPI.STD.MCFG.GENERATOR",
343 DEBUG ((DEBUG_INFO,
"MCFG: Register Generator. Status = %r\n", Status));
367 DEBUG ((DEBUG_INFO,
"MCFG: Deregister Generator. Status = %r\n", Status));
#define EFI_ACPI_6_2_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE
EFI_STATUS EFIAPI RegisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
EFI_STATUS EFIAPI DeregisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdMcfg
MCFG Generator.
@ EArchCommonObjPciConfigSpaceInfo
8 - PCI Configuration Space Info
#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)
@ EObjNameSpaceArchCommon
Arch Common Objects Namespace.
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
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 CONST ACPI_TABLE_GENERATOR McfgGenerator
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)
EFI_STATUS EFIAPI AcpiMcfgLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define MCFG_GENERATOR_REVISION
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE MCFG_CFG_SPACE_ADDR
EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER MCFG_TABLE
EFI_STATUS EFIAPI AcpiMcfgLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
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 ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION
EFI_STATUS EFIAPI AddAcpiHeader(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN OUT EFI_ACPI_DESCRIPTION_HEADER *CONST AcpiHeader, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST UINT32 Length)