DynamicTablesPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the DynamicTablesPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:55 -08:00
committed by mergify[bot]
parent 7c34237831
commit 731c67e1d7
85 changed files with 5347 additions and 4795 deletions

View File

@@ -22,7 +22,7 @@
#include "DynamicTableFactory.h"
extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
/** Return a pointer to the ACPI table generator.
@@ -40,13 +40,13 @@ extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
EFI_STATUS
EFIAPI
GetAcpiTableGenerator (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST This,
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST This,
IN CONST ACPI_TABLE_GENERATOR_ID GeneratorId,
OUT CONST ACPI_TABLE_GENERATOR ** CONST Generator
OUT CONST ACPI_TABLE_GENERATOR **CONST Generator
)
{
UINT16 TableId;
EDKII_DYNAMIC_TABLE_FACTORY_INFO * FactoryInfo;
UINT16 TableId;
EDKII_DYNAMIC_TABLE_FACTORY_INFO *FactoryInfo;
ASSERT (This != NULL);
@@ -63,12 +63,13 @@ GetAcpiTableGenerator (
}
*Generator = NULL;
TableId = GET_TABLE_ID (GeneratorId);
TableId = GET_TABLE_ID (GeneratorId);
if (IS_GENERATOR_NAMESPACE_STD (GeneratorId)) {
if (TableId >= EStdAcpiTableIdMax) {
ASSERT (TableId < EStdAcpiTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (FactoryInfo->StdAcpiTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->StdAcpiTableGeneratorList[TableId];
} else {
@@ -79,12 +80,14 @@ GetAcpiTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
return EFI_INVALID_PARAMETER;
}
if (FactoryInfo->CustomAcpiTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->CustomAcpiTableGeneratorList[TableId];
} else {
return EFI_NOT_FOUND;
}
}
return EFI_SUCCESS;
}
@@ -105,7 +108,7 @@ GetAcpiTableGenerator (
EFI_STATUS
EFIAPI
RegisterAcpiTableGenerator (
IN CONST ACPI_TABLE_GENERATOR * CONST Generator
IN CONST ACPI_TABLE_GENERATOR *CONST Generator
)
{
UINT16 TableId;
@@ -132,6 +135,7 @@ RegisterAcpiTableGenerator (
ASSERT (TableId < EStdAcpiTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.StdAcpiTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.StdAcpiTableGeneratorList[TableId] = Generator;
} else {
@@ -142,12 +146,14 @@ RegisterAcpiTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] = Generator;
} else {
return EFI_ALREADY_STARTED;
}
}
return EFI_SUCCESS;
}
@@ -166,7 +172,7 @@ RegisterAcpiTableGenerator (
EFI_STATUS
EFIAPI
DeregisterAcpiTableGenerator (
IN CONST ACPI_TABLE_GENERATOR * CONST Generator
IN CONST ACPI_TABLE_GENERATOR *CONST Generator
)
{
UINT16 TableId;
@@ -191,10 +197,12 @@ DeregisterAcpiTableGenerator (
ASSERT (TableId < EStdAcpiTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.StdAcpiTableGeneratorList[TableId] != NULL) {
if (Generator != TableFactoryInfo.StdAcpiTableGeneratorList[TableId]) {
return EFI_INVALID_PARAMETER;
}
TableFactoryInfo.StdAcpiTableGeneratorList[TableId] = NULL;
} else {
return EFI_NOT_FOUND;
@@ -204,11 +212,14 @@ DeregisterAcpiTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] != NULL) {
if (Generator !=
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId]) {
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId])
{
return EFI_INVALID_PARAMETER;
}
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] = NULL;
} else {
return EFI_NOT_FOUND;

View File

@@ -21,7 +21,7 @@
#include "DynamicTableFactory.h"
extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
/** Return a pointer to the DT table generator.
@@ -39,13 +39,13 @@ extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
EFI_STATUS
EFIAPI
GetDtTableGenerator (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST This,
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST This,
IN CONST DT_TABLE_GENERATOR_ID GeneratorId,
OUT CONST DT_TABLE_GENERATOR ** CONST Generator
OUT CONST DT_TABLE_GENERATOR **CONST Generator
)
{
UINT16 TableId;
EDKII_DYNAMIC_TABLE_FACTORY_INFO * FactoryInfo;
UINT16 TableId;
EDKII_DYNAMIC_TABLE_FACTORY_INFO *FactoryInfo;
ASSERT (This != NULL);
@@ -62,12 +62,13 @@ GetDtTableGenerator (
}
*Generator = NULL;
TableId = GET_TABLE_ID (GeneratorId);
TableId = GET_TABLE_ID (GeneratorId);
if (IS_GENERATOR_NAMESPACE_STD (GeneratorId)) {
if (TableId >= EStdDtTableIdMax) {
ASSERT (TableId < EStdDtTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (FactoryInfo->StdDtTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->StdDtTableGeneratorList[TableId];
} else {
@@ -78,12 +79,14 @@ GetDtTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators));
return EFI_INVALID_PARAMETER;
}
if (FactoryInfo->CustomDtTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->CustomDtTableGeneratorList[TableId];
} else {
return EFI_NOT_FOUND;
}
}
return EFI_SUCCESS;
}
@@ -104,7 +107,7 @@ GetDtTableGenerator (
EFI_STATUS
EFIAPI
RegisterDtTableGenerator (
IN CONST DT_TABLE_GENERATOR * CONST Generator
IN CONST DT_TABLE_GENERATOR *CONST Generator
)
{
UINT16 TableId;
@@ -131,6 +134,7 @@ RegisterDtTableGenerator (
ASSERT (TableId < EStdDtTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.StdDtTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.StdDtTableGeneratorList[TableId] = Generator;
} else {
@@ -141,12 +145,14 @@ RegisterDtTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators));
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.CustomDtTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.CustomDtTableGeneratorList[TableId] = Generator;
} else {
return EFI_ALREADY_STARTED;
}
}
return EFI_SUCCESS;
}
@@ -165,7 +171,7 @@ RegisterDtTableGenerator (
EFI_STATUS
EFIAPI
DeregisterDtTableGenerator (
IN CONST DT_TABLE_GENERATOR * CONST Generator
IN CONST DT_TABLE_GENERATOR *CONST Generator
)
{
UINT16 TableId;
@@ -190,10 +196,12 @@ DeregisterDtTableGenerator (
ASSERT (TableId < EStdDtTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.StdDtTableGeneratorList[TableId] != NULL) {
if (Generator != TableFactoryInfo.StdDtTableGeneratorList[TableId]) {
return EFI_INVALID_PARAMETER;
}
TableFactoryInfo.StdDtTableGeneratorList[TableId] = NULL;
} else {
return EFI_NOT_FOUND;
@@ -203,11 +211,14 @@ DeregisterDtTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators));
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.CustomDtTableGeneratorList[TableId] != NULL) {
if (Generator !=
TableFactoryInfo.CustomDtTableGeneratorList[TableId]) {
TableFactoryInfo.CustomDtTableGeneratorList[TableId])
{
return EFI_INVALID_PARAMETER;
}
TableFactoryInfo.CustomDtTableGeneratorList[TableId] = NULL;
} else {
return EFI_NOT_FOUND;

View File

@@ -22,33 +22,33 @@
typedef struct DynamicTableFactoryInfo {
/// An array for holding the list of Standard ACPI Table Generators.
CONST ACPI_TABLE_GENERATOR *
StdAcpiTableGeneratorList[EStdAcpiTableIdMax];
StdAcpiTableGeneratorList[EStdAcpiTableIdMax];
/// An array for holding the list of Custom ACPI Table Generators.
CONST ACPI_TABLE_GENERATOR *
CustomAcpiTableGeneratorList[FixedPcdGet16 (
PcdMaxCustomACPIGenerators
)];
CustomAcpiTableGeneratorList[FixedPcdGet16 (
PcdMaxCustomACPIGenerators
)];
/// An array for holding the list of Standard SMBIOS Table Generators.
CONST SMBIOS_TABLE_GENERATOR *
StdSmbiosTableGeneratorList[EStdSmbiosTableIdMax];
StdSmbiosTableGeneratorList[EStdSmbiosTableIdMax];
/// An array for holding the list of Custom SMBIOS Table Generators.
CONST SMBIOS_TABLE_GENERATOR *
CustomSmbiosTableGeneratorList[FixedPcdGet16 (
PcdMaxCustomSMBIOSGenerators
)];
CustomSmbiosTableGeneratorList[FixedPcdGet16 (
PcdMaxCustomSMBIOSGenerators
)];
/// An array for holding the list of Standard DT Table Generators.
CONST DT_TABLE_GENERATOR *
StdDtTableGeneratorList[EStdDtTableIdMax];
StdDtTableGeneratorList[EStdDtTableIdMax];
/// An array for holding the list of Custom DT Table Generators.
CONST DT_TABLE_GENERATOR *
CustomDtTableGeneratorList[FixedPcdGet16 (
PcdMaxCustomDTGenerators
)];
CustomDtTableGeneratorList[FixedPcdGet16 (
PcdMaxCustomDTGenerators
)];
} EDKII_DYNAMIC_TABLE_FACTORY_INFO;
/** Return a pointer to the ACPI table generator.
@@ -67,9 +67,9 @@ typedef struct DynamicTableFactoryInfo {
EFI_STATUS
EFIAPI
GetAcpiTableGenerator (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST This,
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST This,
IN CONST ACPI_TABLE_GENERATOR_ID GeneratorId,
OUT CONST ACPI_TABLE_GENERATOR ** CONST Generator
OUT CONST ACPI_TABLE_GENERATOR **CONST Generator
);
/** Return a pointer to the SMBIOS table generator.
@@ -88,9 +88,9 @@ GetAcpiTableGenerator (
EFI_STATUS
EFIAPI
GetSmbiosTableGenerator (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST This,
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST This,
IN CONST SMBIOS_TABLE_GENERATOR_ID GeneratorId,
OUT CONST SMBIOS_TABLE_GENERATOR ** CONST Generator
OUT CONST SMBIOS_TABLE_GENERATOR **CONST Generator
);
/** Return a pointer to the DT table generator.
@@ -109,9 +109,9 @@ GetSmbiosTableGenerator (
EFI_STATUS
EFIAPI
GetDtTableGenerator (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST This,
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST This,
IN CONST DT_TABLE_GENERATOR_ID GeneratorId,
OUT CONST DT_TABLE_GENERATOR ** CONST Generator
OUT CONST DT_TABLE_GENERATOR **CONST Generator
);
#pragma pack()

View File

@@ -27,14 +27,14 @@
/** The Dynamic Table Factory protocol structure that holds the
list of registered ACPI and SMBIOS table generators.
*/
EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
/** A structure describing the Dynamic Table Factory protocol.
*/
STATIC
CONST
EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL DynamicTableFactoryProtocol = {
CREATE_REVISION (1, 0),
EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL DynamicTableFactoryProtocol = {
CREATE_REVISION (1, 0),
GetAcpiTableGenerator,
RegisterAcpiTableGenerator,
DeregisterAcpiTableGenerator,
@@ -60,8 +60,8 @@ EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL DynamicTableFactoryProtocol = {
EFI_STATUS
EFIAPI
DynamicTableFactoryDxeInitialize (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE * SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
@@ -70,7 +70,7 @@ DynamicTableFactoryDxeInitialize (
&ImageHandle,
&gEdkiiDynamicTableFactoryProtocolGuid,
EFI_NATIVE_INTERFACE,
(VOID*)&DynamicTableFactoryProtocol
(VOID *)&DynamicTableFactoryProtocol
);
if (EFI_ERROR (Status)) {
DEBUG ((
@@ -80,5 +80,6 @@ DynamicTableFactoryDxeInitialize (
Status
));
}
return Status;
}

View File

@@ -22,7 +22,7 @@
#include "DynamicTableFactory.h"
extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
/** Return a pointer to the SMBIOS table generator.
@@ -40,13 +40,13 @@ extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
EFI_STATUS
EFIAPI
GetSmbiosTableGenerator (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST This,
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST This,
IN CONST SMBIOS_TABLE_GENERATOR_ID GeneratorId,
OUT CONST SMBIOS_TABLE_GENERATOR ** CONST Generator
OUT CONST SMBIOS_TABLE_GENERATOR **CONST Generator
)
{
UINT16 TableId;
EDKII_DYNAMIC_TABLE_FACTORY_INFO * FactoryInfo;
UINT16 TableId;
EDKII_DYNAMIC_TABLE_FACTORY_INFO *FactoryInfo;
ASSERT (This != NULL);
@@ -63,12 +63,13 @@ GetSmbiosTableGenerator (
}
*Generator = NULL;
TableId = GET_TABLE_ID (GeneratorId);
TableId = GET_TABLE_ID (GeneratorId);
if (IS_GENERATOR_NAMESPACE_STD (GeneratorId)) {
if (TableId >= EStdSmbiosTableIdMax) {
ASSERT (TableId < EStdSmbiosTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (FactoryInfo->StdSmbiosTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->StdSmbiosTableGeneratorList[TableId];
} else {
@@ -79,12 +80,14 @@ GetSmbiosTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators));
return EFI_INVALID_PARAMETER;
}
if (FactoryInfo->CustomSmbiosTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->CustomSmbiosTableGeneratorList[TableId];
} else {
return EFI_NOT_FOUND;
}
}
return EFI_SUCCESS;
}
@@ -105,7 +108,7 @@ GetSmbiosTableGenerator (
EFI_STATUS
EFIAPI
RegisterSmbiosTableGenerator (
IN CONST SMBIOS_TABLE_GENERATOR * CONST Generator
IN CONST SMBIOS_TABLE_GENERATOR *CONST Generator
)
{
UINT16 TableId;
@@ -132,6 +135,7 @@ RegisterSmbiosTableGenerator (
ASSERT (TableId < EStdSmbiosTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] = Generator;
} else {
@@ -142,12 +146,14 @@ RegisterSmbiosTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators));
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] = Generator;
} else {
return EFI_ALREADY_STARTED;
}
}
return EFI_SUCCESS;
}
@@ -166,7 +172,7 @@ RegisterSmbiosTableGenerator (
EFI_STATUS
EFIAPI
DeregisterSmbiosTableGenerator (
IN CONST SMBIOS_TABLE_GENERATOR * CONST Generator
IN CONST SMBIOS_TABLE_GENERATOR *CONST Generator
)
{
UINT16 TableId;
@@ -191,10 +197,12 @@ DeregisterSmbiosTableGenerator (
ASSERT (TableId < EStdSmbiosTableIdMax);
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] != NULL) {
if (Generator != TableFactoryInfo.StdSmbiosTableGeneratorList[TableId]) {
return EFI_INVALID_PARAMETER;
}
TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] = NULL;
} else {
return EFI_NOT_FOUND;
@@ -204,11 +212,14 @@ DeregisterSmbiosTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators));
return EFI_INVALID_PARAMETER;
}
if (TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] != NULL) {
if (Generator !=
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId]) {
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId])
{
return EFI_INVALID_PARAMETER;
}
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] = NULL;
} else {
return EFI_NOT_FOUND;

View File

@@ -56,25 +56,25 @@ STATIC
EFI_STATUS
EFIAPI
BuildAndInstallSingleAcpiTable (
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
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
)
{
EFI_STATUS Status;
EFI_STATUS Status1;
EFI_ACPI_DESCRIPTION_HEADER * AcpiTable;
UINTN TableHandle;
EFI_STATUS Status;
EFI_STATUS Status1;
EFI_ACPI_DESCRIPTION_HEADER *AcpiTable;
UINTN TableHandle;
AcpiTable = NULL;
Status = Generator->BuildAcpiTable (
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable
);
Status = Generator->BuildAcpiTable (
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -122,11 +122,11 @@ exit_handler:
// Free any resources allocated for generating the tables.
if (Generator->FreeTableResources != NULL) {
Status1 = Generator->FreeTableResources (
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable
);
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable
);
if (EFI_ERROR (Status1)) {
DEBUG ((
DEBUG_ERROR,
@@ -142,6 +142,7 @@ exit_handler:
Status = Status1;
}
}
return Status;
}
@@ -170,29 +171,29 @@ 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
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
)
{
EFI_STATUS Status;
EFI_STATUS Status1;
EFI_ACPI_DESCRIPTION_HEADER ** AcpiTable;
UINTN TableCount;
UINTN TableHandle;
UINTN Index;
EFI_STATUS Status;
EFI_STATUS Status1;
EFI_ACPI_DESCRIPTION_HEADER **AcpiTable;
UINTN TableCount;
UINTN TableHandle;
UINTN Index;
AcpiTable = NULL;
AcpiTable = NULL;
TableCount = 0;
Status = Generator->BuildAcpiTableEx (
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable,
&TableCount
);
Status = Generator->BuildAcpiTableEx (
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable,
&TableCount
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -241,12 +242,12 @@ exit_handler:
// Free any resources allocated for generating the tables.
if (Generator->FreeTableResourcesEx != NULL) {
Status1 = Generator->FreeTableResourcesEx (
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable,
TableCount
);
Generator,
AcpiTableInfo,
CfgMgrProtocol,
&AcpiTable,
TableCount
);
if (EFI_ERROR (Status1)) {
DEBUG ((
DEBUG_ERROR,
@@ -262,6 +263,7 @@ exit_handler:
Status = Status1;
}
}
return Status;
}
@@ -289,14 +291,14 @@ 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
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
)
{
EFI_STATUS Status;
CONST ACPI_TABLE_GENERATOR * Generator;
EFI_STATUS Status;
CONST ACPI_TABLE_GENERATOR *Generator;
ASSERT (TableFactoryProtocol != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -312,11 +314,11 @@ BuildAndInstallAcpiTable (
));
Generator = NULL;
Status = TableFactoryProtocol->GetAcpiTableGenerator (
TableFactoryProtocol,
AcpiTableInfo->TableGeneratorId,
&Generator
);
Status = TableFactoryProtocol->GetAcpiTableGenerator (
TableFactoryProtocol,
AcpiTableInfo->TableGeneratorId,
&Generator
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -398,7 +400,7 @@ STATIC
EFI_STATUS
EFIAPI
VerifyMandatoryTablesArePresent (
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN UINT32 AcpiTableCount
)
{
@@ -410,7 +412,7 @@ VerifyMandatoryTablesArePresent (
BOOLEAN Dbg2Found;
BOOLEAN SpcrFound;
Status = EFI_SUCCESS;
Status = EFI_SUCCESS;
FadtFound = FALSE;
MadtFound = FALSE;
GtdtFound = FALSE;
@@ -446,27 +448,33 @@ VerifyMandatoryTablesArePresent (
// We need at least the FADT, MADT, GTDT and the DSDT tables to boot
if (!FadtFound) {
DEBUG ((DEBUG_ERROR,"ERROR: FADT Table not found\n"));
DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found\n"));
Status = EFI_NOT_FOUND;
}
if (!MadtFound) {
DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found.\n"));
Status = EFI_NOT_FOUND;
}
if (!GtdtFound) {
DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found.\n"));
Status = EFI_NOT_FOUND;
}
if (!DsdtFound) {
DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found.\n"));
Status = EFI_NOT_FOUND;
}
if (!Dbg2Found) {
DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not found.\n"));
}
if (!SpcrFound) {
DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not found.\n"));
}
return Status;
}
@@ -488,15 +496,15 @@ STATIC
EFI_STATUS
EFIAPI
ProcessAcpiTables (
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * CONST TableFactoryProtocol,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol
IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST TableFactoryProtocol,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol
)
{
EFI_STATUS Status;
EFI_ACPI_TABLE_PROTOCOL * AcpiTableProtocol;
CM_STD_OBJ_ACPI_TABLE_INFO * AcpiTableInfo;
UINT32 AcpiTableCount;
UINT32 Idx;
EFI_STATUS Status;
EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;
CM_STD_OBJ_ACPI_TABLE_INFO *AcpiTableInfo;
UINT32 AcpiTableCount;
UINT32 Idx;
ASSERT (TableFactoryProtocol != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -505,7 +513,7 @@ ProcessAcpiTables (
Status = gBS->LocateProtocol (
&gEfiAcpiTableProtocolGuid,
NULL,
(VOID**)&AcpiTableProtocol
(VOID **)&AcpiTableProtocol
);
if (EFI_ERROR (Status)) {
DEBUG ((
@@ -564,7 +572,8 @@ ProcessAcpiTables (
// Add the FADT Table first.
for (Idx = 0; Idx < AcpiTableCount; Idx++) {
if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==
AcpiTableInfo[Idx].TableGeneratorId) {
AcpiTableInfo[Idx].TableGeneratorId)
{
Status = BuildAndInstallAcpiTable (
TableFactoryProtocol,
CfgMgrProtocol,
@@ -580,6 +589,7 @@ ProcessAcpiTables (
));
return Status;
}
break;
}
} // for
@@ -595,16 +605,18 @@ ProcessAcpiTables (
// Skip FADT Table since we have already added
if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==
AcpiTableInfo[Idx].TableGeneratorId) {
AcpiTableInfo[Idx].TableGeneratorId)
{
continue;
}
// Skip the Reserved table Generator ID for standard generators
if ((IS_GENERATOR_NAMESPACE_STD (AcpiTableInfo[Idx].TableGeneratorId)) &&
((CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdReserved) >=
AcpiTableInfo[Idx].TableGeneratorId) ||
AcpiTableInfo[Idx].TableGeneratorId) ||
(CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMax) <=
AcpiTableInfo[Idx].TableGeneratorId))) {
AcpiTableInfo[Idx].TableGeneratorId)))
{
DEBUG ((
DEBUG_WARN,
"WARNING: Invalid ACPI Generator table ID = 0x%x, Skipping...\n",
@@ -655,20 +667,20 @@ ProcessAcpiTables (
EFI_STATUS
EFIAPI
DynamicTableManagerDxeInitialize (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE * SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EDKII_CONFIGURATION_MANAGER_PROTOCOL * CfgMgrProtocol;
CM_STD_OBJ_CONFIGURATION_MANAGER_INFO * CfgMfrInfo;
EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL * TableFactoryProtocol;
EFI_STATUS Status;
EDKII_CONFIGURATION_MANAGER_PROTOCOL *CfgMgrProtocol;
CM_STD_OBJ_CONFIGURATION_MANAGER_INFO *CfgMfrInfo;
EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *TableFactoryProtocol;
// Locate the Dynamic Table Factory
Status = gBS->LocateProtocol (
&gEdkiiDynamicTableFactoryProtocolGuid,
NULL,
(VOID**)&TableFactoryProtocol
(VOID **)&TableFactoryProtocol
);
if (EFI_ERROR (Status)) {
DEBUG ((
@@ -684,7 +696,7 @@ DynamicTableManagerDxeInitialize (
Status = gBS->LocateProtocol (
&gEdkiiConfigurationManagerProtocolGuid,
NULL,
(VOID**)&CfgMgrProtocol
(VOID **)&CfgMgrProtocol
);
if (EFI_ERROR (Status)) {
DEBUG ((
@@ -725,5 +737,6 @@ DynamicTableManagerDxeInitialize (
Status
));
}
return Status;
}