33STATIC UINT32 mAcpiVerifyTablesCount;
34STATIC INT32 mAcpiVerifyTablesFadtIndex;
69BuildAndInstallSingleAcpiTable (
89 if (EFI_ERROR (Status)) {
92 "ERROR: Failed to Build Table." \
93 " TableGeneratorId = 0x%x. Status = %r\n",
94 AcpiTableInfo->TableGeneratorId,
101 if (AcpiTable ==
NULL) {
102 Status = EFI_NOT_FOUND;
110 Status = AcpiTableProtocol->InstallAcpiTable (
116 if (EFI_ERROR (Status)) {
119 "ERROR: Failed to Install ACPI Table. Status = %r\n",
128 "INFO: ACPI Table installed. Status = %r\n",
135 Status1 =
Generator->FreeTableResources (
141 if (EFI_ERROR (Status1)) {
144 "ERROR: Failed to Free Table Resources." \
145 "TableGeneratorId = 0x%x. Status = %r\n",
146 AcpiTableInfo->TableGeneratorId,
152 if (!EFI_ERROR (Status)) {
208 if (EFI_ERROR (Status)) {
211 "ERROR: Failed to Build Table." \
212 " TableGeneratorId = 0x%x. Status = %r\n",
213 AcpiTableInfo->TableGeneratorId,
220 if ((AcpiTable ==
NULL) || (TableCount == 0)) {
221 Status = EFI_NOT_FOUND;
225 for (Index = 0; Index < TableCount; Index++) {
229 Status = AcpiTableProtocol->InstallAcpiTable (
232 AcpiTable[Index]->Length,
235 if (EFI_ERROR (Status)) {
238 "ERROR: Failed to Install ACPI Table. Status = %r\n",
247 "INFO: ACPI Table installed. Status = %r\n",
255 Status1 =
Generator->FreeTableResourcesEx (
262 if (EFI_ERROR (Status1)) {
265 "ERROR: Failed to Free Table Resources." \
266 "TableGeneratorId = 0x%x. Status = %r\n",
267 AcpiTableInfo->TableGeneratorId,
273 if (!EFI_ERROR (Status)) {
314 ASSERT (TableFactoryProtocol !=
NULL);
315 ASSERT (CfgMgrProtocol !=
NULL);
316 ASSERT (AcpiTableProtocol !=
NULL);
317 ASSERT (AcpiTableInfo !=
NULL);
321 "INFO: EStdObjAcpiTableList: Address = 0x%p," \
322 " TableGeneratorId = 0x%x\n",
324 AcpiTableInfo->TableGeneratorId
328 Status = TableFactoryProtocol->GetAcpiTableGenerator (
329 TableFactoryProtocol,
330 AcpiTableInfo->TableGeneratorId,
333 if (EFI_ERROR (Status)) {
336 "ERROR: Table Generator not found." \
337 " TableGeneratorId = 0x%x. Status = %r\n",
338 AcpiTableInfo->TableGeneratorId,
345 return EFI_NOT_FOUND;
350 "INFO: Generator found : %s\n",
356 TableFactoryProtocol,
362 if (EFI_ERROR (Status)) {
365 "ERROR: Failed to find build and install ACPI Table." \
371 Status = BuildAndInstallSingleAcpiTable (
372 TableFactoryProtocol,
378 if (EFI_ERROR (Status)) {
381 "ERROR: Failed to find build and install ACPI Table." \
387 Status = EFI_INVALID_PARAMETER;
390 "ERROR: Table Generator does not implement the" \
391 " ACPI_TABLE_GENERATOR_BUILD_TABLE interface." \
392 " TableGeneratorId = 0x%x. Status = %r\n",
393 AcpiTableInfo->TableGeneratorId,
416 IN UINT32 AcpiTableCount
422 UINTN InstalledTableIndex;
424 EFI_ACPI_TABLE_VERSION Version;
427 ASSERT (AcpiTableInfo !=
NULL);
432 while (AcpiTableCount-- != 0) {
433 for (Index = 0; Index < mAcpiVerifyTablesCount; Index++) {
434 if (AcpiTableInfo[AcpiTableCount].AcpiTableSignature ==
mAcpiVerifyTables[Index].AcpiTableSignature) {
445 Status =
gBS->LocateProtocol (&gEfiAcpiSdtProtocolGuid,
NULL, (VOID **)&AcpiSdt);
447 if (EFI_ERROR (Status) || (AcpiSdt ==
NULL)) {
448 DEBUG ((DEBUG_ERROR,
"ERROR: Failed to locate ACPI SDT protocol (0x%p) - %r\n", AcpiSdt, Status));
452 for (Index = 0; Index < mAcpiVerifyTablesCount; Index++) {
454 InstalledTableIndex = 0;
456 Status = AcpiSdt->GetAcpiTable (InstalledTableIndex, (
EFI_ACPI_SDT_HEADER **)&DescHeader, &Version, &Handle);
457 if (EFI_ERROR (Status)) {
461 InstalledTableIndex++;
464 if (!EFI_ERROR (Status)) {
472 for (Index = 0; Index < mAcpiVerifyTablesCount; Index++) {
476 Status = EFI_NOT_FOUND;
483 DEBUG ((DEBUG_ERROR,
"ERROR: %a Table found while already published.\n",
mAcpiVerifyTables[Index].AcpiTableName));
484 Status = EFI_ALREADY_STARTED;
517 UINT32 AcpiTableCount;
520 ASSERT (TableFactoryProtocol !=
NULL);
521 ASSERT (CfgMgrProtocol !=
NULL);
524 Status =
gBS->LocateProtocol (
525 &gEfiAcpiTableProtocolGuid,
527 (VOID **)&AcpiTableProtocol
529 if (EFI_ERROR (Status)) {
532 "ERROR: Failed to find AcpiTable protocol. Status = %r\n",
538 Status = GetEStdObjAcpiTableList (
544 if (EFI_ERROR (Status)) {
547 "ERROR: Failed to get ACPI Table List. Status = %r\n",
553 if (0 == AcpiTableCount) {
556 "ERROR: EStdObjAcpiTableList: AcpiTableCount = %d\n",
559 return EFI_NOT_FOUND;
564 "INFO: EStdObjAcpiTableList: AcpiTableCount = %d\n",
573 if (EFI_ERROR (Status)) {
576 "ERROR: Failed to verify mandatory ACPI Table(s) presence."
584 if ((mAcpiVerifyTablesFadtIndex >= 0) &&
585 ((
mAcpiVerifyTables[mAcpiVerifyTablesFadtIndex].Presence & ACPI_TABLE_PRESENT_INSTALLED) == 0))
588 for (Idx = 0; Idx < AcpiTableCount; Idx++) {
590 AcpiTableInfo[Idx].TableGeneratorId)
593 TableFactoryProtocol,
598 if (EFI_ERROR (Status)) {
601 "ERROR: Failed to find build and install ACPI FADT Table." \
614 for (Idx = 0; Idx < AcpiTableCount; Idx++) {
617 "INFO: AcpiTableInfo[%d].TableGeneratorId = 0x%x\n",
619 AcpiTableInfo[Idx].TableGeneratorId
624 AcpiTableInfo[Idx].TableGeneratorId)
632 AcpiTableInfo[Idx].TableGeneratorId) ||
634 AcpiTableInfo[Idx].TableGeneratorId)))
638 "WARNING: Invalid ACPI Generator table ID = 0x%x, Skipping...\n",
639 AcpiTableInfo[Idx].TableGeneratorId
645 TableFactoryProtocol,
650 if (EFI_ERROR (Status)) {
653 "ERROR: Failed to find, build, and install ACPI Table." \
696 Status =
gBS->LocateProtocol (
699 (VOID **)&TableFactoryProtocol
701 if (EFI_ERROR (Status)) {
704 "ERROR: Failed to find Dynamic Table Factory protocol." \
712 Status =
gBS->LocateProtocol (
715 (VOID **)&CfgMgrProtocol
717 if (EFI_ERROR (Status)) {
720 "ERROR: Failed to find Configuration Manager protocol. Status = %r\n",
727 if (EFI_ERROR (Status)) {
730 "ERROR: Failed to get Configuration Manager info. Status = %r\n",
738 "INFO: Configuration Manager Version = 0x%x, OemID = %c%c%c%c%c%c\n",
740 CfgMfrInfo->
OemId[0],
741 CfgMfrInfo->
OemId[1],
742 CfgMfrInfo->
OemId[2],
743 CfgMfrInfo->
OemId[3],
744 CfgMfrInfo->
OemId[4],
750 &mAcpiVerifyTablesCount,
751 &mAcpiVerifyTablesFadtIndex
753 if (EFI_ERROR (Status)) {
759 if (EFI_ERROR (Status)) {
762 "ERROR: ACPI Table processing failure. Status = %r\n",
#define DUMP_ACPI_TABLE_HEADER(AcpiHeader)
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
@ EStdAcpiTableIdFadt
FADT Generator.
@ EStdAcpiTableIdReserved
Reserved.
EFI_STATUS EFIAPI GetAcpiTablePresenceInfo(OUT ACPI_TABLE_PRESENCE_INFO **PresenceArray, OUT UINT32 *PresenceArrayCount, OUT INT32 *FadtIndex)
#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)
@ EObjNameSpaceStandard
Standard Objects Namespace.
EFI_GUID gEdkiiConfigurationManagerProtocolGuid
EFI_GUID gEdkiiDynamicTableFactoryProtocolGuid
STATIC EFI_STATUS EFIAPI BuildAndInstallAcpiTable(IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST TableFactoryProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo)
STATIC EFI_STATUS EFIAPI VerifyMandatoryTablesArePresent(IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN UINT32 AcpiTableCount)
STATIC ACPI_TABLE_PRESENCE_INFO * mAcpiVerifyTables
STATIC EFI_STATUS EFIAPI BuildAndInstallMultipleAcpiTable(IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST TableFactoryProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo)
STATIC EFI_STATUS EFIAPI ProcessAcpiTables(IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST TableFactoryProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol)
EFI_STATUS EFIAPI DynamicTableManagerDxeInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define ACPI_TABLE_PRESENT_INFO_LIST
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define FeaturePcdGet(TokenName)
@ EStdObjAcpiTableList
1 - ACPI table Info List
#define IS_GENERATOR_NAMESPACE_STD(TableGeneratorId)
EFI_STATUS EFIAPI GetCgfMgrInfo(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT CM_STD_OBJ_CONFIGURATION_MANAGER_INFO **CfgMfrInfo)
UINT32 AcpiTableSignature
Standard UINT32 ACPI signature.
UINT32 Revision
The Configuration Manager Revision.