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

@ -69,6 +69,7 @@ GetAcpiTableGenerator (
ASSERT (TableId < EStdAcpiTableIdMax); ASSERT (TableId < EStdAcpiTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (FactoryInfo->StdAcpiTableGeneratorList[TableId] != NULL) { if (FactoryInfo->StdAcpiTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->StdAcpiTableGeneratorList[TableId]; *Generator = FactoryInfo->StdAcpiTableGeneratorList[TableId];
} else { } else {
@ -79,12 +80,14 @@ GetAcpiTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (FactoryInfo->CustomAcpiTableGeneratorList[TableId] != NULL) { if (FactoryInfo->CustomAcpiTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->CustomAcpiTableGeneratorList[TableId]; *Generator = FactoryInfo->CustomAcpiTableGeneratorList[TableId];
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -132,6 +135,7 @@ RegisterAcpiTableGenerator (
ASSERT (TableId < EStdAcpiTableIdMax); ASSERT (TableId < EStdAcpiTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.StdAcpiTableGeneratorList[TableId] == NULL) { if (TableFactoryInfo.StdAcpiTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.StdAcpiTableGeneratorList[TableId] = Generator; TableFactoryInfo.StdAcpiTableGeneratorList[TableId] = Generator;
} else { } else {
@ -142,12 +146,14 @@ RegisterAcpiTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] == NULL) { if (TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] = Generator; TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] = Generator;
} else { } else {
return EFI_ALREADY_STARTED; return EFI_ALREADY_STARTED;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -191,10 +197,12 @@ DeregisterAcpiTableGenerator (
ASSERT (TableId < EStdAcpiTableIdMax); ASSERT (TableId < EStdAcpiTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.StdAcpiTableGeneratorList[TableId] != NULL) { if (TableFactoryInfo.StdAcpiTableGeneratorList[TableId] != NULL) {
if (Generator != TableFactoryInfo.StdAcpiTableGeneratorList[TableId]) { if (Generator != TableFactoryInfo.StdAcpiTableGeneratorList[TableId]) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
TableFactoryInfo.StdAcpiTableGeneratorList[TableId] = NULL; TableFactoryInfo.StdAcpiTableGeneratorList[TableId] = NULL;
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
@ -204,11 +212,14 @@ DeregisterAcpiTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] != NULL) { if (TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] != NULL) {
if (Generator != if (Generator !=
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId]) { TableFactoryInfo.CustomAcpiTableGeneratorList[TableId])
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] = NULL; TableFactoryInfo.CustomAcpiTableGeneratorList[TableId] = NULL;
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;

View File

@ -68,6 +68,7 @@ GetDtTableGenerator (
ASSERT (TableId < EStdDtTableIdMax); ASSERT (TableId < EStdDtTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (FactoryInfo->StdDtTableGeneratorList[TableId] != NULL) { if (FactoryInfo->StdDtTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->StdDtTableGeneratorList[TableId]; *Generator = FactoryInfo->StdDtTableGeneratorList[TableId];
} else { } else {
@ -78,12 +79,14 @@ GetDtTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (FactoryInfo->CustomDtTableGeneratorList[TableId] != NULL) { if (FactoryInfo->CustomDtTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->CustomDtTableGeneratorList[TableId]; *Generator = FactoryInfo->CustomDtTableGeneratorList[TableId];
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -131,6 +134,7 @@ RegisterDtTableGenerator (
ASSERT (TableId < EStdDtTableIdMax); ASSERT (TableId < EStdDtTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.StdDtTableGeneratorList[TableId] == NULL) { if (TableFactoryInfo.StdDtTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.StdDtTableGeneratorList[TableId] = Generator; TableFactoryInfo.StdDtTableGeneratorList[TableId] = Generator;
} else { } else {
@ -141,12 +145,14 @@ RegisterDtTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.CustomDtTableGeneratorList[TableId] == NULL) { if (TableFactoryInfo.CustomDtTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.CustomDtTableGeneratorList[TableId] = Generator; TableFactoryInfo.CustomDtTableGeneratorList[TableId] = Generator;
} else { } else {
return EFI_ALREADY_STARTED; return EFI_ALREADY_STARTED;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -190,10 +196,12 @@ DeregisterDtTableGenerator (
ASSERT (TableId < EStdDtTableIdMax); ASSERT (TableId < EStdDtTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.StdDtTableGeneratorList[TableId] != NULL) { if (TableFactoryInfo.StdDtTableGeneratorList[TableId] != NULL) {
if (Generator != TableFactoryInfo.StdDtTableGeneratorList[TableId]) { if (Generator != TableFactoryInfo.StdDtTableGeneratorList[TableId]) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
TableFactoryInfo.StdDtTableGeneratorList[TableId] = NULL; TableFactoryInfo.StdDtTableGeneratorList[TableId] = NULL;
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
@ -203,11 +211,14 @@ DeregisterDtTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomDTGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.CustomDtTableGeneratorList[TableId] != NULL) { if (TableFactoryInfo.CustomDtTableGeneratorList[TableId] != NULL) {
if (Generator != if (Generator !=
TableFactoryInfo.CustomDtTableGeneratorList[TableId]) { TableFactoryInfo.CustomDtTableGeneratorList[TableId])
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
TableFactoryInfo.CustomDtTableGeneratorList[TableId] = NULL; TableFactoryInfo.CustomDtTableGeneratorList[TableId] = NULL;
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;

View File

@ -80,5 +80,6 @@ DynamicTableFactoryDxeInitialize (
Status Status
)); ));
} }
return Status; return Status;
} }

View File

@ -69,6 +69,7 @@ GetSmbiosTableGenerator (
ASSERT (TableId < EStdSmbiosTableIdMax); ASSERT (TableId < EStdSmbiosTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (FactoryInfo->StdSmbiosTableGeneratorList[TableId] != NULL) { if (FactoryInfo->StdSmbiosTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->StdSmbiosTableGeneratorList[TableId]; *Generator = FactoryInfo->StdSmbiosTableGeneratorList[TableId];
} else { } else {
@ -79,12 +80,14 @@ GetSmbiosTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (FactoryInfo->CustomSmbiosTableGeneratorList[TableId] != NULL) { if (FactoryInfo->CustomSmbiosTableGeneratorList[TableId] != NULL) {
*Generator = FactoryInfo->CustomSmbiosTableGeneratorList[TableId]; *Generator = FactoryInfo->CustomSmbiosTableGeneratorList[TableId];
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -132,6 +135,7 @@ RegisterSmbiosTableGenerator (
ASSERT (TableId < EStdSmbiosTableIdMax); ASSERT (TableId < EStdSmbiosTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] == NULL) { if (TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] = Generator; TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] = Generator;
} else { } else {
@ -142,12 +146,14 @@ RegisterSmbiosTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] == NULL) { if (TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] == NULL) {
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] = Generator; TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] = Generator;
} else { } else {
return EFI_ALREADY_STARTED; return EFI_ALREADY_STARTED;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -191,10 +197,12 @@ DeregisterSmbiosTableGenerator (
ASSERT (TableId < EStdSmbiosTableIdMax); ASSERT (TableId < EStdSmbiosTableIdMax);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] != NULL) { if (TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] != NULL) {
if (Generator != TableFactoryInfo.StdSmbiosTableGeneratorList[TableId]) { if (Generator != TableFactoryInfo.StdSmbiosTableGeneratorList[TableId]) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] = NULL; TableFactoryInfo.StdSmbiosTableGeneratorList[TableId] = NULL;
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
@ -204,11 +212,14 @@ DeregisterSmbiosTableGenerator (
ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators)); ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomSMBIOSGenerators));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] != NULL) { if (TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] != NULL) {
if (Generator != if (Generator !=
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId]) { TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId])
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] = NULL; TableFactoryInfo.CustomSmbiosTableGeneratorList[TableId] = NULL;
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;

View File

@ -142,6 +142,7 @@ exit_handler:
Status = Status1; Status = Status1;
} }
} }
return Status; return Status;
} }
@ -262,6 +263,7 @@ exit_handler:
Status = Status1; Status = Status1;
} }
} }
return Status; return Status;
} }
@ -449,24 +451,30 @@ VerifyMandatoryTablesArePresent (
DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found\n")); DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found\n"));
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
if (!MadtFound) { if (!MadtFound) {
DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found.\n")); DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found.\n"));
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
if (!GtdtFound) { if (!GtdtFound) {
DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found.\n")); DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found.\n"));
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
if (!DsdtFound) { if (!DsdtFound) {
DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found.\n")); DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found.\n"));
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
if (!Dbg2Found) { if (!Dbg2Found) {
DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not found.\n")); DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not found.\n"));
} }
if (!SpcrFound) { if (!SpcrFound) {
DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not found.\n")); DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not found.\n"));
} }
return Status; return Status;
} }
@ -564,7 +572,8 @@ ProcessAcpiTables (
// Add the FADT Table first. // Add the FADT Table first.
for (Idx = 0; Idx < AcpiTableCount; Idx++) { for (Idx = 0; Idx < AcpiTableCount; Idx++) {
if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) == if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==
AcpiTableInfo[Idx].TableGeneratorId) { AcpiTableInfo[Idx].TableGeneratorId)
{
Status = BuildAndInstallAcpiTable ( Status = BuildAndInstallAcpiTable (
TableFactoryProtocol, TableFactoryProtocol,
CfgMgrProtocol, CfgMgrProtocol,
@ -580,6 +589,7 @@ ProcessAcpiTables (
)); ));
return Status; return Status;
} }
break; break;
} }
} // for } // for
@ -595,7 +605,8 @@ ProcessAcpiTables (
// Skip FADT Table since we have already added // Skip FADT Table since we have already added
if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) == if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==
AcpiTableInfo[Idx].TableGeneratorId) { AcpiTableInfo[Idx].TableGeneratorId)
{
continue; continue;
} }
@ -604,7 +615,8 @@ ProcessAcpiTables (
((CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdReserved) >= ((CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdReserved) >=
AcpiTableInfo[Idx].TableGeneratorId) || AcpiTableInfo[Idx].TableGeneratorId) ||
(CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMax) <= (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMax) <=
AcpiTableInfo[Idx].TableGeneratorId))) { AcpiTableInfo[Idx].TableGeneratorId)))
{
DEBUG (( DEBUG ((
DEBUG_WARN, DEBUG_WARN,
"WARNING: Invalid ACPI Generator table ID = 0x%x, Skipping...\n", "WARNING: Invalid ACPI Generator table ID = 0x%x, Skipping...\n",
@ -725,5 +737,6 @@ DynamicTableManagerDxeInitialize (
Status Status
)); ));
} }
return Status; return Status;
} }

View File

@ -372,4 +372,3 @@ DeregisterAcpiTableGenerator (
#pragma pack() #pragma pack()
#endif // ACPI_TABLE_GENERATOR_H_ #endif // ACPI_TABLE_GENERATOR_H_

View File

@ -494,6 +494,7 @@ typedef struct CmArmNamedComponentNode {
/// Memory access properties : Address size limit /// Memory access properties : Address size limit
UINT8 AddressSizeLimit; UINT8 AddressSizeLimit;
/** ASCII Null terminated string with the full path to /** ASCII Null terminated string with the full path to
the entry in the namespace for this object. the entry in the namespace for this object.
*/ */

View File

@ -173,4 +173,3 @@ DeregisterDtTableGenerator (
#pragma pack() #pragma pack()
#endif // DEVICETREE_TABLE_GENERATOR_H_ #endif // DEVICETREE_TABLE_GENERATOR_H_

View File

@ -228,7 +228,7 @@ EFIAPI
DeregisterSmbiosTableGenerator ( DeregisterSmbiosTableGenerator (
IN CONST SMBIOS_TABLE_GENERATOR *CONST Generator IN CONST SMBIOS_TABLE_GENERATOR *CONST Generator
); );
#pragma pack() #pragma pack()
#endif // SMBIOS_TABLE_GENERATOR_H_ #endif // SMBIOS_TABLE_GENERATOR_H_

View File

@ -244,4 +244,3 @@ typedef enum TableGeneratorNameSpace {
#define GET_MINOR_REVISION(Revision) ((Revision) & MINOR_REVISION_MASK) #define GET_MINOR_REVISION(Revision) ((Revision) & MINOR_REVISION_MASK)
#endif // TABLE_GENERATOR_H_ #endif // TABLE_GENERATOR_H_

View File

@ -263,7 +263,8 @@ FreeDbg2TableEx (
if ((Table == NULL) || if ((Table == NULL) ||
(*Table == NULL) || (*Table == NULL) ||
(TableCount != 2)) { (TableCount != 2))
{
DEBUG ((DEBUG_ERROR, "ERROR: DBG2: Invalid Table Pointer\n")); DEBUG ((DEBUG_ERROR, "ERROR: DBG2: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -272,7 +273,8 @@ FreeDbg2TableEx (
if ((TableList[1] == NULL) || if ((TableList[1] == NULL) ||
(TableList[1]->Signature != (TableList[1]->Signature !=
EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) { EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
{
DEBUG ((DEBUG_ERROR, "ERROR: DBG2: Invalid SSDT table pointer.\n")); DEBUG ((DEBUG_ERROR, "ERROR: DBG2: Invalid SSDT table pointer.\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -337,7 +339,8 @@ BuildDbg2TableEx (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: DBG2: Requested table revision = %d, is not supported." "ERROR: DBG2: Requested table revision = %d, is not supported."
@ -451,7 +454,8 @@ BuildDbg2TableEx (
(SerialPortInfo->PortSubtype == (SerialPortInfo->PortSubtype ==
EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) || EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) ||
(SerialPortInfo->PortSubtype == (SerialPortInfo->PortSubtype ==
EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART)) { EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART))
{
// Initialize the serial port // Initialize the serial port
Status = SetupDebugUart (SerialPortInfo); Status = SetupDebugUart (SerialPortInfo);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@ -547,6 +551,7 @@ AcpiDbg2LibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&Dbg2Generator); Status = RegisterAcpiTableGenerator (&Dbg2Generator);
DEBUG ((DEBUG_INFO, "DBG2: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "DBG2: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -570,6 +575,7 @@ AcpiDbg2LibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&Dbg2Generator); Status = DeregisterAcpiTableGenerator (&Dbg2Generator);
DEBUG ((DEBUG_INFO, "DBG2: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "DBG2: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -385,6 +385,7 @@ FadtAddHypervisorVendorId (
Status Status
)); ));
} }
goto error_handler; goto error_handler;
} }
@ -446,6 +447,7 @@ FadtAddFixedFeatureFlags (
Status Status
)); ));
} }
goto error_handler; goto error_handler;
} }
@ -513,7 +515,8 @@ BuildFadtTable (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: FADT: Requested table revision = %d, is not supported." "ERROR: FADT: Requested table revision = %d, is not supported."
@ -653,6 +656,7 @@ AcpiFadtLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&FadtGenerator); Status = RegisterAcpiTableGenerator (&FadtGenerator);
DEBUG ((DEBUG_INFO, "FADT: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "FADT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -676,6 +680,7 @@ AcpiFadtLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&FadtGenerator); Status = DeregisterAcpiTableGenerator (&FadtGenerator);
DEBUG ((DEBUG_INFO, "FADT: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "FADT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -308,6 +308,7 @@ AddGTBlockTimerFrames (
GtBlockFrame++; GtBlockFrame++;
GTBlockTimerFrameList++; GTBlockTimerFrameList++;
} // for } // for
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -358,7 +359,8 @@ AddGTBlockList (
&GTBlockTimerFrameCount &GTBlockTimerFrameCount
); );
if (EFI_ERROR (Status) || if (EFI_ERROR (Status) ||
(GTBlockTimerFrameCount != GTBlockInfo->GTBlockTimerFrameCount)) { (GTBlockTimerFrameCount != GTBlockInfo->GTBlockTimerFrameCount))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: GTDT: Failed to get Generic Timer Frames. Status = %r\n", "ERROR: GTDT: Failed to get Generic Timer Frames. Status = %r\n",
@ -417,6 +419,7 @@ AddGTBlockList (
GTBlock->Length); GTBlock->Length);
GTBlockInfo++; GTBlockInfo++;
}// for }// for
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -473,7 +476,8 @@ BuildGtdtTable (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: GTDT: Requested table revision = %d, is not supported." "ERROR: GTDT: Requested table revision = %d, is not supported."
@ -546,6 +550,7 @@ BuildGtdtTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) * TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
GTBlockInfo[Idx].GTBlockTimerFrameCount); GTBlockInfo[Idx].GTBlockTimerFrameCount);
} }
@ -658,6 +663,7 @@ error_handler:
FreePool (*Table); FreePool (*Table);
*Table = NULL; *Table = NULL;
} }
return Status; return Status;
} }
@ -750,6 +756,7 @@ AcpiGtdtLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&GtdtGenerator); Status = RegisterAcpiTableGenerator (&GtdtGenerator);
DEBUG ((DEBUG_INFO, "GTDT: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "GTDT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -773,6 +780,7 @@ AcpiGtdtLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&GtdtGenerator); Status = DeregisterAcpiTableGenerator (&GtdtGenerator);
DEBUG ((DEBUG_INFO, "GTDT: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "GTDT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -190,6 +190,7 @@ GetSizeofItsGroupNodes (
(*NodeIndexer)++; (*NodeIndexer)++;
NodeList++; NodeList++;
} }
return Size; return Size;
} }
@ -413,6 +414,7 @@ GetSizeofSmmuV1V2Nodes (
(*NodeIndexer)++; (*NodeIndexer)++;
NodeList++; NodeList++;
} }
return Size; return Size;
} }
@ -484,6 +486,7 @@ GetSizeofSmmuV3Nodes (
(*NodeIndexer)++; (*NodeIndexer)++;
NodeList++; NodeList++;
} }
return Size; return Size;
} }
@ -555,6 +558,7 @@ GetSizeofPmcgNodes (
(*NodeIndexer)++; (*NodeIndexer)++;
NodeList++; NodeList++;
} }
return Size; return Size;
} }
@ -600,8 +604,10 @@ GetNodeOffsetReferencedByToken (
)); ));
return EFI_SUCCESS; return EFI_SUCCESS;
} }
NodeIndexer++; NodeIndexer++;
} }
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"IORT: Node Indexer: Token = %p, Not Found\n", "IORT: Node Indexer: Token = %p, Not Found\n",
@ -900,7 +906,8 @@ AddNamedComponentNodes (
} }
if ((NodeList->IdMappingCount > 0) && if ((NodeList->IdMappingCount > 0) &&
(NodeList->IdMappingToken != CM_NULL_TOKEN)) { (NodeList->IdMappingToken != CM_NULL_TOKEN))
{
// Ids for Named Component // Ids for Named Component
IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)NcNode + IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)NcNode +
NcNode->Node.IdReference); NcNode->Node.IdReference);
@ -1005,7 +1012,8 @@ AddRootComplexNodes (
RcNode->Reserved1[2] = EFI_ACPI_RESERVED_BYTE; RcNode->Reserved1[2] = EFI_ACPI_RESERVED_BYTE;
if ((NodeList->IdMappingCount > 0) && if ((NodeList->IdMappingCount > 0) &&
(NodeList->IdMappingToken != CM_NULL_TOKEN)) { (NodeList->IdMappingToken != CM_NULL_TOKEN))
{
// Ids for Root Complex // Ids for Root Complex
IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)RcNode + IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)RcNode +
RcNode->Node.IdReference); RcNode->Node.IdReference);
@ -1216,7 +1224,8 @@ AddSmmuV1V2Nodes (
// Add PMU Interrupt Array // Add PMU Interrupt Array
if ((SmmuNode->NumPmuInterrupts > 0) && if ((SmmuNode->NumPmuInterrupts > 0) &&
(NodeList->PmuInterruptToken != CM_NULL_TOKEN)) { (NodeList->PmuInterruptToken != CM_NULL_TOKEN))
{
Status = AddSmmuInterruptArray ( Status = AddSmmuInterruptArray (
CfgMgrProtocol, CfgMgrProtocol,
PmuInterruptArray, PmuInterruptArray,
@ -1234,7 +1243,8 @@ AddSmmuV1V2Nodes (
} }
if ((NodeList->IdMappingCount > 0) && if ((NodeList->IdMappingCount > 0) &&
(NodeList->IdMappingToken != CM_NULL_TOKEN)) { (NodeList->IdMappingToken != CM_NULL_TOKEN))
{
// Ids for SMMU v1/v2 Node // Ids for SMMU v1/v2 Node
IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuNode + IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuNode +
SmmuNode->Node.IdReference); SmmuNode->Node.IdReference);
@ -1254,6 +1264,7 @@ AddSmmuV1V2Nodes (
return Status; return Status;
} }
} }
// Next SMMU v1/v2 Node // Next SMMU v1/v2 Node
SmmuNode = (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE *)((UINT8 *)SmmuNode + SmmuNode = (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE *)((UINT8 *)SmmuNode +
SmmuNode->Node.Length); SmmuNode->Node.Length);
@ -1341,7 +1352,8 @@ AddSmmuV3Nodes (
} }
if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) && if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) &&
(SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0)) { (SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0))
{
// If all the SMMU control interrupts are GSIV based, // If all the SMMU control interrupts are GSIV based,
// the DeviceID mapping index field is ignored. // the DeviceID mapping index field is ignored.
SmmuV3Node->DeviceIdMappingIndex = 0; SmmuV3Node->DeviceIdMappingIndex = 0;
@ -1350,7 +1362,8 @@ AddSmmuV3Nodes (
} }
if ((NodeList->IdMappingCount > 0) && if ((NodeList->IdMappingCount > 0) &&
(NodeList->IdMappingToken != CM_NULL_TOKEN)) { (NodeList->IdMappingToken != CM_NULL_TOKEN))
{
// Ids for SMMUv3 node // Ids for SMMUv3 node
IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuV3Node + IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuV3Node +
SmmuV3Node->Node.IdReference); SmmuV3Node->Node.IdReference);
@ -1464,7 +1477,8 @@ AddPmcgNodes (
} }
if ((NodeList->IdMappingCount > 0) && if ((NodeList->IdMappingCount > 0) &&
(NodeList->IdMappingToken != CM_NULL_TOKEN)) { (NodeList->IdMappingToken != CM_NULL_TOKEN))
{
// Ids for PMCG node // Ids for PMCG node
IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)PmcgNode + IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)PmcgNode +
PmcgNode->Node.IdReference); PmcgNode->Node.IdReference);
@ -1566,7 +1580,8 @@ BuildIortTable (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: IORT: Requested table revision = %d, is not supported." "ERROR: IORT: Requested table revision = %d, is not supported."
@ -1737,6 +1752,7 @@ BuildIortTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += NodeSize; TableSize += NodeSize;
DEBUG (( DEBUG ((
@ -1767,6 +1783,7 @@ BuildIortTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += NodeSize; TableSize += NodeSize;
DEBUG (( DEBUG ((
@ -1797,6 +1814,7 @@ BuildIortTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += NodeSize; TableSize += NodeSize;
DEBUG (( DEBUG ((
@ -1827,6 +1845,7 @@ BuildIortTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += NodeSize; TableSize += NodeSize;
DEBUG (( DEBUG ((
@ -1857,6 +1876,7 @@ BuildIortTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += NodeSize; TableSize += NodeSize;
DEBUG (( DEBUG ((
@ -1887,6 +1907,7 @@ BuildIortTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += NodeSize; TableSize += NodeSize;
DEBUG (( DEBUG ((
@ -2089,6 +2110,7 @@ error_handler:
FreePool (*Table); FreePool (*Table);
*Table = NULL; *Table = NULL;
} }
return Status; return Status;
} }
@ -2113,6 +2135,7 @@ FreeIortTableResources (
) )
{ {
ACPI_IORT_GENERATOR *Generator; ACPI_IORT_GENERATOR *Generator;
ASSERT (This != NULL); ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL); ASSERT (AcpiTableInfo != NULL);
ASSERT (CfgMgrProtocol != NULL); ASSERT (CfgMgrProtocol != NULL);
@ -2199,6 +2222,7 @@ AcpiIortLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&IortGenerator.Header); Status = RegisterAcpiTableGenerator (&IortGenerator.Header);
DEBUG ((DEBUG_INFO, "IORT: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "IORT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -2222,6 +2246,7 @@ AcpiIortLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&IortGenerator.Header); Status = DeregisterAcpiTableGenerator (&IortGenerator.Header);
DEBUG ((DEBUG_INFO, "Iort: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "Iort: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -480,7 +480,8 @@ BuildMadtTable (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: MADT: Requested table revision = %d, is not supported." "ERROR: MADT: Requested table revision = %d, is not supported."
@ -708,6 +709,7 @@ error_handler:
FreePool (*Table); FreePool (*Table);
*Table = NULL; *Table = NULL;
} }
return Status; return Status;
} }
@ -800,6 +802,7 @@ AcpiMadtLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&MadtGenerator); Status = RegisterAcpiTableGenerator (&MadtGenerator);
DEBUG ((DEBUG_INFO, "MADT: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "MADT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -823,6 +826,7 @@ AcpiMadtLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&MadtGenerator); Status = DeregisterAcpiTableGenerator (&MadtGenerator);
DEBUG ((DEBUG_INFO, "MADT: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "MADT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -140,7 +140,8 @@ BuildMcfgTable (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: MCFG: Requested table revision = %d, is not supported." "ERROR: MCFG: Requested table revision = %d, is not supported."
@ -160,7 +161,8 @@ BuildMcfgTable (
&ConfigurationSpaceCount &ConfigurationSpaceCount
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, DEBUG ((
DEBUG_ERROR,
"ERROR: MCFG: Failed to get PCI Configuration Space Information." \ "ERROR: MCFG: Failed to get PCI Configuration Space Information." \
" Status = %r\n", " Status = %r\n",
Status Status
@ -242,6 +244,7 @@ error_handler:
FreePool (*Table); FreePool (*Table);
*Table = NULL; *Table = NULL;
} }
return Status; return Status;
} }
@ -334,6 +337,7 @@ AcpiMcfgLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&McfgGenerator); Status = RegisterAcpiTableGenerator (&McfgGenerator);
DEBUG ((DEBUG_INFO, "MCFG: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "MCFG: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -357,6 +361,7 @@ AcpiMcfgLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&McfgGenerator); Status = DeregisterAcpiTableGenerator (&McfgGenerator);
DEBUG ((DEBUG_INFO, "MCFG: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "MCFG: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -192,6 +192,7 @@ GetPpttNodeReferencedByToken (
)); ));
return Status; return Status;
} }
NodeIndexer++; NodeIndexer++;
} }
@ -447,7 +448,8 @@ IsGicCTokenEqual (
IS_ACPI_PROC_ID_VALID (ProcNode2) && IS_ACPI_PROC_ID_VALID (ProcNode2) &&
(ProcNode1->GicCToken != CM_NULL_TOKEN) && (ProcNode1->GicCToken != CM_NULL_TOKEN) &&
(ProcNode2->GicCToken != CM_NULL_TOKEN) && (ProcNode2->GicCToken != CM_NULL_TOKEN) &&
(ProcNode1->GicCToken == ProcNode2->GicCToken)) { (ProcNode1->GicCToken == ProcNode2->GicCToken))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: PPTT: Two Processor Hierarchy Info objects (%d and %d) map to " \ "ERROR: PPTT: Two Processor Hierarchy Info objects (%d and %d) map to " \
@ -594,7 +596,9 @@ AddProcHierarchyNodes (
// Test if the reference is to a 'leaf' node // Test if the reference is to a 'leaf' node
if (IS_PROC_NODE_LEAF ( if (IS_PROC_NODE_LEAF (
((CM_ARM_PROC_HIERARCHY_INFO*)PpttNodeFound->Object))) { ((CM_ARM_PROC_HIERARCHY_INFO *)PpttNodeFound->Object)
))
{
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
@ -909,6 +913,7 @@ AddCacheTypeStructures (
CacheInfoNode->Associativity CacheInfoNode->Associativity
)); ));
} }
#endif #endif
// Note a typecast is needed as the maximum associativity // Note a typecast is needed as the maximum associativity
@ -926,8 +931,8 @@ AddCacheTypeStructures (
// Validate and populate cache line size // Validate and populate cache line size
if ((CacheInfoNode->LineSize < PPTT_ARM_CACHE_LINE_SIZE_MIN) || if ((CacheInfoNode->LineSize < PPTT_ARM_CACHE_LINE_SIZE_MIN) ||
(CacheInfoNode->LineSize > PPTT_ARM_CACHE_LINE_SIZE_MAX)) { (CacheInfoNode->LineSize > PPTT_ARM_CACHE_LINE_SIZE_MAX))
{
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
@ -995,7 +1000,6 @@ AddIdTypeStructures (
PPTT_NODE_INDEXER *IdStructIterator; PPTT_NODE_INDEXER *IdStructIterator;
UINT32 NodeCount; UINT32 NodeCount;
ASSERT ( ASSERT (
(Generator != NULL) && (Generator != NULL) &&
(CfgMgrProtocol != NULL) && (CfgMgrProtocol != NULL) &&
@ -1095,7 +1099,8 @@ BuildPpttTable (
); );
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: PPTT: Requested table revision = %d is not supported. " "ERROR: PPTT: Requested table revision = %d is not supported. "
@ -1213,7 +1218,6 @@ BuildPpttTable (
ProcHierarchyNodeOffset, ProcHierarchyNodeOffset,
Generator->ProcHierarchyNodeIndexedList Generator->ProcHierarchyNodeIndexedList
)); ));
} }
// Include the size of Cache Type Structures and index them // Include the size of Cache Type Structures and index them
@ -1509,6 +1513,7 @@ AcpiPpttLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&PpttGenerator.Header); Status = RegisterAcpiTableGenerator (&PpttGenerator.Header);
DEBUG ((DEBUG_INFO, "PPTT: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "PPTT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -1533,6 +1538,7 @@ AcpiPpttLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&PpttGenerator.Header); Status = DeregisterAcpiTableGenerator (&PpttGenerator.Header);
DEBUG ((DEBUG_INFO, "PPTT: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "PPTT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -114,6 +114,7 @@ AcpiRawLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&RawGenerator); Status = RegisterAcpiTableGenerator (&RawGenerator);
DEBUG ((DEBUG_INFO, "RAW: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "RAW: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -137,6 +138,7 @@ AcpiRawLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&RawGenerator); Status = DeregisterAcpiTableGenerator (&RawGenerator);
DEBUG ((DEBUG_INFO, "RAW: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "RAW: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -138,7 +138,8 @@ FreeSpcrTableEx (
if ((Table == NULL) || if ((Table == NULL) ||
(*Table == NULL) || (*Table == NULL) ||
(TableCount != 2)) { (TableCount != 2))
{
DEBUG ((DEBUG_ERROR, "ERROR: SPCR: Invalid Table Pointer\n")); DEBUG ((DEBUG_ERROR, "ERROR: SPCR: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -147,7 +148,8 @@ FreeSpcrTableEx (
if ((TableList[1] == NULL) || if ((TableList[1] == NULL) ||
(TableList[1]->Signature != (TableList[1]->Signature !=
EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) { EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
{
DEBUG ((DEBUG_ERROR, "ERROR: SPCR: Invalid SSDT table pointer.\n")); DEBUG ((DEBUG_ERROR, "ERROR: SPCR: Invalid SSDT table pointer.\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -212,7 +214,8 @@ BuildSpcrTableEx (
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SPCR: Requested table revision = %d, is not supported." "ERROR: SPCR: Requested table revision = %d, is not supported."
@ -447,6 +450,7 @@ AcpiSpcrLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&SpcrGenerator); Status = RegisterAcpiTableGenerator (&SpcrGenerator);
DEBUG ((DEBUG_INFO, "SPCR: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "SPCR: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -470,6 +474,7 @@ AcpiSpcrLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&SpcrGenerator); Status = DeregisterAcpiTableGenerator (&SpcrGenerator);
DEBUG ((DEBUG_INFO, "SPCR: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "SPCR: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -97,7 +97,6 @@ GET_OBJECT_LIST (
CM_ARM_DEVICE_HANDLE_PCI CM_ARM_DEVICE_HANDLE_PCI
); );
/** Return the PCI Device information in BDF format /** Return the PCI Device information in BDF format
PCI Bus Number - Max 256 busses (Bits 15:8 of BDF) PCI Bus Number - Max 256 busses (Bits 15:8 of BDF)
@ -115,6 +114,7 @@ GetBdf (
) )
{ {
UINT16 Bdf; UINT16 Bdf;
Bdf = (UINT16)DeviceHandlePci->BusNumber << 8; Bdf = (UINT16)DeviceHandlePci->BusNumber << 8;
Bdf |= (DeviceHandlePci->DeviceNumber & 0x1F) << 3; Bdf |= (DeviceHandlePci->DeviceNumber & 0x1F) << 3;
Bdf |= DeviceHandlePci->FunctionNumber & 0x7; Bdf |= DeviceHandlePci->FunctionNumber & 0x7;
@ -165,6 +165,7 @@ AddGICCAffinity (
GicCAff++; GicCAff++;
GicCInfo++; GicCInfo++;
}// while }// while
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -212,6 +213,7 @@ AddGICItsAffinity (
GicItsAff++; GicItsAff++;
GicItsInfo++; GicItsInfo++;
}// while }// while
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -264,10 +266,10 @@ AddMemoryAffinity (
MemAff++; MemAff++;
MemAffInfo++; MemAffInfo++;
}// while }// while
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/** Add the Generic Initiator Affinity Structures in the SRAT Table. /** Add the Generic Initiator Affinity Structures in the SRAT Table.
@param [in] CfgMgrProtocol Pointer to the Configuration Manager @param [in] CfgMgrProtocol Pointer to the Configuration Manager
@ -358,7 +360,8 @@ AddGenericInitiatorAffinity (
GenInitAff->DeviceHandle.Acpi.Reserved[2] = EFI_ACPI_RESERVED_BYTE; GenInitAff->DeviceHandle.Acpi.Reserved[2] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->DeviceHandle.Acpi.Reserved[3] = EFI_ACPI_RESERVED_BYTE; GenInitAff->DeviceHandle.Acpi.Reserved[3] = EFI_ACPI_RESERVED_BYTE;
} else if (GenInitAffInfo->DeviceHandleType == } else if (GenInitAffInfo->DeviceHandleType ==
EFI_ACPI_6_3_PCI_DEVICE_HANDLE) { EFI_ACPI_6_3_PCI_DEVICE_HANDLE)
{
Status = GetEArmObjDeviceHandlePci ( Status = GetEArmObjDeviceHandlePci (
CfgMgrProtocol, CfgMgrProtocol,
GenInitAffInfo->DeviceHandleToken, GenInitAffInfo->DeviceHandleToken,
@ -413,6 +416,7 @@ AddGenericInitiatorAffinity (
GenInitAff++; GenInitAff++;
GenInitAffInfo++; GenInitAffInfo++;
}// while }// while
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -478,7 +482,8 @@ BuildSratTable (
); );
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SRAT: Requested table revision = %d is not supported. " "ERROR: SRAT: Requested table revision = %d is not supported. "
@ -805,6 +810,7 @@ AcpiSratLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&SratGenerator); Status = RegisterAcpiTableGenerator (&SratGenerator);
DEBUG ((DEBUG_INFO, "SRAT: Register Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "SRAT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -828,6 +834,7 @@ AcpiSratLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&SratGenerator); Status = DeregisterAcpiTableGenerator (&SratGenerator);
DEBUG ((DEBUG_INFO, "SRAT: Deregister Generator. Status = %r\n", Status)); DEBUG ((DEBUG_INFO, "SRAT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -71,7 +71,8 @@ ValidateCmn600Info (
CONST CM_ARM_GENERIC_INTERRUPT *DtcInterrupt; CONST CM_ARM_GENERIC_INTERRUPT *DtcInterrupt;
if ((Cmn600InfoList == NULL) || if ((Cmn600InfoList == NULL) ||
(Cmn600Count == 0)) { (Cmn600Count == 0))
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -81,7 +82,8 @@ ValidateCmn600Info (
// At least one DTC is required. // At least one DTC is required.
if ((Cmn600Info->DtcCount == 0) || if ((Cmn600Info->DtcCount == 0) ||
(Cmn600Info->DtcCount > MAX_DTC_COUNT)) { (Cmn600Info->DtcCount > MAX_DTC_COUNT))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CMN-600: Invalid DTC configuration:\n" "ERROR: SSDT-CMN-600: Invalid DTC configuration:\n"
@ -91,7 +93,8 @@ ValidateCmn600Info (
// Check PERIPHBASE and ROOTNODEBASE address spaces are initialized. // Check PERIPHBASE and ROOTNODEBASE address spaces are initialized.
if ((Cmn600Info->PeriphBaseAddress == 0) || if ((Cmn600Info->PeriphBaseAddress == 0) ||
(Cmn600Info->RootNodeBaseAddress == 0)) { (Cmn600Info->RootNodeBaseAddress == 0))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CMN-600: Invalid PERIPHBASE or ROOTNODEBASE.\n" "ERROR: SSDT-CMN-600: Invalid PERIPHBASE or ROOTNODEBASE.\n"
@ -103,7 +106,8 @@ ValidateCmn600Info (
// dimension mesh, and 256MB aligned otherwise. // dimension mesh, and 256MB aligned otherwise.
// Check it is a least 64MB aligned. // Check it is a least 64MB aligned.
if ((Cmn600Info->PeriphBaseAddress & if ((Cmn600Info->PeriphBaseAddress &
(PERIPHBASE_MIN_ADDRESS_LENGTH - 1)) != 0) { (PERIPHBASE_MIN_ADDRESS_LENGTH - 1)) != 0)
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CMN-600: PERIPHBASE address must be 64MB aligned.\n" "ERROR: SSDT-CMN-600: PERIPHBASE address must be 64MB aligned.\n"
@ -123,7 +127,8 @@ ValidateCmn600Info (
// Check the 16 KB alignment of the ROOTNODEBASE address. // Check the 16 KB alignment of the ROOTNODEBASE address.
if ((Cmn600Info->PeriphBaseAddress & if ((Cmn600Info->PeriphBaseAddress &
(ROOTNODEBASE_ADDRESS_LENGTH - 1)) != 0) { (ROOTNODEBASE_ADDRESS_LENGTH - 1)) != 0)
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CMN-600: Root base address must be 16KB aligned.\n" "ERROR: SSDT-CMN-600: Root base address must be 16KB aligned.\n"
@ -135,7 +140,8 @@ ValidateCmn600Info (
// address space. // address space.
if ((Cmn600Info->PeriphBaseAddress > Cmn600Info->RootNodeBaseAddress) || if ((Cmn600Info->PeriphBaseAddress > Cmn600Info->RootNodeBaseAddress) ||
((Cmn600Info->PeriphBaseAddress + Cmn600Info->PeriphBaseAddressLength) < ((Cmn600Info->PeriphBaseAddress + Cmn600Info->PeriphBaseAddressLength) <
(Cmn600Info->RootNodeBaseAddress + ROOTNODEBASE_ADDRESS_LENGTH))) { (Cmn600Info->RootNodeBaseAddress + ROOTNODEBASE_ADDRESS_LENGTH)))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CMN-600:" "ERROR: SSDT-CMN-600:"
@ -147,7 +153,8 @@ ValidateCmn600Info (
for (DtcIndex = 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) { for (DtcIndex = 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) {
DtcInterrupt = &Cmn600Info->DtcInterrupt[DtcIndex]; DtcInterrupt = &Cmn600Info->DtcInterrupt[DtcIndex];
if (((DtcInterrupt->Flags & if (((DtcInterrupt->Flags &
EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) == 0)) { EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) == 0))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CMN-600: DTC Interrupt must be consumer.\n" "ERROR: SSDT-CMN-600: DTC Interrupt must be consumer.\n"
@ -155,7 +162,6 @@ ValidateCmn600Info (
goto error_handler; goto error_handler;
} }
} // for DTC Interrupt } // for DTC Interrupt
} // for Cmn600InfoList } // for Cmn600InfoList
return EFI_SUCCESS; return EFI_SUCCESS;
@ -193,6 +199,7 @@ error_handler:
DtcInterrupt->Flags DtcInterrupt->Flags
)); ));
} // for } // for
DEBUG_CODE_END (); DEBUG_CODE_END ();
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -441,7 +448,8 @@ FreeSsdtCmn600TableResourcesEx (
if ((Table == NULL) || if ((Table == NULL) ||
(*Table == NULL) || (*Table == NULL) ||
(TableCount == 0)) { (TableCount == 0))
{
DEBUG ((DEBUG_ERROR, "ERROR: SSDT-CMN-600: Invalid Table Pointer\n")); DEBUG ((DEBUG_ERROR, "ERROR: SSDT-CMN-600: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -451,7 +459,8 @@ FreeSsdtCmn600TableResourcesEx (
for (Index = 0; Index < TableCount; Index++) { for (Index = 0; Index < TableCount; Index++) {
if ((TableList[Index] != NULL) && if ((TableList[Index] != NULL) &&
(TableList[Index]->Signature == (TableList[Index]->Signature ==
EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) { EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
{
FreePool (TableList[Index]); FreePool (TableList[Index]);
} else { } else {
DEBUG (( DEBUG ((

View File

@ -104,7 +104,8 @@ TokenTableInitialize (
if ((Generator == NULL) || if ((Generator == NULL) ||
(Count == 0) || (Count == 0) ||
(Count >= MAX_NODE_COUNT)) { (Count >= MAX_NODE_COUNT))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -211,7 +212,8 @@ WriteAslName (
UINT8 Index; UINT8 Index;
if ((Value >= MAX_NODE_COUNT) || if ((Value >= MAX_NODE_COUNT) ||
(AslName == NULL)) { (AslName == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -739,12 +741,12 @@ CreateAmlCpuTopologyTree (
// Find the children of the CM_ARM_PROC_HIERARCHY_INFO // Find the children of the CM_ARM_PROC_HIERARCHY_INFO
// currently being handled (i.e. ParentToken == NodeToken). // currently being handled (i.e. ParentToken == NodeToken).
if (Generator->ProcNodeList[Index].ParentToken == NodeToken) { if (Generator->ProcNodeList[Index].ParentToken == NodeToken) {
// Only Cpus (leaf nodes in this tree) have a GicCToken. // Only Cpus (leaf nodes in this tree) have a GicCToken.
// Create a Cpu node. // Create a Cpu node.
if (Generator->ProcNodeList[Index].GicCToken != CM_NULL_TOKEN) { if (Generator->ProcNodeList[Index].GicCToken != CM_NULL_TOKEN) {
if ((Generator->ProcNodeList[Index].Flags & PPTT_PROCESSOR_MASK) != if ((Generator->ProcNodeList[Index].Flags & PPTT_PROCESSOR_MASK) !=
PPTT_CPU_PROCESSOR_MASK) { PPTT_CPU_PROCESSOR_MASK)
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for cpu: 0x%x.\n", "ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for cpu: 0x%x.\n",
@ -767,13 +769,13 @@ CreateAmlCpuTopologyTree (
} }
CpuIndex++; CpuIndex++;
} else { } else {
// If this is not a Cpu, then this is a cluster. // If this is not a Cpu, then this is a cluster.
// Acpi processor Id for clusters is not handled. // Acpi processor Id for clusters is not handled.
if ((Generator->ProcNodeList[Index].Flags & PPTT_PROCESSOR_MASK) != if ((Generator->ProcNodeList[Index].Flags & PPTT_PROCESSOR_MASK) !=
PPTT_CLUSTER_PROCESSOR_MASK) { PPTT_CLUSTER_PROCESSOR_MASK)
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for cluster: 0x%x.\n", "ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for cluster: 0x%x.\n",
@ -865,7 +867,8 @@ CreateTopologyFromProcHierarchy (
for (Index = 0; Index < Generator->ProcNodeCount; Index++) { for (Index = 0; Index < Generator->ProcNodeCount; Index++) {
if ((Generator->ProcNodeList[Index].ParentToken == CM_NULL_TOKEN) && if ((Generator->ProcNodeList[Index].ParentToken == CM_NULL_TOKEN) &&
(Generator->ProcNodeList[Index].Flags & (Generator->ProcNodeList[Index].Flags &
EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL)) { EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL))
{
if (TopLevelProcNodeIndex != MAX_UINT32) { if (TopLevelProcNodeIndex != MAX_UINT32) {
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
@ -875,6 +878,7 @@ CreateTopologyFromProcHierarchy (
ASSERT (0); ASSERT (0);
goto exit_handler; goto exit_handler;
} }
TopLevelProcNodeIndex = Index; TopLevelProcNodeIndex = Index;
} }
} // for } // for
@ -1034,7 +1038,8 @@ BuildSsdtCpuTopologyTable (
&ProcHierarchyNodeCount &ProcHierarchyNodeCount
); );
if (EFI_ERROR (Status) && if (EFI_ERROR (Status) &&
(Status != EFI_NOT_FOUND)) { (Status != EFI_NOT_FOUND))
{
goto exit_handler; goto exit_handler;
} }
@ -1189,6 +1194,7 @@ AcpiSsdtCpuTopologyLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&SsdtCpuTopologyGenerator.Header); Status = RegisterAcpiTableGenerator (&SsdtCpuTopologyGenerator.Header);
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@ -1217,6 +1223,7 @@ AcpiSsdtCpuTopologyLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&SsdtCpuTopologyGenerator.Header); Status = DeregisterAcpiTableGenerator (&SsdtCpuTopologyGenerator.Header);
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,

View File

@ -95,7 +95,8 @@ FreeSsdtSerialPortTableEx (
if ((Table == NULL) || if ((Table == NULL) ||
(*Table == NULL) || (*Table == NULL) ||
(TableCount == 0)) { (TableCount == 0))
{
DEBUG ((DEBUG_ERROR, "ERROR: SSDT-SERIAL-PORT: Invalid Table Pointer\n")); DEBUG ((DEBUG_ERROR, "ERROR: SSDT-SERIAL-PORT: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -105,7 +106,8 @@ FreeSsdtSerialPortTableEx (
for (Index = 0; Index < TableCount; Index++) { for (Index = 0; Index < TableCount; Index++) {
if ((TableList[Index] != NULL) && if ((TableList[Index] != NULL) &&
(TableList[Index]->Signature == (TableList[Index]->Signature ==
EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) { EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
{
Status = FreeSsdtSerialPortTable (TableList[Index]); Status = FreeSsdtSerialPortTable (TableList[Index]);
} else { } else {
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
@ -330,6 +332,7 @@ AcpiSsdtSerialPortLibConstructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = RegisterAcpiTableGenerator (&SsdtSerialPortGenerator); Status = RegisterAcpiTableGenerator (&SsdtSerialPortGenerator);
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@ -358,6 +361,7 @@ AcpiSsdtSerialPortLibDestructor (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
Status = DeregisterAcpiTableGenerator (&SsdtSerialPortGenerator); Status = DeregisterAcpiTableGenerator (&SsdtSerialPortGenerator);
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,

View File

@ -159,7 +159,8 @@ AmlGetEisaIdFromString (
{ {
if ((EisaIdStr == NULL) || if ((EisaIdStr == NULL) ||
(!IsValidPnpId (EisaIdStr)) || (!IsValidPnpId (EisaIdStr)) ||
(EisaIdInt == NULL)) { (EisaIdInt == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -90,18 +90,23 @@ AmlDbgPrintNameSeg (
DEBUG ((DEBUG_INFO, "%c", Buffer[0])); DEBUG ((DEBUG_INFO, "%c", Buffer[0]));
if ((Buffer[1] == AML_NAME_CHAR__) && if ((Buffer[1] == AML_NAME_CHAR__) &&
(Buffer[2] == AML_NAME_CHAR__) && (Buffer[2] == AML_NAME_CHAR__) &&
(Buffer[3] == AML_NAME_CHAR__)) { (Buffer[3] == AML_NAME_CHAR__))
{
return; return;
} }
DEBUG ((DEBUG_INFO, "%c", Buffer[1])); DEBUG ((DEBUG_INFO, "%c", Buffer[1]));
if ((Buffer[2] == AML_NAME_CHAR__) && if ((Buffer[2] == AML_NAME_CHAR__) &&
(Buffer[3] == AML_NAME_CHAR__)) { (Buffer[3] == AML_NAME_CHAR__))
{
return; return;
} }
DEBUG ((DEBUG_INFO, "%c", Buffer[2])); DEBUG ((DEBUG_INFO, "%c", Buffer[2]));
if (Buffer[3] == AML_NAME_CHAR__) { if (Buffer[3] == AML_NAME_CHAR__) {
return; return;
} }
DEBUG ((DEBUG_INFO, "%c", Buffer[3])); DEBUG ((DEBUG_INFO, "%c", Buffer[3]));
return; return;
} }
@ -153,6 +158,7 @@ AmlDbgPrintNameString (
ASSERT (0); ASSERT (0);
return; return;
} }
SegCount = 1; SegCount = 1;
} else if (*Buffer == AML_ZERO_OP) { } else if (*Buffer == AML_ZERO_OP) {
SegCount = 0; SegCount = 0;
@ -231,7 +237,8 @@ AmlDbgPrintDataNode (
DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size)); DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size));
if ((DataNode->DataType == EAmlNodeDataTypeNameString) || if ((DataNode->DataType == EAmlNodeDataTypeNameString) ||
(DataNode->DataType == EAmlNodeDataTypeString)) { (DataNode->DataType == EAmlNodeDataTypeString))
{
AMLDBG_PRINT_CHARS ( AMLDBG_PRINT_CHARS (
DEBUG_INFO, DEBUG_INFO,
(CONST CHAR8 *)DataNode->Buffer, (CONST CHAR8 *)DataNode->Buffer,
@ -300,15 +307,23 @@ AmlDbgPrintObjectNode (
// Print a string corresponding to the field object OpCode/SubOpCode. // Print a string corresponding to the field object OpCode/SubOpCode.
if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) { if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) {
DEBUG ((DEBUG_INFO, "%-15a ", AmlGetFieldOpCodeStr ( DEBUG ((
DEBUG_INFO,
"%-15a ",
AmlGetFieldOpCodeStr (
ObjectNode->AmlByteEncoding->OpCode, ObjectNode->AmlByteEncoding->OpCode,
0 0
))); )
));
} else { } else {
// Print a string corresponding to the object OpCode/SubOpCode. // Print a string corresponding to the object OpCode/SubOpCode.
DEBUG ((DEBUG_INFO, "%-15a | ", AmlGetOpCodeStr ( DEBUG ((
DEBUG_INFO,
"%-15a | ",
AmlGetOpCodeStr (
ObjectNode->AmlByteEncoding->OpCode, ObjectNode->AmlByteEncoding->OpCode,
ObjectNode->AmlByteEncoding->SubOpCode) ObjectNode->AmlByteEncoding->SubOpCode
)
)); ));
} }
@ -532,6 +547,7 @@ AmlDbgDumpRaw (
if ((Length & 0x0F) <= 8) { if ((Length & 0x0F) <= 8) {
PartLineChars += 2; PartLineChars += 2;
} }
while (PartLineChars > 0) { while (PartLineChars > 0) {
DEBUG ((DEBUG_VERBOSE, " ")); DEBUG ((DEBUG_VERBOSE, " "));
PartLineChars--; PartLineChars--;

View File

@ -311,16 +311,20 @@ AmlGetByteEncoding (
// Search the table. // Search the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0])); Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0]));
Index++) { Index++)
{
if ((mAmlByteEncoding[Index].OpCode == OpCode) && if ((mAmlByteEncoding[Index].OpCode == OpCode) &&
(mAmlByteEncoding[Index].SubOpCode == SubOpCode)) { (mAmlByteEncoding[Index].SubOpCode == SubOpCode))
{
if ((mAmlByteEncoding[Index].Attribute & AML_IS_PSEUDO_OPCODE) == if ((mAmlByteEncoding[Index].Attribute & AML_IS_PSEUDO_OPCODE) ==
AML_IS_PSEUDO_OPCODE) { AML_IS_PSEUDO_OPCODE)
{
// A pseudo OpCode cannot be parsed as it is internal to this library. // A pseudo OpCode cannot be parsed as it is internal to this library.
// The MethodInvocation encoding can be detected by NameSpace lookup. // The MethodInvocation encoding can be detected by NameSpace lookup.
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
return &mAmlByteEncoding[Index]; return &mAmlByteEncoding[Index];
} }
} }
@ -350,12 +354,15 @@ AmlGetByteEncodingByOpCode (
// Search the table. // Search the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0])); Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0]));
Index++) { Index++)
{
if ((mAmlByteEncoding[Index].OpCode == OpCode) && if ((mAmlByteEncoding[Index].OpCode == OpCode) &&
(mAmlByteEncoding[Index].SubOpCode == SubOpCode)) { (mAmlByteEncoding[Index].SubOpCode == SubOpCode))
{
return &mAmlByteEncoding[Index]; return &mAmlByteEncoding[Index];
} }
} }
return NULL; return NULL;
} }
@ -391,16 +398,19 @@ AmlGetFieldEncoding (
// Search in the table. // Search in the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlFieldEncoding) / sizeof (mAmlFieldEncoding[0])); Index < (sizeof (mAmlFieldEncoding) / sizeof (mAmlFieldEncoding[0]));
Index++) { Index++)
{
if (mAmlFieldEncoding[Index].OpCode == OpCode) { if (mAmlFieldEncoding[Index].OpCode == OpCode) {
if ((mAmlFieldEncoding[Index].Attribute & AML_IS_PSEUDO_OPCODE) == if ((mAmlFieldEncoding[Index].Attribute & AML_IS_PSEUDO_OPCODE) ==
AML_IS_PSEUDO_OPCODE) { AML_IS_PSEUDO_OPCODE)
{
// A pseudo OpCode cannot be parsed as it is internal to this library. // A pseudo OpCode cannot be parsed as it is internal to this library.
// The NamedField encoding can be detected because it begins with a // The NamedField encoding can be detected because it begins with a
// char. // char.
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
return &mAmlFieldEncoding[Index]; return &mAmlFieldEncoding[Index];
} }
} }
@ -431,17 +441,21 @@ AmlGetFieldEncodingByOpCode (
// Search the table. // Search the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlFieldEncoding) / sizeof (mAmlFieldEncoding[0])); Index < (sizeof (mAmlFieldEncoding) / sizeof (mAmlFieldEncoding[0]));
Index++) { Index++)
{
if ((mAmlFieldEncoding[Index].OpCode == OpCode) && if ((mAmlFieldEncoding[Index].OpCode == OpCode) &&
(mAmlFieldEncoding[Index].SubOpCode == SubOpCode)) { (mAmlFieldEncoding[Index].SubOpCode == SubOpCode))
{
return &mAmlFieldEncoding[Index]; return &mAmlFieldEncoding[Index];
} }
} }
return NULL; return NULL;
} }
// Enable this function for debug. // Enable this function for debug.
#if !defined (MDEPKG_NDEBUG) #if !defined (MDEPKG_NDEBUG)
/** Look for an OpCode/SubOpCode couple in the AML grammar, /** Look for an OpCode/SubOpCode couple in the AML grammar,
and return a corresponding string. and return a corresponding string.
@ -463,9 +477,11 @@ AmlGetOpCodeStr (
// Search the table. // Search the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0])); Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0]));
Index++) { Index++)
{
if ((mAmlByteEncoding[Index].OpCode == OpCode) && if ((mAmlByteEncoding[Index].OpCode == OpCode) &&
(mAmlByteEncoding[Index].SubOpCode == SubOpCode)) { (mAmlByteEncoding[Index].SubOpCode == SubOpCode))
{
return mAmlByteEncoding[Index].Str; return mAmlByteEncoding[Index].Str;
} }
} }
@ -500,7 +516,8 @@ AmlGetFieldOpCodeStr (
// Search the table. // Search the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlFieldEncoding) / sizeof (mAmlFieldEncoding[0])); Index < (sizeof (mAmlFieldEncoding) / sizeof (mAmlFieldEncoding[0]));
Index++) { Index++)
{
if ((mAmlFieldEncoding[Index].OpCode == OpCode)) { if ((mAmlFieldEncoding[Index].OpCode == OpCode)) {
return mAmlFieldEncoding[Index].Str; return mAmlFieldEncoding[Index].Str;
} }
@ -509,6 +526,7 @@ AmlGetFieldOpCodeStr (
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
#endif // MDEPKG_NDEBUG #endif // MDEPKG_NDEBUG
/** Check whether the OpCode/SubOpcode couple is a valid entry /** Check whether the OpCode/SubOpcode couple is a valid entry
@ -532,12 +550,15 @@ AmlIsOpCodeValid (
// Search the table. // Search the table.
for (Index = 0; for (Index = 0;
Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0])); Index < (sizeof (mAmlByteEncoding) / sizeof (mAmlByteEncoding[0]));
Index++) { Index++)
{
if ((mAmlByteEncoding[Index].OpCode == OpCode) && if ((mAmlByteEncoding[Index].OpCode == OpCode) &&
(mAmlByteEncoding[Index].SubOpCode == SubOpCode)) { (mAmlByteEncoding[Index].SubOpCode == SubOpCode))
{
return TRUE; return TRUE;
} }
} }
return FALSE; return FALSE;
} }
@ -577,7 +598,8 @@ AmlTypeToNodeDataType (
) )
{ {
if (AmlType >= if (AmlType >=
(sizeof (mAmlTypeToNodeDataType) / sizeof (mAmlTypeToNodeDataType[0]))) { (sizeof (mAmlTypeToNodeDataType) / sizeof (mAmlTypeToNodeDataType[0])))
{
ASSERT (0); ASSERT (0);
return EAmlNodeDataTypeNone; return EAmlNodeDataTypeNone;
} }
@ -607,7 +629,8 @@ AmlGetPkgLength (
UINT32 Offset; UINT32 Offset;
if ((Buffer == NULL) || if ((Buffer == NULL) ||
(PkgLength == NULL)) { (PkgLength == NULL))
{
ASSERT (0); ASSERT (0);
return 0; return 0;
} }
@ -720,7 +743,6 @@ AmlSetPkgLength (
if ((Length < (1 << 6))) { if ((Length < (1 << 6))) {
// Length < 2^6, only need one byte to encode it. // Length < 2^6, only need one byte to encode it.
LeadByte = (UINT8)Length; LeadByte = (UINT8)Length;
} else { } else {
// Need more than one byte to encode it. // Need more than one byte to encode it.
// Test Length to find how many bytes are needed. // Test Length to find how many bytes are needed.
@ -729,19 +751,15 @@ AmlSetPkgLength (
// Length >= 2^28, should not be possible. // Length >= 2^28, should not be possible.
ASSERT (0); ASSERT (0);
return 0; return 0;
} else if (Length >= (1 << 20)) { } else if (Length >= (1 << 20)) {
// Length >= 2^20 // Length >= 2^20
Offset = 3; Offset = 3;
} else if (Length >= (1 << 12)) { } else if (Length >= (1 << 12)) {
// Length >= 2^12 // Length >= 2^12
Offset = 2; Offset = 2;
} else if (Length >= (1 << 6)) { } else if (Length >= (1 << 6)) {
// Length >= 2^6 // Length >= 2^6
Offset = 1; Offset = 1;
} else { } else {
// Should not be possible. // Should not be possible.
ASSERT (0); ASSERT (0);
@ -786,15 +804,12 @@ AmlComputePkgLengthWidth (
if (Length >= (1 << 28)) { if (Length >= (1 << 28)) {
ASSERT (0); ASSERT (0);
return 0; return 0;
} else if (Length >= (1 << 20)) { } else if (Length >= (1 << 20)) {
// Length >= 2^20 // Length >= 2^20
return 4; return 4;
} else if (Length >= (1 << 12)) { } else if (Length >= (1 << 12)) {
// Length >= 2^12 // Length >= 2^12
return 3; return 3;
} else if (Length >= (1 << 6)) { } else if (Length >= (1 << 6)) {
// Length >= 2^6 // Length >= 2^6
return 2; return 2;
@ -874,7 +889,8 @@ AmlComputePkgLength (
ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Length); ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Length);
if (ReComputedPkgLenWidth != PkgLenWidth) { if (ReComputedPkgLenWidth != PkgLenWidth) {
if ((ReComputedPkgLenWidth != 0) && if ((ReComputedPkgLenWidth != 0) &&
(ReComputedPkgLenWidth < 4)) { (ReComputedPkgLenWidth < 4))
{
// No need to recompute the PkgLen since a new threshold cannot // No need to recompute the PkgLen since a new threshold cannot
// be reached by incrementing the value by one. // be reached by incrementing the value by one.
Length += 1; Length += 1;

View File

@ -218,6 +218,7 @@ AmlGetFieldEncodingByOpCode (
// Enable this function for debug. // Enable this function for debug.
#if !defined (MDEPKG_NDEBUG) #if !defined (MDEPKG_NDEBUG)
/** Look for an OpCode/SubOpCode couple in the AML grammar, /** Look for an OpCode/SubOpCode couple in the AML grammar,
and return a corresponding string. and return a corresponding string.
@ -249,6 +250,7 @@ AmlGetFieldOpCodeStr (
IN UINT8 OpCode, IN UINT8 OpCode,
IN UINT8 SubOpCode IN UINT8 SubOpCode
); );
#endif // MDEPKG_NDEBUG #endif // MDEPKG_NDEBUG
/** Check whether the OpCode/SubOpcode couple is a valid entry /** Check whether the OpCode/SubOpcode couple is a valid entry
@ -372,4 +374,3 @@ AmlComputePkgLength (
); );
#endif // AML_H_ #endif // AML_H_

View File

@ -53,7 +53,8 @@ AmlDeviceOpUpdateName (
if ((DeviceOpNode == NULL) || if ((DeviceOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)DeviceOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)DeviceOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (DeviceOpNode, AML_EXT_OP, AML_EXT_DEVICE_OP)) || (!AmlNodeHasOpCode (DeviceOpNode, AML_EXT_OP, AML_EXT_DEVICE_OP)) ||
(NewNameString == NULL)) { (NewNameString == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -66,7 +67,8 @@ AmlDeviceOpUpdateName (
); );
if ((DeviceNameDataNode == NULL) || if ((DeviceNameDataNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)DeviceNameDataNode) != EAmlNodeData) || (AmlGetNodeType ((AML_NODE_HANDLE)DeviceNameDataNode) != EAmlNodeData) ||
(!AmlNodeHasDataType (DeviceNameDataNode, EAmlNodeDataTypeNameString))) { (!AmlNodeHasDataType (DeviceNameDataNode, EAmlNodeDataTypeNameString)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -124,7 +126,8 @@ AmlNameOpUpdateInteger (
if ((NameOpNode == NULL) || if ((NameOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))) { (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -138,7 +141,8 @@ AmlNameOpUpdateInteger (
EAmlParseIndexTerm1 EAmlParseIndexTerm1
); );
if ((IntegerOpNode == NULL) || if ((IntegerOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)IntegerOpNode) != EAmlNodeObject)) { (AmlGetNodeType ((AML_NODE_HANDLE)IntegerOpNode) != EAmlNodeObject))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -180,7 +184,8 @@ AmlNameOpUpdateString (
if ((NameOpNode == NULL) || if ((NameOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))) { (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -193,7 +198,8 @@ AmlNameOpUpdateString (
EAmlParseIndexTerm1 EAmlParseIndexTerm1
); );
if ((StringOpNode == NULL) || if ((StringOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)StringOpNode) != EAmlNodeObject)) { (AmlGetNodeType ((AML_NODE_HANDLE)StringOpNode) != EAmlNodeObject))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -205,7 +211,8 @@ AmlNameOpUpdateString (
EAmlParseIndexTerm0 EAmlParseIndexTerm0
); );
if ((StringDataNode == NULL) || if ((StringDataNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)StringDataNode) != EAmlNodeData)) { (AmlGetNodeType ((AML_NODE_HANDLE)StringDataNode) != EAmlNodeData))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -260,7 +267,8 @@ AmlNameOpGetFirstRdNode (
if ((NameOpNode == NULL) || if ((NameOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)) || (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)) ||
(OutRdNode == NULL)) { (OutRdNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -275,7 +283,8 @@ AmlNameOpGetFirstRdNode (
); );
if ((BufferOpNode == NULL) || if ((BufferOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)BufferOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)BufferOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0))) { (!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -288,7 +297,8 @@ AmlNameOpGetFirstRdNode (
); );
if ((FirstRdNode == NULL) || if ((FirstRdNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)FirstRdNode) != EAmlNodeData) || (AmlGetNodeType ((AML_NODE_HANDLE)FirstRdNode) != EAmlNodeData) ||
(!AmlNodeHasDataType (FirstRdNode, EAmlNodeDataTypeResourceData))) { (!AmlNodeHasDataType (FirstRdNode, EAmlNodeDataTypeResourceData)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -337,7 +347,8 @@ AmlNameOpGetNextRdNode (
if ((CurrRdNode == NULL) || if ((CurrRdNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)CurrRdNode) != EAmlNodeData) || (AmlGetNodeType ((AML_NODE_HANDLE)CurrRdNode) != EAmlNodeData) ||
(!AmlNodeHasDataType (CurrRdNode, EAmlNodeDataTypeResourceData)) || (!AmlNodeHasDataType (CurrRdNode, EAmlNodeDataTypeResourceData)) ||
(OutRdNode == NULL)) { (OutRdNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -349,7 +360,8 @@ AmlNameOpGetNextRdNode (
(AML_NODE_HANDLE)CurrRdNode (AML_NODE_HANDLE)CurrRdNode
); );
if ((BufferOpNode == NULL) || if ((BufferOpNode == NULL) ||
(!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0))) { (!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -359,7 +371,8 @@ AmlNameOpGetNextRdNode (
(AML_NODE_HANDLE)BufferOpNode (AML_NODE_HANDLE)BufferOpNode
); );
if ((NameOpNode == NULL) || if ((NameOpNode == NULL) ||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))) { (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -372,7 +385,9 @@ AmlNameOpGetNextRdNode (
// If the Resource Data is an End Tag, return NULL. // If the Resource Data is an End Tag, return NULL.
if (AmlNodeHasRdDataType ( if (AmlNodeHasRdDataType (
*OutRdNode, *OutRdNode,
AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) { AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME)
))
{
*OutRdNode = NULL; *OutRdNode = NULL;
} }

View File

@ -59,7 +59,8 @@ AmlNameOpCompareName (
if ((NameOpNode == NULL) || if ((NameOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)) || (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)) ||
(AslName == NULL)) { (AslName == NULL))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -72,7 +73,8 @@ AmlNameOpCompareName (
); );
if ((NameDataNode == NULL) || if ((NameDataNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)NameDataNode) != EAmlNodeData) || (AmlGetNodeType ((AML_NODE_HANDLE)NameDataNode) != EAmlNodeData) ||
(!AmlNodeHasDataType (NameDataNode, EAmlNodeDataTypeNameString))) { (!AmlNodeHasDataType (NameDataNode, EAmlNodeDataTypeNameString)))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -144,7 +146,8 @@ AmlNodeHasOpCode (
// Check the OpCode and SubOpCode. // Check the OpCode and SubOpCode.
if ((OpCode != NodeOpCode) || if ((OpCode != NodeOpCode) ||
(SubOpCode != NodeSubOpCode)) { (SubOpCode != NodeSubOpCode))
{
return FALSE; return FALSE;
} }

View File

@ -54,11 +54,15 @@ AmlUpdateRdInterrupt (
(AmlGetNodeType ((AML_NODE_HANDLE)InterruptRdNode) != EAmlNodeData) || (AmlGetNodeType ((AML_NODE_HANDLE)InterruptRdNode) != EAmlNodeData) ||
(!AmlNodeHasDataType ( (!AmlNodeHasDataType (
InterruptRdNode, InterruptRdNode,
EAmlNodeDataTypeResourceData)) || EAmlNodeDataTypeResourceData
)) ||
(!AmlNodeHasRdDataType ( (!AmlNodeHasRdDataType (
InterruptRdNode, InterruptRdNode,
AML_RD_BUILD_LARGE_DESC_ID ( AML_RD_BUILD_LARGE_DESC_ID (
ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME)))) { ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME
)
)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -121,6 +125,7 @@ error_handler:
if (QueryBuffer != NULL) { if (QueryBuffer != NULL) {
FreePool (QueryBuffer); FreePool (QueryBuffer);
} }
return Status; return Status;
} }
@ -171,13 +176,17 @@ AmlUpdateRdInterruptEx (
(AmlGetNodeType ((AML_NODE_HANDLE)InterruptRdNode) != EAmlNodeData) || (AmlGetNodeType ((AML_NODE_HANDLE)InterruptRdNode) != EAmlNodeData) ||
(!AmlNodeHasDataType ( (!AmlNodeHasDataType (
InterruptRdNode, InterruptRdNode,
EAmlNodeDataTypeResourceData)) || EAmlNodeDataTypeResourceData
)) ||
(!AmlNodeHasRdDataType ( (!AmlNodeHasRdDataType (
InterruptRdNode, InterruptRdNode,
AML_RD_BUILD_LARGE_DESC_ID ( AML_RD_BUILD_LARGE_DESC_ID (
ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME))) || ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME
)
)) ||
(IrqList == NULL) || (IrqList == NULL) ||
(IrqCount == 0)) { (IrqCount == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -260,7 +269,10 @@ AmlUpdateRdQWord (
(!AmlNodeHasRdDataType ( (!AmlNodeHasRdDataType (
QWordRdNode, QWordRdNode,
AML_RD_BUILD_LARGE_DESC_ID ( AML_RD_BUILD_LARGE_DESC_ID (
ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME)))) { ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME
)
)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -316,5 +328,6 @@ error_handler:
if (QueryBuffer != NULL) { if (QueryBuffer != NULL) {
FreePool (QueryBuffer); FreePool (QueryBuffer);
} }
return Status; return Status;
} }

View File

@ -102,7 +102,8 @@ AmlCodeGenDefinitionBlock (
if ((TableSignature == NULL) || if ((TableSignature == NULL) ||
(OemId == NULL) || (OemId == NULL) ||
(OemTableId == NULL) || (OemTableId == NULL) ||
(NewRootNode == NULL)) { (NewRootNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -145,7 +146,8 @@ AmlCodeGenString (
AML_DATA_NODE *DataNode; AML_DATA_NODE *DataNode;
if ((String == NULL) || if ((String == NULL) ||
(NewObjectNode == NULL)) { (NewObjectNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -315,6 +317,7 @@ error_handler:
if (DataNode != NULL) { if (DataNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)DataNode); AmlDeleteTree ((AML_NODE_HEADER *)DataNode);
} }
return Status; return Status;
} }
@ -355,7 +358,8 @@ AmlCodeGenBuffer (
// Buffer and BufferSize must be either both set, or both clear. // Buffer and BufferSize must be either both set, or both clear.
if ((NewObjectNode == NULL) || if ((NewObjectNode == NULL) ||
((Buffer == NULL) != (BufferSize == 0))) { ((Buffer == NULL) != (BufferSize == 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -446,12 +450,15 @@ error_handler:
if (BufferSizeNode != NULL) { if (BufferSizeNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)BufferSizeNode); AmlDeleteTree ((AML_NODE_HEADER *)BufferSizeNode);
} }
if (BufferNode != NULL) { if (BufferNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)BufferNode); AmlDeleteTree ((AML_NODE_HEADER *)BufferNode);
} }
if (DataNode != NULL) { if (DataNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)DataNode); AmlDeleteTree ((AML_NODE_HEADER *)DataNode);
} }
return Status; return Status;
} }
@ -540,7 +547,8 @@ AmlCodeGenName (
if ((NameString == NULL) || if ((NameString == NULL) ||
(Object == NULL) || (Object == NULL) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -664,7 +672,8 @@ AmlCodeGenNameString (
if ((NameString == NULL) || if ((NameString == NULL) ||
(String == NULL) || (String == NULL) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -721,7 +730,8 @@ AmlCodeGenNameInteger (
AML_OBJECT_NODE *ObjectNode; AML_OBJECT_NODE *ObjectNode;
if ((NameString == NULL) || if ((NameString == NULL) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -779,7 +789,8 @@ AmlCodeGenDevice (
UINT32 AmlNameStringSize; UINT32 AmlNameStringSize;
if ((NameString == NULL) || if ((NameString == NULL) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -892,7 +903,8 @@ AmlCodeGenScope (
UINT32 AmlNameStringSize; UINT32 AmlNameStringSize;
if ((NameString == NULL) || if ((NameString == NULL) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1028,7 +1040,8 @@ AmlCodeGenMethod (
if ((NameString == NULL) || if ((NameString == NULL) ||
(NumArgs > 6) || (NumArgs > 6) ||
(SyncLevel > 15) || (SyncLevel > 15) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1145,6 +1158,7 @@ error_handler2:
if (ObjectNode != NULL) { if (ObjectNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)ObjectNode); AmlDeleteTree ((AML_NODE_HEADER *)ObjectNode);
} }
if (DataNode != NULL) { if (DataNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)DataNode); AmlDeleteTree ((AML_NODE_HEADER *)DataNode);
} }
@ -1153,6 +1167,7 @@ error_handler1:
if (AmlNameString != NULL) { if (AmlNameString != NULL) {
FreePool (AmlNameString); FreePool (AmlNameString);
} }
return Status; return Status;
} }
@ -1201,7 +1216,11 @@ AmlCodeGenReturn (
((ParentNode == NULL) && (NewObjectNode == NULL)) || ((ParentNode == NULL) && (NewObjectNode == NULL)) ||
((ParentNode != NULL) && ((ParentNode != NULL) &&
!AmlNodeCompareOpCode ( !AmlNodeCompareOpCode (
(AML_OBJECT_NODE*)ParentNode, AML_METHOD_OP, 0))) { (AML_OBJECT_NODE *)ParentNode,
AML_METHOD_OP,
0
)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1244,9 +1263,11 @@ error_handler:
if (ReturnNode != NULL) { if (ReturnNode != NULL) {
AmlDeleteTree (ReturnNode); AmlDeleteTree (ReturnNode);
} }
if (ObjectNode != NULL) { if (ObjectNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)ObjectNode); AmlDeleteTree ((AML_NODE_HEADER *)ObjectNode);
} }
return Status; return Status;
} }
@ -1334,6 +1355,7 @@ exit_handler:
if (AmlNameString != NULL) { if (AmlNameString != NULL) {
FreePool (AmlNameString); FreePool (AmlNameString);
} }
return Status; return Status;
} }
@ -1392,7 +1414,8 @@ AmlCodeGenMethodRetNameString (
AML_OBJECT_NODE_HANDLE MethodNode; AML_OBJECT_NODE_HANDLE MethodNode;
if ((MethodNameString == NULL) || if ((MethodNameString == NULL) ||
((ParentNode == NULL) && (NewObjectNode == NULL))) { ((ParentNode == NULL) && (NewObjectNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1440,6 +1463,7 @@ error_handler:
if (MethodNode != NULL) { if (MethodNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)MethodNode); AmlDeleteTree ((AML_NODE_HANDLE)MethodNode);
} }
return Status; return Status;
} }
@ -1490,7 +1514,8 @@ AmlCreateLpiNode (
AML_OBJECT_NODE_HANDLE IntegerNode; AML_OBJECT_NODE_HANDLE IntegerNode;
if ((LpiNameString == NULL) || if ((LpiNameString == NULL) ||
((ParentNode == NULL) && (NewLpiNode == NULL))) { ((ParentNode == NULL) && (NewLpiNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1573,6 +1598,7 @@ error_handler:
if (IntegerNode != NULL) { if (IntegerNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)IntegerNode); AmlDeleteTree ((AML_NODE_HANDLE)IntegerNode);
} }
return Status; return Status;
} }
@ -1659,7 +1685,8 @@ AmlAddLpiState (
if ((LpiNode == NULL) || if ((LpiNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)LpiNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)LpiNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (LpiNode, AML_NAME_OP, 0))) { (!AmlNodeHasOpCode (LpiNode, AML_NAME_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1683,7 +1710,8 @@ AmlAddLpiState (
); );
if ((PackageNode == NULL) || if ((PackageNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)PackageNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)PackageNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (PackageNode, AML_PACKAGE_OP, 0))) { (!AmlNodeHasOpCode (PackageNode, AML_PACKAGE_OP, 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1706,6 +1734,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
Status = AmlUpdateInteger (CountNode, Count + 1); Status = AmlUpdateInteger (CountNode, Count + 1);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
@ -1725,6 +1754,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1733,6 +1763,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
// WorstCaseWakeLatency // WorstCaseWakeLatency
@ -1742,6 +1773,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1750,6 +1782,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
// Flags // Flags
@ -1759,6 +1792,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1767,6 +1801,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
// ArchFlags // ArchFlags
@ -1776,6 +1811,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1784,6 +1820,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
// ResCntFreq // ResCntFreq
@ -1793,6 +1830,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1801,6 +1839,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
// EnableParentState // EnableParentState
@ -1810,6 +1849,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1818,6 +1858,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
// Entry Method // Entry Method
@ -1829,6 +1870,7 @@ AmlAddLpiState (
ResourceTemplateNode = NULL; ResourceTemplateNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlCodeGenRdRegister ( Status = AmlCodeGenRdRegister (
GenericRegisterDescriptor->AddressSpaceId, GenericRegisterDescriptor->AddressSpaceId,
GenericRegisterDescriptor->RegisterBitWidth, GenericRegisterDescriptor->RegisterBitWidth,
@ -1849,6 +1891,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
RdNode = NULL; RdNode = NULL;
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
@ -1859,6 +1902,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
ResourceTemplateNode = NULL; ResourceTemplateNode = NULL;
} else { } else {
// Entry Method: As an integer // Entry Method: As an integer
@ -1868,6 +1912,7 @@ AmlAddLpiState (
IntegerNode = NULL; IntegerNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)IntegerNode (AML_NODE_HANDLE)IntegerNode
@ -1876,6 +1921,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
IntegerNode = NULL; IntegerNode = NULL;
} }
@ -1886,6 +1932,7 @@ AmlAddLpiState (
ResourceTemplateNode = NULL; ResourceTemplateNode = NULL;
goto error_handler; goto error_handler;
} }
if (ResidencyCounterRegister != NULL) { if (ResidencyCounterRegister != NULL) {
Status = AmlCodeGenRdRegister ( Status = AmlCodeGenRdRegister (
ResidencyCounterRegister->AddressSpaceId, ResidencyCounterRegister->AddressSpaceId,
@ -1907,6 +1954,7 @@ AmlAddLpiState (
&RdNode &RdNode
); );
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
RdNode = NULL; RdNode = NULL;
@ -1918,6 +1966,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
RdNode = NULL; RdNode = NULL;
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
@ -1928,6 +1977,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
ResourceTemplateNode = NULL; ResourceTemplateNode = NULL;
// Usage Counter Register. // Usage Counter Register.
@ -1937,6 +1987,7 @@ AmlAddLpiState (
ResourceTemplateNode = NULL; ResourceTemplateNode = NULL;
goto error_handler; goto error_handler;
} }
if (UsageCounterRegister != NULL) { if (UsageCounterRegister != NULL) {
Status = AmlCodeGenRdRegister ( Status = AmlCodeGenRdRegister (
UsageCounterRegister->AddressSpaceId, UsageCounterRegister->AddressSpaceId,
@ -1958,6 +2009,7 @@ AmlAddLpiState (
&RdNode &RdNode
); );
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
RdNode = NULL; RdNode = NULL;
@ -1969,6 +2021,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
RdNode = NULL; RdNode = NULL;
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
@ -1979,6 +2032,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
ResourceTemplateNode = NULL; ResourceTemplateNode = NULL;
// State name. // State name.
@ -1987,11 +2041,13 @@ AmlAddLpiState (
} else { } else {
Status = AmlCodeGenString ("", &StringNode); Status = AmlCodeGenString ("", &StringNode);
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
StringNode = NULL; StringNode = NULL;
goto error_handler; goto error_handler;
} }
Status = AmlVarListAddTail ( Status = AmlVarListAddTail (
(AML_NODE_HANDLE)NewLpiPackageNode, (AML_NODE_HANDLE)NewLpiPackageNode,
(AML_NODE_HANDLE)StringNode (AML_NODE_HANDLE)StringNode
@ -2000,6 +2056,7 @@ AmlAddLpiState (
ASSERT (0); ASSERT (0);
goto error_handler; goto error_handler;
} }
StringNode = NULL; StringNode = NULL;
// Add the new LPI state to the LpiNode. // Add the new LPI state to the LpiNode.
@ -2018,15 +2075,19 @@ error_handler:
if (RdNode != NULL) { if (RdNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)RdNode); AmlDeleteTree ((AML_NODE_HANDLE)RdNode);
} }
if (NewLpiPackageNode != NULL) { if (NewLpiPackageNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)NewLpiPackageNode); AmlDeleteTree ((AML_NODE_HANDLE)NewLpiPackageNode);
} }
if (StringNode != NULL) { if (StringNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)StringNode); AmlDeleteTree ((AML_NODE_HANDLE)StringNode);
} }
if (IntegerNode != NULL) { if (IntegerNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)IntegerNode); AmlDeleteTree ((AML_NODE_HANDLE)IntegerNode);
} }
if (ResourceTemplateNode != NULL) { if (ResourceTemplateNode != NULL) {
AmlDeleteTree ((AML_NODE_HANDLE)ResourceTemplateNode); AmlDeleteTree ((AML_NODE_HANDLE)ResourceTemplateNode);
} }

View File

@ -73,7 +73,8 @@ LinkRdNode (
); );
if ((BufferOpNode == NULL) || if ((BufferOpNode == NULL) ||
(AmlGetNodeType ((AML_NODE_HANDLE)BufferOpNode) != EAmlNodeObject) || (AmlGetNodeType ((AML_NODE_HANDLE)BufferOpNode) != EAmlNodeObject) ||
(!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0))) { (!AmlNodeHasOpCode (BufferOpNode, AML_BUFFER_OP, 0)))
{
ASSERT (0); ASSERT (0);
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto error_handler; goto error_handler;
@ -154,7 +155,8 @@ AmlCodeGenRdInterrupt (
if ((IrqList == NULL) || if ((IrqList == NULL) ||
(IrqCount == 0) || (IrqCount == 0) ||
((NameOpNode == NULL) && (NewRdNode == NULL))) { ((NameOpNode == NULL) && (NewRdNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -247,7 +249,8 @@ AmlCodeGenRdRegister (
EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR RdRegister; EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR RdRegister;
if ((AccessSize > EFI_ACPI_6_4_QWORD) || if ((AccessSize > EFI_ACPI_6_4_QWORD) ||
((NameOpNode == NULL) && (NewRdNode == NULL))) { ((NameOpNode == NULL) && (NewRdNode == NULL)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -366,7 +369,8 @@ AmlCodeGenEndTag (
// already has resource data elements attached. Indeed, the EndTag should // already has resource data elements attached. Indeed, the EndTag should
// have already been added. // have already been added.
if (AmlGetNextVariableArgument ((AML_NODE_HEADER *)ParentNode, NULL) != if (AmlGetNextVariableArgument ((AML_NODE_HEADER *)ParentNode, NULL) !=
NULL) { NULL)
{
ASSERT (0); ASSERT (0);
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto error_handler; goto error_handler;
@ -390,6 +394,7 @@ error_handler:
if (RdNode != NULL) { if (RdNode != NULL) {
AmlDeleteTree ((AML_NODE_HEADER *)RdNode); AmlDeleteTree ((AML_NODE_HEADER *)RdNode);
} }
return Status; return Status;
} }

View File

@ -145,7 +145,8 @@ AmlGetFirstAncestorNameSpaceNode (
) )
{ {
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -170,7 +171,8 @@ AmlGetFirstAncestorNameSpaceNode (
} else if (AmlNodeHasAttribute ( } else if (AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE AML_IN_NAMESPACE
)) { ))
{
break; break;
} else { } else {
Node = AmlGetParent ((AML_NODE_HEADER *)Node); Node = AmlGetParent ((AML_NODE_HEADER *)Node);
@ -253,7 +255,8 @@ AmlGetAncestorNameSpaceNode (
if (!IS_AML_OBJECT_NODE (Node) || if (!IS_AML_OBJECT_NODE (Node) ||
(Levels == NULL) || (Levels == NULL) ||
(HasRoot == NULL) || (HasRoot == NULL) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -281,6 +284,7 @@ AmlGetAncestorNameSpaceNode (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
*HasRoot = 1; *HasRoot = 1;
break; break;
} }
@ -357,6 +361,7 @@ AmlGetAncestorNameSpaceNode (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
Node = (CONST AML_OBJECT_NODE *)NameSpaceNode; Node = (CONST AML_OBJECT_NODE *)NameSpaceNode;
ParentCnt = 0; ParentCnt = 0;
break; break;
@ -433,11 +438,13 @@ AmlGetRawNameSpacePath (
if ((!IS_AML_ROOT_NODE (Node) && if ((!IS_AML_ROOT_NODE (Node) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE)) || AML_IN_NAMESPACE
)) ||
!IS_STREAM (RawAbsPathBStream) || !IS_STREAM (RawAbsPathBStream) ||
IS_END_OF_STREAM (RawAbsPathBStream) || IS_END_OF_STREAM (RawAbsPathBStream) ||
!IS_STREAM_BACKWARD (RawAbsPathBStream) || !IS_STREAM_BACKWARD (RawAbsPathBStream) ||
(InputParent > MAX_UINT8)) { (InputParent > MAX_UINT8))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -477,6 +484,7 @@ AmlGetRawNameSpacePath (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
InputParent = 0; InputParent = 0;
} else { } else {
// (SegCount <= InputParent) // (SegCount <= InputParent)
@ -494,6 +502,7 @@ AmlGetRawNameSpacePath (
ASSERT (0); ASSERT (0);
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
break; break;
} }
@ -504,7 +513,8 @@ AmlGetRawNameSpacePath (
(CONST AML_NODE_HEADER **)&ParentNode (CONST AML_NODE_HEADER **)&ParentNode
); );
if (EFI_ERROR (Status) || if (EFI_ERROR (Status) ||
(!IS_AML_NODE_VALID (ParentNode))) { (!IS_AML_NODE_VALID (ParentNode)))
{
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
@ -557,7 +567,6 @@ AmlGetRawNameSpacePath (
break; break;
} // (InputParent != 0) } // (InputParent != 0)
} }
} // while } // while
@ -598,7 +607,8 @@ AmlAddPrefix (
// The Stream contains concatenated NameSegs. // The Stream contains concatenated NameSegs.
if (!IS_STREAM (AmlPathBStream) || if (!IS_STREAM (AmlPathBStream) ||
IS_END_OF_STREAM (AmlPathBStream) || IS_END_OF_STREAM (AmlPathBStream) ||
!IS_STREAM_BACKWARD (AmlPathBStream)) { !IS_STREAM_BACKWARD (AmlPathBStream))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -693,7 +703,8 @@ AmlRemovePrefix (
if (!IS_STREAM (AmlPathBStream) || if (!IS_STREAM (AmlPathBStream) ||
IS_END_OF_STREAM (AmlPathBStream) || IS_END_OF_STREAM (AmlPathBStream) ||
!IS_STREAM_BACKWARD (AmlPathBStream)) { !IS_STREAM_BACKWARD (AmlPathBStream))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -778,8 +789,10 @@ AmlGetAslPathName (
if ((!IS_AML_ROOT_NODE (Node) && if ((!IS_AML_ROOT_NODE (Node) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE)) || AML_IN_NAMESPACE
(BufferSize == NULL)) { )) ||
(BufferSize == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -906,7 +919,8 @@ AmlDbgPrintNameSpaceCallback (
Status1 = EFI_SUCCESS; Status1 = EFI_SUCCESS;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(Context == NULL)) { (Context == NULL))
{
ASSERT (0); ASSERT (0);
Status1 = EFI_INVALID_PARAMETER; Status1 = EFI_INVALID_PARAMETER;
ContinueEnum = FALSE; ContinueEnum = FALSE;
@ -916,7 +930,9 @@ AmlDbgPrintNameSpaceCallback (
if (!IS_AML_ROOT_NODE (Node) && if (!IS_AML_ROOT_NODE (Node) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE)) { AML_IN_NAMESPACE
))
{
// Skip this node and continue enumeration. // Skip this node and continue enumeration.
goto exit_handler; goto exit_handler;
} }
@ -925,14 +941,16 @@ AmlDbgPrintNameSpaceCallback (
DEBUG ((DEBUG_INFO, "\\\n")); DEBUG ((DEBUG_INFO, "\\\n"));
} else if (AmlNodeHasAttribute ( } else if (AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE)) { AML_IN_NAMESPACE
))
{
CurrNodePathFStream = (AML_STREAM *)Context; CurrNodePathFStream = (AML_STREAM *)Context;
// Check the Context's content. // Check the Context's content.
if (!IS_STREAM (CurrNodePathFStream) || if (!IS_STREAM (CurrNodePathFStream) ||
IS_END_OF_STREAM (CurrNodePathFStream) || IS_END_OF_STREAM (CurrNodePathFStream) ||
!IS_STREAM_FORWARD (CurrNodePathFStream)) { !IS_STREAM_FORWARD (CurrNodePathFStream))
{
ASSERT (0); ASSERT (0);
Status1 = EFI_INVALID_PARAMETER; Status1 = EFI_INVALID_PARAMETER;
ContinueEnum = FALSE; ContinueEnum = FALSE;
@ -954,7 +972,6 @@ AmlDbgPrintNameSpaceCallback (
} }
DEBUG ((DEBUG_INFO, "%a\n", CurrNodePathBuffer)); DEBUG ((DEBUG_INFO, "%a\n", CurrNodePathBuffer));
} else { } else {
ASSERT (0); ASSERT (0);
Status1 = EFI_INVALID_PARAMETER; Status1 = EFI_INVALID_PARAMETER;
@ -1083,7 +1100,8 @@ AmlEnumeratePathCallback (
Status1 = EFI_SUCCESS; Status1 = EFI_SUCCESS;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(Context == NULL)) { (Context == NULL))
{
ASSERT (0); ASSERT (0);
Status1 = EFI_INVALID_PARAMETER; Status1 = EFI_INVALID_PARAMETER;
ContinueEnum = FALSE; ContinueEnum = FALSE;
@ -1092,7 +1110,9 @@ AmlEnumeratePathCallback (
if (!AmlNodeHasAttribute ( if (!AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE)) { AML_IN_NAMESPACE
))
{
goto exit_handler; goto exit_handler;
} }
@ -1106,7 +1126,8 @@ AmlEnumeratePathCallback (
!IS_STREAM_BACKWARD (SearchPathBStream) || !IS_STREAM_BACKWARD (SearchPathBStream) ||
!IS_STREAM (CurrNodePathBStream) || !IS_STREAM (CurrNodePathBStream) ||
IS_END_OF_STREAM (CurrNodePathBStream) || IS_END_OF_STREAM (CurrNodePathBStream) ||
!IS_STREAM_BACKWARD (CurrNodePathBStream)) { !IS_STREAM_BACKWARD (CurrNodePathBStream))
{
ASSERT (0); ASSERT (0);
Status1 = EFI_INVALID_PARAMETER; Status1 = EFI_INVALID_PARAMETER;
ContinueEnum = FALSE; ContinueEnum = FALSE;
@ -1154,7 +1175,9 @@ AmlEnumeratePathCallback (
(CompareMem ( (CompareMem (
AmlStreamGetCurrPos (CurrNodePathBStream), AmlStreamGetCurrPos (CurrNodePathBStream),
AmlStreamGetCurrPos (SearchPathBStream), AmlStreamGetCurrPos (SearchPathBStream),
AmlStreamGetIndex (SearchPathBStream)) == 0)) { AmlStreamGetIndex (SearchPathBStream)
) == 0))
{
Status1 = EFI_SUCCESS; Status1 = EFI_SUCCESS;
ContinueEnum = FALSE; ContinueEnum = FALSE;
PathSearchContext->OutNode = Node; PathSearchContext->OutNode = Node;
@ -1226,11 +1249,13 @@ AmlBuildAbsoluteAmlPath (
if ((!IS_AML_ROOT_NODE (ReferenceNode) && if ((!IS_AML_ROOT_NODE (ReferenceNode) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)ReferenceNode, (CONST AML_OBJECT_NODE *)ReferenceNode,
AML_IN_NAMESPACE)) || AML_IN_NAMESPACE
)) ||
(AslPath == NULL) || (AslPath == NULL) ||
!IS_STREAM (RawAmlAbsSearchPathBStream) || !IS_STREAM (RawAmlAbsSearchPathBStream) ||
IS_END_OF_STREAM (RawAmlAbsSearchPathBStream) || IS_END_OF_STREAM (RawAmlAbsSearchPathBStream) ||
!IS_STREAM_BACKWARD (RawAmlAbsSearchPathBStream)) { !IS_STREAM_BACKWARD (RawAmlAbsSearchPathBStream))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1373,9 +1398,11 @@ AmlFindNode (
if ((!IS_AML_ROOT_NODE (ReferenceNode) && if ((!IS_AML_ROOT_NODE (ReferenceNode) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)ReferenceNode, (CONST AML_OBJECT_NODE *)ReferenceNode,
AML_IN_NAMESPACE)) || AML_IN_NAMESPACE
)) ||
(AslPath == NULL) || (AslPath == NULL) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -70,7 +70,8 @@ AmlParseFieldElement (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -98,7 +99,8 @@ AmlParseFieldElement (
// Parse the PkgLen if available. // Parse the PkgLen if available.
PkgLenSize = 0; PkgLenSize = 0;
if ((FieldByteEncoding->Attribute & AML_HAS_PKG_LENGTH) == if ((FieldByteEncoding->Attribute & AML_HAS_PKG_LENGTH) ==
AML_HAS_PKG_LENGTH) { AML_HAS_PKG_LENGTH)
{
PkgLenOffset = AmlGetPkgLength (CurrPos, &PkgLenSize); PkgLenOffset = AmlGetPkgLength (CurrPos, &PkgLenSize);
if (PkgLenOffset == 0) { if (PkgLenOffset == 0) {
ASSERT (0); ASSERT (0);
@ -199,7 +201,8 @@ AmlParseNamedFieldElement (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -322,7 +325,8 @@ AmlParseFieldList (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -351,7 +355,8 @@ AmlParseFieldList (
// call AmlGetByteEncoding() to check that the encoding is NameChar. // call AmlGetByteEncoding() to check that the encoding is NameChar.
NamedFieldByteEncoding = AmlGetByteEncoding (CurrPos); NamedFieldByteEncoding = AmlGetByteEncoding (CurrPos);
if ((NamedFieldByteEncoding != NULL) && if ((NamedFieldByteEncoding != NULL) &&
(NamedFieldByteEncoding->Attribute & AML_IS_NAME_CHAR)) { (NamedFieldByteEncoding->Attribute & AML_IS_NAME_CHAR))
{
// This is a NamedField field element since it is starting with a char. // This is a NamedField field element since it is starting with a char.
Status = AmlParseNamedFieldElement ( Status = AmlParseNamedFieldElement (
NamedFieldByteEncoding, NamedFieldByteEncoding,

View File

@ -117,7 +117,8 @@ AmlCreateMethodRefNode (
if (!AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE) || if (!AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE) ||
(RawAbsolutePath == NULL) || (RawAbsolutePath == NULL) ||
(RawAbsolutePathSize == 0) || (RawAbsolutePathSize == 0) ||
(NameSpaceRefNodePtr == NULL)) { (NameSpaceRefNodePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -231,7 +232,8 @@ AmlInitRawPathBStream (
if (!IS_STREAM (FStream) || if (!IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(RawPathNameBStream == NULL)) { (RawPathNameBStream == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -322,7 +324,8 @@ AmlGetFirstNamedAncestorNode (
if ((!IS_AML_OBJECT_NODE (Node) && if ((!IS_AML_OBJECT_NODE (Node) &&
!IS_AML_ROOT_NODE (Node)) || !IS_AML_ROOT_NODE (Node)) ||
(OutNamedNode == NULL)) { (OutNamedNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -332,8 +335,10 @@ AmlGetFirstNamedAncestorNode (
while (!IS_AML_ROOT_NODE (Node) && while (!IS_AML_ROOT_NODE (Node) &&
!(AmlNodeHasAttribute ( !(AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IN_NAMESPACE) && AML_IN_NAMESPACE
AmlNodeGetName ((CONST AML_OBJECT_NODE*)Node) != NULL)) { ) &&
AmlNodeGetName ((CONST AML_OBJECT_NODE *)Node) != NULL))
{
Status = AmlGetFirstAncestorNameSpaceNode ( Status = AmlGetFirstAncestorNameSpaceNode (
Node, Node,
(AML_NODE_HEADER **)&NameSpaceNode (AML_NODE_HEADER **)&NameSpaceNode
@ -342,6 +347,7 @@ AmlGetFirstNamedAncestorNode (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
// The NameSpaceNode may not have its name defined as yet. In this // The NameSpaceNode may not have its name defined as yet. In this
// case get the next ancestor node. // case get the next ancestor node.
Node = NameSpaceNode; Node = NameSpaceNode;
@ -402,7 +408,8 @@ AmlBuildRawMethodAbsolutePath (
!IS_STREAM_FORWARD (PathnameFStream) || !IS_STREAM_FORWARD (PathnameFStream) ||
!IS_STREAM (AbsolutePathBStream) || !IS_STREAM (AbsolutePathBStream) ||
IS_END_OF_STREAM (AbsolutePathBStream) || IS_END_OF_STREAM (AbsolutePathBStream) ||
!IS_STREAM_BACKWARD (AbsolutePathBStream)) { !IS_STREAM_BACKWARD (AbsolutePathBStream))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -507,7 +514,8 @@ AmlCompareRawNameString (
!IS_STREAM_FORWARD (RawFStream1) || !IS_STREAM_FORWARD (RawFStream1) ||
!IS_STREAM (RawFStream2) || !IS_STREAM (RawFStream2) ||
IS_END_OF_STREAM (RawFStream2) || IS_END_OF_STREAM (RawFStream2) ||
(CompareCount == NULL)) { (CompareCount == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -543,8 +551,10 @@ AmlCompareRawNameString (
if (!AmlStreamCmp ( if (!AmlStreamCmp (
&RawFStream1Clone, &RawFStream1Clone,
&RawFStream2Clone, &RawFStream2Clone,
AML_NAME_SEG_SIZE) AML_NAME_SEG_SIZE
) { )
)
{
// NameSegs are different. Break. // NameSegs are different. Break.
break; break;
} }
@ -554,6 +564,7 @@ AmlCompareRawNameString (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
Status = AmlStreamProgress (&RawFStream2Clone, AML_NAME_SEG_SIZE); Status = AmlStreamProgress (&RawFStream2Clone, AML_NAME_SEG_SIZE);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
@ -610,7 +621,8 @@ AmlResolveAliasMethod (
if (!AmlNodeCompareOpCode (AliasNode, AML_ALIAS_OP, 0) || if (!AmlNodeCompareOpCode (AliasNode, AML_ALIAS_OP, 0) ||
(NameSpaceRefList == NULL) || (NameSpaceRefList == NULL) ||
(OutNameSpaceRefNode == NULL)) { (OutNameSpaceRefNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -743,7 +755,8 @@ AmlFindMethodDefinition (
((AmlStreamGetIndex (RawPathNameBStream) & ((AmlStreamGetIndex (RawPathNameBStream) &
(AML_NAME_SEG_SIZE - 1)) != 0) || (AML_NAME_SEG_SIZE - 1)) != 0) ||
(NameSpaceRefList == NULL) || (NameSpaceRefList == NULL) ||
(OutNameSpaceRefNode == NULL)) { (OutNameSpaceRefNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -803,7 +816,9 @@ AmlFindMethodDefinition (
if (!AmlStreamCmp ( if (!AmlStreamCmp (
RawPathNameBStream, RawPathNameBStream,
&ProbedRawAbsoluteBStream, &ProbedRawAbsoluteBStream,
AmlStreamGetMaxBufferSize (RawPathNameBStream))) { AmlStreamGetMaxBufferSize (RawPathNameBStream)
))
{
NextLink = NextLink->ForwardLink; NextLink = NextLink->ForwardLink;
continue; continue;
} }
@ -871,11 +886,13 @@ AmlFindMethodDefinition (
// didn't because it is out of scope. // didn't because it is out of scope.
// Thus, the best match is \AAAA.MET0. // Thus, the best match is \AAAA.MET0.
if (AmlStreamGetIndex (&ProbedRawAbsoluteFStream) < if (AmlStreamGetIndex (&ProbedRawAbsoluteFStream) <
BestNameSpaceRefNode->RawAbsolutePathSize) { BestNameSpaceRefNode->RawAbsolutePathSize)
{
BestScopeCount = ProbedScopeCount; BestScopeCount = ProbedScopeCount;
BestNameSpaceRefNode = ProbedNameSpaceRefNode; BestNameSpaceRefNode = ProbedNameSpaceRefNode;
} else if (AmlStreamGetIndex (&ProbedRawAbsoluteFStream) == } else if (AmlStreamGetIndex (&ProbedRawAbsoluteFStream) ==
BestNameSpaceRefNode->RawAbsolutePathSize) { BestNameSpaceRefNode->RawAbsolutePathSize)
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -893,7 +910,10 @@ AmlFindMethodDefinition (
*OutNameSpaceRefNode = BestNameSpaceRefNode; *OutNameSpaceRefNode = BestNameSpaceRefNode;
} else if (AmlNodeCompareOpCode ( } else if (AmlNodeCompareOpCode (
BestNameSpaceRefNode->NodeRef, BestNameSpaceRefNode->NodeRef,
AML_ALIAS_OP, 0)) { AML_ALIAS_OP,
0
))
{
// The path matches an alias. Resolve the alias and check whether // The path matches an alias. Resolve the alias and check whether
// this is a method defintion. // this is a method defintion.
Status = AmlResolveAliasMethod ( Status = AmlResolveAliasMethod (
@ -966,7 +986,8 @@ AmlIsMethodInvocation (
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL) || (NameSpaceRefList == NULL) ||
(OutNameSpaceRefNode == NULL)) { (OutNameSpaceRefNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -974,7 +995,9 @@ AmlIsMethodInvocation (
// There cannot be a method invocation in a field list. Return. // There cannot be a method invocation in a field list. Return.
if (AmlNodeHasAttribute ( if (AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)ParentNode, (CONST AML_OBJECT_NODE *)ParentNode,
AML_HAS_FIELD_LIST)) { AML_HAS_FIELD_LIST
))
{
*OutNameSpaceRefNode = NULL; *OutNameSpaceRefNode = NULL;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -1073,10 +1096,10 @@ AmlIsMethodInvocation (
NameSpaceRefNode->RawAbsolutePathSize NameSpaceRefNode->RawAbsolutePathSize
); );
DEBUG ((DEBUG_VERBOSE, ".\n")); DEBUG ((DEBUG_VERBOSE, ".\n"));
} else { } else {
DEBUG ((DEBUG_VERBOSE, "AmlMethodParser: No method definition found.\n")); DEBUG ((DEBUG_VERBOSE, "AmlMethodParser: No method definition found.\n"));
} }
#endif // MDEPKG_NDEBUG #endif // MDEPKG_NDEBUG
*OutNameSpaceRefNode = NameSpaceRefNode; *OutNameSpaceRefNode = NameSpaceRefNode;
@ -1125,7 +1148,8 @@ AmlAddNameSpaceReference (
CONST AML_NODE_HEADER *ParentNode; CONST AML_NODE_HEADER *ParentNode;
if (!AmlNodeHasAttribute (Node, AML_IN_NAMESPACE) || if (!AmlNodeHasAttribute (Node, AML_IN_NAMESPACE) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1166,7 +1190,8 @@ AmlAddNameSpaceReference (
NameIndex NameIndex
); );
if (!IS_AML_DATA_NODE (NameNode) || if (!IS_AML_DATA_NODE (NameNode) ||
(NameNode->DataType != EAmlNodeDataTypeNameString)) { (NameNode->DataType != EAmlNodeDataTypeNameString))
{
ASSERT (0); ASSERT (0);
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto exit_handler; goto exit_handler;
@ -1292,7 +1317,8 @@ AmlCreateMethodInvocationNode (
!AmlIsMethodDefinitionNode (NameSpaceRefNode->NodeRef) || !AmlIsMethodDefinitionNode (NameSpaceRefNode->NodeRef) ||
!IS_AML_DATA_NODE (MethodInvocationName) || !IS_AML_DATA_NODE (MethodInvocationName) ||
(MethodInvocationName->DataType != EAmlNodeDataTypeNameString) || (MethodInvocationName->DataType != EAmlNodeDataTypeNameString) ||
(MethodInvocationNodePtr == NULL)) { (MethodInvocationNodePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1424,7 +1450,8 @@ AmlGetMethodInvocationArgCount (
if (!IS_AML_NODE_VALID (MethodInvocationNode) || if (!IS_AML_NODE_VALID (MethodInvocationNode) ||
(IsMethodInvocation == NULL) || (IsMethodInvocation == NULL) ||
(ArgCount == NULL)) { (ArgCount == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1447,10 +1474,12 @@ AmlGetMethodInvocationArgCount (
if (!IS_AML_NODE_VALID (NumArgsNode) || if (!IS_AML_NODE_VALID (NumArgsNode) ||
(NumArgsNode->Buffer == NULL) || (NumArgsNode->Buffer == NULL) ||
(NumArgsNode->DataType != EAmlNodeDataTypeUInt) || (NumArgsNode->DataType != EAmlNodeDataTypeUInt) ||
(NumArgsNode->Size != 1)) { (NumArgsNode->Size != 1))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
*ArgCount = *NumArgsNode->Buffer; *ArgCount = *NumArgsNode->Buffer;
*IsMethodInvocation = TRUE; *IsMethodInvocation = TRUE;

View File

@ -52,8 +52,8 @@ AmlDeleteNameSpaceRefList (
IN LIST_ENTRY *NameSpaceRefList IN LIST_ENTRY *NameSpaceRefList
); );
#if !defined (MDEPKG_NDEBUG) #if !defined (MDEPKG_NDEBUG)
/** Print the list of raw absolute paths of the NameSpace reference list. /** Print the list of raw absolute paths of the NameSpace reference list.
@param [in] NameSpaceRefList List of NameSpace reference nodes. @param [in] NameSpaceRefList List of NameSpace reference nodes.

View File

@ -148,7 +148,8 @@ AmlParseUIntX (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -234,7 +235,8 @@ AmlParseNameString (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -242,7 +244,8 @@ AmlParseNameString (
Buffer = (CONST UINT8 *)AmlStreamGetCurrPos (FStream); Buffer = (CONST UINT8 *)AmlStreamGetCurrPos (FStream);
ByteEncoding = AmlGetByteEncoding (Buffer); ByteEncoding = AmlGetByteEncoding (Buffer);
if ((ByteEncoding == NULL) || if ((ByteEncoding == NULL) ||
((ByteEncoding->Attribute & AML_IS_NAME_CHAR) == 0)) { ((ByteEncoding->Attribute & AML_IS_NAME_CHAR) == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -250,7 +253,8 @@ AmlParseNameString (
// Parse the NameString. // Parse the NameString.
Status = AmlGetNameStringSize ((CONST CHAR8 *)Buffer, &StrSize); Status = AmlGetNameStringSize ((CONST CHAR8 *)Buffer, &StrSize);
if ((EFI_ERROR (Status)) || if ((EFI_ERROR (Status)) ||
(StrSize > AmlStreamGetFreeSpace (FStream))) { (StrSize > AmlStreamGetFreeSpace (FStream)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -317,7 +321,8 @@ AmlParseString (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -332,6 +337,7 @@ AmlParseString (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
StrSize++; StrSize++;
} while (Byte != '\0'); } while (Byte != '\0');
@ -394,7 +400,8 @@ AmlParseObject (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -424,6 +431,7 @@ AmlParseObject (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
} }
return Status; return Status;
} }
@ -434,6 +442,7 @@ AmlParseObject (
} else { } else {
OpCodeSize = 1; OpCodeSize = 1;
} }
Status = AmlStreamProgress (FStream, OpCodeSize); Status = AmlStreamProgress (FStream, OpCodeSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
@ -533,7 +542,8 @@ AmlParseFieldPkgLen (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -627,7 +637,8 @@ AmlCheckAndParseMethodInvoc (
!IS_AML_DATA_NODE (DataNode) || !IS_AML_DATA_NODE (DataNode) ||
(DataNode->DataType != EAmlNodeDataTypeNameString) || (DataNode->DataType != EAmlNodeDataTypeNameString) ||
(NameSpaceRefList == NULL) || (NameSpaceRefList == NULL) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -720,7 +731,8 @@ AmlParseArgument (
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL) || (NameSpaceRefList == NULL) ||
(OutNode == NULL)) { (OutNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -749,12 +761,14 @@ AmlParseArgument (
DataNode = (AML_DATA_NODE *)*OutNode; DataNode = (AML_DATA_NODE *)*OutNode;
if (IS_AML_DATA_NODE (DataNode) && if (IS_AML_DATA_NODE (DataNode) &&
(DataNode->DataType == EAmlNodeDataTypeNameString) && (DataNode->DataType == EAmlNodeDataTypeNameString) &&
(ExpectedFormat == EAmlObject)) { (ExpectedFormat == EAmlObject))
{
Status = AmlCheckAndParseMethodInvoc ( Status = AmlCheckAndParseMethodInvoc (
ParentNode, ParentNode,
(AML_DATA_NODE *)*OutNode, (AML_DATA_NODE *)*OutNode,
NameSpaceRefList, NameSpaceRefList,
&MethodInvocationNode); &MethodInvocationNode
);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
return Status; return Status;
@ -802,7 +816,8 @@ AmlParseByteList (
if (!AmlNodeHasAttribute (BufferNode, AML_HAS_BYTE_LIST) || if (!AmlNodeHasAttribute (BufferNode, AML_HAS_BYTE_LIST) ||
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream)) { !IS_STREAM_FORWARD (FStream))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -897,7 +912,8 @@ AmlParseFixedArguments (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -907,7 +923,8 @@ AmlParseFixedArguments (
(AML_OBJECT_NODE *)ObjectNode (AML_OBJECT_NODE *)ObjectNode
); );
if ((ObjectNode->AmlByteEncoding != NULL) && if ((ObjectNode->AmlByteEncoding != NULL) &&
(ObjectNode->AmlByteEncoding->Format != NULL)) { (ObjectNode->AmlByteEncoding->Format != NULL))
{
Format = ObjectNode->AmlByteEncoding->Format; Format = ObjectNode->AmlByteEncoding->Format;
} else { } else {
ASSERT (0); ASSERT (0);
@ -917,7 +934,8 @@ AmlParseFixedArguments (
// Parse all the FixedArgs. // Parse all the FixedArgs.
while ((TermIndex < MaxIndex) && while ((TermIndex < MaxIndex) &&
!IS_END_OF_STREAM (FStream) && !IS_END_OF_STREAM (FStream) &&
(Format[TermIndex] != EAmlNone)) { (Format[TermIndex] != EAmlNone))
{
// Initialize a FixedArgStream to parse the current fixed argument. // Initialize a FixedArgStream to parse the current fixed argument.
Status = AmlStreamInitSubStream (FStream, &FixedArgFStream); Status = AmlStreamInitSubStream (FStream, &FixedArgFStream);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@ -957,7 +975,8 @@ AmlParseFixedArguments (
// Parse the AML bytecode of the FixedArgNode if this is an object node. // Parse the AML bytecode of the FixedArgNode if this is an object node.
if (IS_AML_OBJECT_NODE (FixedArgNode) && if (IS_AML_OBJECT_NODE (FixedArgNode) &&
!IS_END_OF_STREAM (&FixedArgFStream)) { !IS_END_OF_STREAM (&FixedArgFStream))
{
Status = AmlParseStream ( Status = AmlParseStream (
FixedArgNode, FixedArgNode,
&FixedArgFStream, &FixedArgFStream,
@ -1032,7 +1051,8 @@ AmlParseVariableArguments (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1092,7 +1112,8 @@ AmlParseVariableArguments (
// Parse the AML bytecode of the VarArgNode if this is an object node. // Parse the AML bytecode of the VarArgNode if this is an object node.
if (IS_AML_OBJECT_NODE (VarArgNode) && if (IS_AML_OBJECT_NODE (VarArgNode) &&
(!IS_END_OF_STREAM (&VarArgFStream))) { (!IS_END_OF_STREAM (&VarArgFStream)))
{
Status = AmlParseStream (VarArgNode, &VarArgFStream, NameSpaceRefList); Status = AmlParseStream (VarArgNode, &VarArgFStream, NameSpaceRefList);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
@ -1150,7 +1171,8 @@ AmlPopulateRootNode (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1195,7 +1217,8 @@ AmlPopulateObjectNode (
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream) || !IS_STREAM_FORWARD (FStream) ||
(NameSpaceRefList == NULL)) { (NameSpaceRefList == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1231,7 +1254,9 @@ AmlPopulateObjectNode (
// paths. Method invocation need to be parsed differently. // paths. Method invocation need to be parsed differently.
if (AmlNodeHasAttribute ( if (AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)ObjectNode, (CONST AML_OBJECT_NODE *)ObjectNode,
AML_IN_NAMESPACE)) { AML_IN_NAMESPACE
))
{
Status = AmlAddNameSpaceReference ( Status = AmlAddNameSpaceReference (
(CONST AML_OBJECT_NODE *)ObjectNode, (CONST AML_OBJECT_NODE *)ObjectNode,
NameSpaceRefList NameSpaceRefList
@ -1308,7 +1333,6 @@ AmlParseStream (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
} }
} else if (IS_AML_OBJECT_NODE (Node)) { } else if (IS_AML_OBJECT_NODE (Node)) {
Status = AmlPopulateObjectNode ( Status = AmlPopulateObjectNode (
(AML_OBJECT_NODE *)Node, (AML_OBJECT_NODE *)Node,
@ -1318,7 +1342,6 @@ AmlParseStream (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
} }
} else { } else {
// Data node or other. // Data node or other.
ASSERT (0); ASSERT (0);
@ -1361,7 +1384,8 @@ AmlParseDefinitionBlock (
UINT32 MaxBufferSize; UINT32 MaxBufferSize;
if ((DefinitionBlock == NULL) || if ((DefinitionBlock == NULL) ||
(RootPtr == NULL)) { (RootPtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -1371,6 +1395,7 @@ AmlParseDefinitionBlock (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
MaxBufferSize = DefinitionBlock->Length - MaxBufferSize = DefinitionBlock->Length -
(UINT32)sizeof (EFI_ACPI_DESCRIPTION_HEADER); (UINT32)sizeof (EFI_ACPI_DESCRIPTION_HEADER);

View File

@ -43,7 +43,8 @@ AmlRdStreamGetRdSize (
if (!IS_STREAM (FStream) || if (!IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream)) { !IS_STREAM_FORWARD (FStream))
{
ASSERT (0); ASSERT (0);
return 0; return 0;
} }
@ -57,7 +58,8 @@ AmlRdStreamGetRdSize (
// If the resource data element is of the large type, check for overflow. // If the resource data element is of the large type, check for overflow.
if (AML_RD_IS_LARGE (CurrRdElement) && if (AML_RD_IS_LARGE (CurrRdElement) &&
(AmlStreamGetFreeSpace (FStream) < (AmlStreamGetFreeSpace (FStream) <
sizeof (ACPI_LARGE_RESOURCE_HEADER))) { sizeof (ACPI_LARGE_RESOURCE_HEADER)))
{
return 0; return 0;
} }
@ -94,7 +96,8 @@ AmlRdCheckFunctionDescNesting (
if (!IS_STREAM (FStream) || if (!IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
(InFunctionDesc == NULL)) { (InFunctionDesc == NULL))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -110,7 +113,10 @@ AmlRdCheckFunctionDescNesting (
if (AmlRdCompareDescId ( if (AmlRdCompareDescId (
CurrRdElement, CurrRdElement,
AML_RD_BUILD_SMALL_DESC_ID ( AML_RD_BUILD_SMALL_DESC_ID (
ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME))) { ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME
)
))
{
*InFunctionDesc = TRUE; *InFunctionDesc = TRUE;
return TRUE; return TRUE;
} }
@ -119,7 +125,10 @@ AmlRdCheckFunctionDescNesting (
if (AmlRdCompareDescId ( if (AmlRdCompareDescId (
CurrRdElement, CurrRdElement,
AML_RD_BUILD_SMALL_DESC_ID ( AML_RD_BUILD_SMALL_DESC_ID (
ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME))) { ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME
)
))
{
if (*InFunctionDesc) { if (*InFunctionDesc) {
*InFunctionDesc = FALSE; *InFunctionDesc = FALSE;
return TRUE; return TRUE;
@ -167,7 +176,8 @@ AmlRdIsResourceDataBuffer (
if (!IS_STREAM (FStream) || if (!IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream)) { !IS_STREAM_FORWARD (FStream))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -188,7 +198,9 @@ AmlRdIsResourceDataBuffer (
// The first element cannot be an end tag. // The first element cannot be an end tag.
if (AmlRdCompareDescId ( if (AmlRdCompareDescId (
CurrRdElement, CurrRdElement,
AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) { AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME)
))
{
return FALSE; return FALSE;
} }
@ -199,7 +211,8 @@ AmlRdIsResourceDataBuffer (
CurrRdElementSize = AmlRdStreamGetRdSize (&SubStream); CurrRdElementSize = AmlRdStreamGetRdSize (&SubStream);
if ((FreeSpace == 0) || if ((FreeSpace == 0) ||
(CurrRdElement == NULL) || (CurrRdElement == NULL) ||
(CurrRdElementSize == 0)) { (CurrRdElementSize == 0))
{
return FALSE; return FALSE;
} }
@ -218,7 +231,9 @@ AmlRdIsResourceDataBuffer (
// Thus the function should have already returned. // Thus the function should have already returned.
if (AmlRdCompareDescId ( if (AmlRdCompareDescId (
CurrRdElement, CurrRdElement,
AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) { AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME)
))
{
return FALSE; return FALSE;
} }
@ -266,7 +281,8 @@ AmlParseResourceData (
if (!AmlNodeHasAttribute (BufferNode, AML_HAS_BYTE_LIST) || if (!AmlNodeHasAttribute (BufferNode, AML_HAS_BYTE_LIST) ||
!IS_STREAM (FStream) || !IS_STREAM (FStream) ||
IS_END_OF_STREAM (FStream) || IS_END_OF_STREAM (FStream) ||
!IS_STREAM_FORWARD (FStream)) { !IS_STREAM_FORWARD (FStream))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -315,11 +331,14 @@ AmlParseResourceData (
// Exit the loop when finding the resource data end tag. // Exit the loop when finding the resource data end tag.
if (AmlRdCompareDescId ( if (AmlRdCompareDescId (
CurrRdElement, CurrRdElement,
AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) { AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME)
))
{
if (FreeSpace != CurrRdElementSize) { if (FreeSpace != CurrRdElementSize) {
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
break; break;
} }
} // while } // while

View File

@ -68,4 +68,3 @@ AmlParseResourceData (
); );
#endif // AML_RESOURCE_DATA_PARSER_H_ #endif // AML_RESOURCE_DATA_PARSER_H_

View File

@ -126,7 +126,9 @@ AmlRdSetEndTagChecksum (
if ((Header == NULL) || if ((Header == NULL) ||
!AmlRdCompareDescId ( !AmlRdCompareDescId (
Header, Header,
AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) { AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME)
))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -58,7 +58,8 @@ AmlSerializeNodeCallback (
EAML_PARSE_INDEX IndexPtr; EAML_PARSE_INDEX IndexPtr;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(Context == NULL)) { (Context == NULL))
{
ASSERT (0); ASSERT (0);
Status1 = EFI_INVALID_PARAMETER; Status1 = EFI_INVALID_PARAMETER;
ContinueEnum = FALSE; ContinueEnum = FALSE;
@ -71,11 +72,13 @@ AmlSerializeNodeCallback (
ParentNode = (CONST AML_OBJECT_NODE *)AmlGetParent ((AML_NODE_HEADER *)Node); ParentNode = (CONST AML_OBJECT_NODE *)AmlGetParent ((AML_NODE_HEADER *)Node);
if (IS_AML_OBJECT_NODE (ParentNode) && if (IS_AML_OBJECT_NODE (ParentNode) &&
AmlNodeCompareOpCode (ParentNode, AML_METHOD_INVOC_OP, 0) && AmlNodeCompareOpCode (ParentNode, AML_METHOD_INVOC_OP, 0) &&
AmlIsNodeFixedArgument (Node, &IndexPtr)) { AmlIsNodeFixedArgument (Node, &IndexPtr))
{
if (IndexPtr == EAmlParseIndexTerm1) { if (IndexPtr == EAmlParseIndexTerm1) {
if (Status != NULL) { if (Status != NULL) {
*Status = EFI_SUCCESS; *Status = EFI_SUCCESS;
} }
return TRUE; return TRUE;
} }
} }
@ -97,11 +100,12 @@ AmlSerializeNodeCallback (
ContinueEnum = FALSE; ContinueEnum = FALSE;
goto error_handler; goto error_handler;
} }
} else if (IS_AML_OBJECT_NODE (Node) && } else if (IS_AML_OBJECT_NODE (Node) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IS_PSEUDO_OPCODE)) { AML_IS_PSEUDO_OPCODE
))
{
// Ignore pseudo-opcodes as they are not part of the // Ignore pseudo-opcodes as they are not part of the
// ACPI specification. // ACPI specification.
@ -138,6 +142,7 @@ error_handler:
if (Status != NULL) { if (Status != NULL) {
*Status = Status1; *Status = Status1;
} }
return ContinueEnum; return ContinueEnum;
} }
@ -179,7 +184,8 @@ AmlSerializeTree (
UINT32 TableSize; UINT32 TableSize;
if (!IS_AML_ROOT_NODE (RootNode) || if (!IS_AML_ROOT_NODE (RootNode) ||
(BufferSize == NULL)) { (BufferSize == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -276,7 +282,8 @@ AmlSerializeDefinitionBlock (
UINT32 TableSize; UINT32 TableSize;
if (!IS_AML_ROOT_NODE (RootNode) || if (!IS_AML_ROOT_NODE (RootNode) ||
(Table == NULL)) { (Table == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -33,7 +33,8 @@ AmlStreamInit (
(Buffer == NULL) || (Buffer == NULL) ||
(MaxBufferSize == 0) || (MaxBufferSize == 0) ||
((Direction != EAmlStreamDirectionForward) && ((Direction != EAmlStreamDirectionForward) &&
(Direction != EAmlStreamDirectionBackward))) { (Direction != EAmlStreamDirectionBackward)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -65,7 +66,8 @@ AmlStreamClone (
) )
{ {
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
(ClonedStream == NULL)) { (ClonedStream == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -110,7 +112,8 @@ AmlStreamInitSubStream (
) )
{ {
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
(SubStream == NULL)) { (SubStream == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -148,6 +151,7 @@ AmlStreamGetBuffer (
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
return Stream->Buffer; return Stream->Buffer;
} }
@ -168,6 +172,7 @@ AmlStreamGetMaxBufferSize (
ASSERT (0); ASSERT (0);
return 0; return 0;
} }
return Stream->MaxBufferSize; return Stream->MaxBufferSize;
} }
@ -189,7 +194,8 @@ AmlStreamReduceMaxBufferSize (
{ {
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
(Diff == 0) || (Diff == 0) ||
((Stream->MaxBufferSize - Diff) <= Stream->Index)) { ((Stream->MaxBufferSize - Diff) <= Stream->Index))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -221,6 +227,7 @@ AmlStreamGetIndex (
ASSERT (0); ASSERT (0);
return 0; return 0;
} }
return Stream->Index; return Stream->Index;
} }
@ -241,6 +248,7 @@ AmlStreamGetDirection (
ASSERT (0); ASSERT (0);
return EAmlStreamDirectionInvalid; return EAmlStreamDirectionInvalid;
} }
return Stream->Direction; return Stream->Direction;
} }
@ -320,7 +328,8 @@ AmlStreamProgress (
{ {
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
IS_END_OF_STREAM (Stream) || IS_END_OF_STREAM (Stream) ||
(Offset == 0)) { (Offset == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -355,7 +364,8 @@ AmlStreamRewind (
) )
{ {
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
(Offset == 0)) { (Offset == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -417,7 +427,8 @@ AmlStreamPeekByte (
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
IS_END_OF_STREAM (Stream) || IS_END_OF_STREAM (Stream) ||
(OutByte == NULL)) { (OutByte == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -456,7 +467,8 @@ AmlStreamReadByte (
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
IS_END_OF_STREAM (Stream) || IS_END_OF_STREAM (Stream) ||
(OutByte == NULL)) { (OutByte == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -508,7 +520,8 @@ AmlStreamWrite (
if (!IS_STREAM (Stream) || if (!IS_STREAM (Stream) ||
IS_END_OF_STREAM (Stream) || IS_END_OF_STREAM (Stream) ||
(Buffer == NULL) || (Buffer == NULL) ||
(Size == 0)) { (Size == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -568,7 +581,8 @@ AmlStreamCmp (
!IS_STREAM (Stream2) || !IS_STREAM (Stream2) ||
IS_END_OF_STREAM (Stream2) || IS_END_OF_STREAM (Stream2) ||
(Stream1->Direction != Stream2->Direction) || (Stream1->Direction != Stream2->Direction) ||
(Size == 0)) { (Size == 0))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -589,6 +603,7 @@ AmlStreamCmp (
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
CurrPosStream2 = AmlStreamGetCurrPos (Stream2); CurrPosStream2 = AmlStreamGetCurrPos (Stream2);
if (CurrPosStream2 == NULL) { if (CurrPosStream2 == NULL) {
ASSERT (0); ASSERT (0);
@ -645,7 +660,8 @@ AmlStreamCpyS (
if ((DstBuffer == NULL) || if ((DstBuffer == NULL) ||
(MaxDstBufferSize == 0) || (MaxDstBufferSize == 0) ||
(Size > MaxDstBufferSize) || (Size > MaxDstBufferSize) ||
(Size > AmlStreamGetMaxBufferSize (Stream))) { (Size > AmlStreamGetMaxBufferSize (Stream)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -39,9 +39,11 @@ AmlIsNameString (
(ParentPrefix <= MAX_UINT8) && (ParentPrefix <= MAX_UINT8) &&
(!((ParentPrefix != 0) && (Root != 0))) && (!((ParentPrefix != 0) && (Root != 0))) &&
(SegCount <= MAX_UINT8) && (SegCount <= MAX_UINT8) &&
((SegCount + Root + ParentPrefix) != 0)) { ((SegCount + Root + ParentPrefix) != 0))
{
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
@ -70,7 +72,8 @@ AmlUpperCaseMemCpyS (
UINT32 Index; UINT32 Index;
if ((DstBuffer == NULL) || if ((DstBuffer == NULL) ||
(SrcBuffer == NULL)) { (SrcBuffer == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -142,7 +145,7 @@ AmlIsLeadNameChar (
IN CHAR8 Ch IN CHAR8 Ch
) )
{ {
if ((Ch == '_') || (Ch >= 'A' && Ch <= 'Z') || (Ch >= 'a' && Ch <= 'z')) { if ((Ch == '_') || ((Ch >= 'A') && (Ch <= 'Z')) || ((Ch >= 'a') && (Ch <= 'z'))) {
return TRUE; return TRUE;
} else { } else {
return FALSE; return FALSE;
@ -174,7 +177,7 @@ AmlIsNameChar (
IN CHAR8 Ch IN CHAR8 Ch
) )
{ {
if (AmlIsLeadNameChar (Ch) || (Ch >= '0' && Ch <= '9')) { if (AmlIsLeadNameChar (Ch) || ((Ch >= '0') && (Ch <= '9'))) {
return TRUE; return TRUE;
} else { } else {
return FALSE; return FALSE;
@ -202,7 +205,8 @@ AslIsNameSeg (
UINT32 Index; UINT32 Index;
if ((AslBuffer == NULL) || if ((AslBuffer == NULL) ||
(Size == NULL)) { (Size == NULL))
{
return FALSE; return FALSE;
} }
@ -212,7 +216,8 @@ AslIsNameSeg (
for (Index = 1; Index < AML_NAME_SEG_SIZE; Index++) { for (Index = 1; Index < AML_NAME_SEG_SIZE; Index++) {
if ((AslBuffer[Index] == '.') || if ((AslBuffer[Index] == '.') ||
(AslBuffer[Index] == '\0')) { (AslBuffer[Index] == '\0'))
{
*Size = Index; *Size = Index;
return TRUE; return TRUE;
} else if (!AmlIsNameChar (AslBuffer[Index])) { } else if (!AmlIsNameChar (AslBuffer[Index])) {
@ -290,7 +295,8 @@ AslParseNameStringInfo (
if ((Buffer == NULL) || if ((Buffer == NULL) ||
(Root == NULL) || (Root == NULL) ||
(ParentPrefix == NULL) || (ParentPrefix == NULL) ||
(SegCount == NULL)) { (SegCount == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -372,7 +378,8 @@ AmlParseNameStringInfo (
if ((Buffer == NULL) || if ((Buffer == NULL) ||
(Root == NULL) || (Root == NULL) ||
(ParentPrefix == NULL) || (ParentPrefix == NULL) ||
(SegCount == NULL)) { (SegCount == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -512,7 +519,8 @@ AslGetNameStringSize (
) )
{ {
if ((AslPath == NULL) || if ((AslPath == NULL) ||
(AslPathSizePtr == NULL)) { (AslPathSizePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -548,7 +556,8 @@ AmlGetNameStringSize (
UINT32 SegCount; UINT32 SegCount;
if ((AmlPath == NULL) || if ((AmlPath == NULL) ||
(AmlPathSizePtr == NULL)) { (AmlPathSizePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -604,7 +613,8 @@ ConvertAslNameToAmlName (
CHAR8 *AmlPath; CHAR8 *AmlPath;
if ((AslPath == NULL) || if ((AslPath == NULL) ||
(OutAmlPath == NULL)) { (OutAmlPath == NULL))
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -709,7 +719,6 @@ ConvertAslNameToAmlName (
} }
} }
} // while } // while
} else { } else {
// (SegCount == 0) // (SegCount == 0)
// '\0' needs to end the AML NameString/path. // '\0' needs to end the AML NameString/path.
@ -721,7 +730,8 @@ ConvertAslNameToAmlName (
// Check that AmlPath has been filled with TotalSize bytes. // Check that AmlPath has been filled with TotalSize bytes.
if ((SegCount != 0) || if ((SegCount != 0) ||
(*AslBuffer != AML_ZERO_OP) || (*AslBuffer != AML_ZERO_OP) ||
(((UINT32)(AmlBuffer - AmlPath)) != TotalSize)) { (((UINT32)(AmlBuffer - AmlPath)) != TotalSize))
{
ASSERT (0); ASSERT (0);
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto error_handler; goto error_handler;
@ -765,7 +775,8 @@ ConvertAmlNameToAslName (
CHAR8 *AslPath; CHAR8 *AslPath;
if ((AmlPath == NULL) || if ((AmlPath == NULL) ||
(OutAslPath == NULL)) { (OutAslPath == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -869,7 +880,8 @@ AslCompareNameString (
UINT32 AslName2Len; UINT32 AslName2Len;
if ((AslName1 == NULL) || if ((AslName1 == NULL) ||
(AslName2 == NULL)) { (AslName2 == NULL))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -914,7 +926,8 @@ AmlCompareNameString (
UINT32 AmlName2Len; UINT32 AmlName2Len;
if ((AmlName1 == NULL) || if ((AmlName1 == NULL) ||
(AmlName2 == NULL)) { (AmlName2 == NULL))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -966,7 +979,8 @@ CompareAmlWithAslNameString (
BOOLEAN RetVal; BOOLEAN RetVal;
if ((AmlName1 == NULL) || if ((AmlName1 == NULL) ||
(AslName2 == NULL)) { (AslName2 == NULL))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -986,6 +1000,7 @@ CompareAmlWithAslNameString (
return RetVal; return RetVal;
} }
/** Given an AmlPath, return the address of the first NameSeg. /** Given an AmlPath, return the address of the first NameSeg.
It is possible to determine the size of an AML NameString/path just It is possible to determine the size of an AML NameString/path just

View File

@ -38,7 +38,8 @@ AmlCloneNode (
AML_ROOT_NODE *RootNode; AML_ROOT_NODE *RootNode;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(ClonedNode == NULL)) { (ClonedNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -116,7 +117,8 @@ AmlCloneTree (
LIST_ENTRY *CurrentLink; LIST_ENTRY *CurrentLink;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(ClonedNode == NULL)) { (ClonedNode == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -98,7 +98,8 @@ AmlCreateRootNode (
AML_ROOT_NODE *RootNode; AML_ROOT_NODE *RootNode;
if ((SdtHeader == NULL) || if ((SdtHeader == NULL) ||
(NewRootNodePtr == NULL)) { (NewRootNodePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -187,7 +188,8 @@ AmlCreateObjectNode (
AML_OBJECT_NODE *ObjectNode; AML_OBJECT_NODE *ObjectNode;
if ((AmlByteEncoding == NULL) || if ((AmlByteEncoding == NULL) ||
(NewObjectNodePtr == NULL)) { (NewObjectNodePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -289,7 +291,8 @@ AmlCreateDataNode (
(DataType == EAmlNodeDataTypeReserved5) || (DataType == EAmlNodeDataTypeReserved5) ||
(Data == NULL) || (Data == NULL) ||
(DataSize == 0) || (DataSize == 0) ||
(NewDataNodePtr == NULL)) { (NewDataNodePtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -344,7 +347,8 @@ AmlDeleteNode (
// When removing the node, its parent and list are reset // When removing the node, its parent and list are reset
// with InitializeListHead. Thus it must be empty. // with InitializeListHead. Thus it must be empty.
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
!AML_NODE_IS_DETACHED (Node)) { !AML_NODE_IS_DETACHED (Node))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -362,6 +366,7 @@ AmlDeleteNode (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
} }
break; break;
} }
@ -385,6 +390,7 @@ AmlDeleteNode (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
} }
break; break;
} }
@ -394,6 +400,7 @@ AmlDeleteNode (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ASSERT (0); ASSERT (0);
} }
break; break;
} }
@ -426,7 +433,8 @@ AmlNodeHasAttribute (
) )
{ {
if (!IS_AML_OBJECT_NODE (ObjectNode) || if (!IS_AML_OBJECT_NODE (ObjectNode) ||
(ObjectNode->AmlByteEncoding == NULL)) { (ObjectNode->AmlByteEncoding == NULL))
{
return FALSE; return FALSE;
} }
@ -453,7 +461,8 @@ AmlNodeCompareOpCode (
) )
{ {
if (!IS_AML_OBJECT_NODE (ObjectNode) || if (!IS_AML_OBJECT_NODE (ObjectNode) ||
(ObjectNode->AmlByteEncoding == NULL)) { (ObjectNode->AmlByteEncoding == NULL))
{
return FALSE; return FALSE;
} }
@ -486,7 +495,8 @@ IsIntegerNode (
UINT8 OpCode; UINT8 OpCode;
if (!IS_AML_OBJECT_NODE (Node) || if (!IS_AML_OBJECT_NODE (Node) ||
(Node->AmlByteEncoding == NULL)) { (Node->AmlByteEncoding == NULL))
{
return FALSE; return FALSE;
} }
@ -495,7 +505,8 @@ IsIntegerNode (
if ((OpCode != AML_BYTE_PREFIX) && if ((OpCode != AML_BYTE_PREFIX) &&
(OpCode != AML_WORD_PREFIX) && (OpCode != AML_WORD_PREFIX) &&
(OpCode != AML_DWORD_PREFIX) && (OpCode != AML_DWORD_PREFIX) &&
(OpCode != AML_QWORD_PREFIX)) { (OpCode != AML_QWORD_PREFIX))
{
return FALSE; return FALSE;
} }
@ -521,7 +532,8 @@ IsSpecialIntegerNode (
UINT8 OpCode; UINT8 OpCode;
if (!IS_AML_OBJECT_NODE (Node) || if (!IS_AML_OBJECT_NODE (Node) ||
(Node->AmlByteEncoding == NULL)) { (Node->AmlByteEncoding == NULL))
{
return FALSE; return FALSE;
} }
@ -529,7 +541,8 @@ IsSpecialIntegerNode (
if ((OpCode != AML_ZERO_OP) && if ((OpCode != AML_ZERO_OP) &&
(OpCode != AML_ONE_OP) && (OpCode != AML_ONE_OP) &&
(OpCode != AML_ONES_OP)) { (OpCode != AML_ONES_OP))
{
return FALSE; return FALSE;
} }
@ -575,7 +588,8 @@ AmlIsMethodDefinitionNode (
); );
if (IS_AML_DATA_NODE (ObjectType) && if (IS_AML_DATA_NODE (ObjectType) &&
(ObjectType->DataType == EAmlNodeDataTypeUInt) && (ObjectType->DataType == EAmlNodeDataTypeUInt) &&
((ObjectType->Size == 1))) { ((ObjectType->Size == 1)))
{
if (*((UINT8 *)ObjectType->Buffer) == (UINT8)EAmlObjTypeMethodObj) { if (*((UINT8 *)ObjectType->Buffer) == (UINT8)EAmlObjTypeMethodObj) {
// The external definition is a method. // The external definition is a method.
return TRUE; return TRUE;
@ -613,7 +627,8 @@ AmlNodeGetNameIndex (
if (!AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE) || if (!AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE) ||
(ObjectNode->AmlByteEncoding == NULL) || (ObjectNode->AmlByteEncoding == NULL) ||
(Index == NULL)) { (Index == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -621,7 +636,8 @@ AmlNodeGetNameIndex (
NameIndex = ObjectNode->AmlByteEncoding->NameIndex; NameIndex = ObjectNode->AmlByteEncoding->NameIndex;
if ((NameIndex > ObjectNode->AmlByteEncoding->MaxIndex) || if ((NameIndex > ObjectNode->AmlByteEncoding->MaxIndex) ||
(ObjectNode->AmlByteEncoding->Format[NameIndex] != EAmlName)) { (ObjectNode->AmlByteEncoding->Format[NameIndex] != EAmlName))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -667,7 +683,8 @@ AmlNodeGetName (
// The name is stored in a Data node. // The name is stored in a Data node.
DataNode = (AML_DATA_NODE *)ObjectNode->FixedArgs[NameIndex]; DataNode = (AML_DATA_NODE *)ObjectNode->FixedArgs[NameIndex];
if (IS_AML_DATA_NODE (DataNode) && if (IS_AML_DATA_NODE (DataNode) &&
(DataNode->DataType == EAmlNodeDataTypeNameString)) { (DataNode->DataType == EAmlNodeDataTypeNameString))
{
return (CHAR8 *)DataNode->Buffer; return (CHAR8 *)DataNode->Buffer;
} }

View File

@ -53,7 +53,8 @@ AmlGetRootNodeInfo (
) )
{ {
if (!IS_AML_ROOT_NODE (RootNode) || if (!IS_AML_ROOT_NODE (RootNode) ||
(SdtHeaderBuffer == NULL)) { (SdtHeaderBuffer == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -109,12 +110,15 @@ AmlGetObjectNodeInfo (
if (OpCode != NULL) { if (OpCode != NULL) {
*OpCode = ObjectNode->AmlByteEncoding->OpCode; *OpCode = ObjectNode->AmlByteEncoding->OpCode;
} }
if (SubOpCode != NULL) { if (SubOpCode != NULL) {
*SubOpCode = ObjectNode->AmlByteEncoding->SubOpCode; *SubOpCode = ObjectNode->AmlByteEncoding->SubOpCode;
} }
if (PkgLen != NULL) { if (PkgLen != NULL) {
*PkgLen = ObjectNode->PkgLen; *PkgLen = ObjectNode->PkgLen;
} }
if (IsNameSpaceNode != NULL) { if (IsNameSpaceNode != NULL) {
*IsNameSpaceNode = AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE); *IsNameSpaceNode = AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE);
} }
@ -135,7 +139,8 @@ AmlGetFixedArgumentCount (
) )
{ {
if (IS_AML_OBJECT_NODE (Node) && if (IS_AML_OBJECT_NODE (Node) &&
(Node->AmlByteEncoding != NULL)) { (Node->AmlByteEncoding != NULL))
{
return (UINT8)Node->AmlByteEncoding->MaxIndex; return (UINT8)Node->AmlByteEncoding->MaxIndex;
} }
@ -159,7 +164,8 @@ AmlGetNodeDataType (
) )
{ {
if (!IS_AML_DATA_NODE (DataNode) || if (!IS_AML_DATA_NODE (DataNode) ||
(DataType == NULL)) { (DataType == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -193,7 +199,8 @@ AmlGetResourceDataType (
{ {
if (!IS_AML_DATA_NODE (DataNode) || if (!IS_AML_DATA_NODE (DataNode) ||
(ResourceDataType == NULL) || (ResourceDataType == NULL) ||
(DataNode->DataType != EAmlNodeDataTypeResourceData)) { (DataNode->DataType != EAmlNodeDataTypeResourceData))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -233,13 +240,15 @@ AmlGetDataNodeBuffer (
) )
{ {
if (!IS_AML_DATA_NODE (DataNode) || if (!IS_AML_DATA_NODE (DataNode) ||
(BufferSize == NULL)) { (BufferSize == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if ((*BufferSize >= DataNode->Size) && if ((*BufferSize >= DataNode->Size) &&
(Buffer != NULL)) { (Buffer != NULL))
{
CopyMem (Buffer, DataNode->Buffer, DataNode->Size); CopyMem (Buffer, DataNode->Buffer, DataNode->Size);
} }
@ -275,7 +284,8 @@ AmlUpdateRootNode (
((SdtHeader->Signature != ((SdtHeader->Signature !=
EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) && EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) &&
(SdtHeader->Signature != (SdtHeader->Signature !=
EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))) { EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -334,7 +344,8 @@ AmlUpdateInteger (
if (!IS_AML_OBJECT_NODE (IntegerOpNode) || if (!IS_AML_OBJECT_NODE (IntegerOpNode) ||
(!IsIntegerNode (IntegerOpNode) && (!IsIntegerNode (IntegerOpNode) &&
!IsSpecialIntegerNode (IntegerOpNode)) || !IsSpecialIntegerNode (IntegerOpNode)) ||
AmlNodeCompareOpCode (IntegerOpNode, AML_ONES_OP, 0)) { AmlNodeCompareOpCode (IntegerOpNode, AML_ONES_OP, 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -396,7 +407,8 @@ AmlUpdateDataNode (
if (!IS_AML_DATA_NODE (DataNode) || if (!IS_AML_DATA_NODE (DataNode) ||
(DataType > EAmlNodeDataTypeMax) || (DataType > EAmlNodeDataTypeMax) ||
(Buffer == NULL) || (Buffer == NULL) ||
(Size == 0)) { (Size == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -419,7 +431,8 @@ AmlUpdateDataNode (
(((ExpectedArgType != EAmlNodeDataTypeRaw) && (((ExpectedArgType != EAmlNodeDataTypeRaw) &&
(ExpectedArgType != EAmlNodeDataTypeResourceData)) || (ExpectedArgType != EAmlNodeDataTypeResourceData)) ||
((DataType != EAmlNodeDataTypeRaw) && ((DataType != EAmlNodeDataTypeRaw) &&
(DataType != EAmlNodeDataTypeResourceData)))) { (DataType != EAmlNodeDataTypeResourceData))))
{
ASSERT (0); ASSERT (0);
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -432,10 +445,12 @@ AmlUpdateDataNode (
// with the right size. // with the right size.
Status = AmlGetNameStringSize ((CONST CHAR8 *)Buffer, &ExpectedSize); Status = AmlGetNameStringSize ((CONST CHAR8 *)Buffer, &ExpectedSize);
if (EFI_ERROR (Status) || if (EFI_ERROR (Status) ||
(Size != ExpectedSize)) { (Size != ExpectedSize))
{
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
break; break;
} }
case EAmlNodeDataTypeString: case EAmlNodeDataTypeString:
@ -450,6 +465,7 @@ AmlUpdateDataNode (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
ExpectedSize++; ExpectedSize++;
} }
@ -457,13 +473,15 @@ AmlUpdateDataNode (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
break; break;
} }
case EAmlNodeDataTypeUInt: case EAmlNodeDataTypeUInt:
{ {
if (AmlIsNodeFixedArgument ((CONST AML_NODE_HEADER *)DataNode, &Index)) { if (AmlIsNodeFixedArgument ((CONST AML_NODE_HEADER *)DataNode, &Index)) {
if ((ParentNode->AmlByteEncoding == NULL) || if ((ParentNode->AmlByteEncoding == NULL) ||
(ParentNode->AmlByteEncoding->Format == NULL)) { (ParentNode->AmlByteEncoding->Format == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -472,11 +490,13 @@ AmlUpdateDataNode (
// E.g. for PackageOp the first fixed argument is of type EAmlUInt8 // E.g. for PackageOp the first fixed argument is of type EAmlUInt8
// and represents the count of elements. This type cannot be changed. // and represents the count of elements. This type cannot be changed.
if ((ParentNode->AmlByteEncoding->Format[Index] != EAmlObject) && if ((ParentNode->AmlByteEncoding->Format[Index] != EAmlObject) &&
(DataNode->Size != Size)) { (DataNode->Size != Size))
{
ASSERT (0); ASSERT (0);
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} }
break; break;
} }
case EAmlNodeDataTypeRaw: case EAmlNodeDataTypeRaw:
@ -486,6 +506,7 @@ AmlUpdateDataNode (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
break; break;
} }
case EAmlNodeDataTypeResourceData: case EAmlNodeDataTypeResourceData:
@ -495,7 +516,8 @@ AmlUpdateDataNode (
// Large resource data must be at least as long as the header // Large resource data must be at least as long as the header
// of a large resource data. // of a large resource data.
if (AML_RD_IS_LARGE (Buffer) && if (AML_RD_IS_LARGE (Buffer) &&
(Size < sizeof (ACPI_LARGE_RESOURCE_HEADER))) { (Size < sizeof (ACPI_LARGE_RESOURCE_HEADER)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -529,6 +551,7 @@ AmlUpdateDataNode (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
break; break;
} }
// None and reserved types. // None and reserved types.
@ -564,6 +587,7 @@ AmlUpdateDataNode (
ASSERT (0); ASSERT (0);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
DataNode->Size = Size; DataNode->Size = Size;
} }

View File

@ -27,7 +27,8 @@ AmlGetParent (
) )
{ {
if (IS_AML_DATA_NODE (Node) || if (IS_AML_DATA_NODE (Node) ||
IS_AML_OBJECT_NODE (Node)) { IS_AML_OBJECT_NODE (Node))
{
return Node->Parent; return Node->Parent;
} }
@ -60,6 +61,7 @@ AmlGetRootNode (
return NULL; return NULL;
} }
} }
return (AML_ROOT_NODE *)Node; return (AML_ROOT_NODE *)Node;
} }
@ -117,7 +119,8 @@ AmlIsNodeFixedArgument (
if ((IndexPtr == NULL) || if ((IndexPtr == NULL) ||
(!IS_AML_DATA_NODE (Node) && (!IS_AML_DATA_NODE (Node) &&
!IS_AML_OBJECT_NODE (Node))) { !IS_AML_OBJECT_NODE (Node)))
{
ASSERT (0); ASSERT (0);
return FALSE; return FALSE;
} }
@ -172,7 +175,8 @@ AmlSetFixedArgument (
(Index <= (EAML_PARSE_INDEX)AmlGetFixedArgumentCount (ObjectNode)) && (Index <= (EAML_PARSE_INDEX)AmlGetFixedArgumentCount (ObjectNode)) &&
((NewNode == NULL) || ((NewNode == NULL) ||
IS_AML_OBJECT_NODE (NewNode) || IS_AML_OBJECT_NODE (NewNode) ||
IS_AML_DATA_NODE (NewNode))) { IS_AML_DATA_NODE (NewNode)))
{
ObjectNode->FixedArgs[Index] = NewNode; ObjectNode->FixedArgs[Index] = NewNode;
// If NewNode is a data node or an object node, set its parent. // If NewNode is a data node or an object node, set its parent.
@ -207,6 +211,7 @@ AmlNodeGetVariableArgList (
} else if (IS_AML_OBJECT_NODE (Node)) { } else if (IS_AML_OBJECT_NODE (Node)) {
return &(((AML_OBJECT_NODE *)Node)->VariableArgs); return &(((AML_OBJECT_NODE *)Node)->VariableArgs);
} }
return NULL; return NULL;
} }
@ -234,14 +239,16 @@ AmlRemoveNodeFromVarArgList (
UINT32 Size; UINT32 Size;
if ((!IS_AML_DATA_NODE (Node) && if ((!IS_AML_DATA_NODE (Node) &&
!IS_AML_OBJECT_NODE (Node))) { !IS_AML_OBJECT_NODE (Node)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
ParentNode = AmlGetParent (Node); ParentNode = AmlGetParent (Node);
if (!IS_AML_ROOT_NODE (ParentNode) && if (!IS_AML_ROOT_NODE (ParentNode) &&
!IS_AML_OBJECT_NODE (ParentNode)) { !IS_AML_OBJECT_NODE (ParentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -249,7 +256,9 @@ AmlRemoveNodeFromVarArgList (
// Check the node is in its parent variable list of arguments. // Check the node is in its parent variable list of arguments.
if (!IsNodeInList ( if (!IsNodeInList (
AmlNodeGetVariableArgList (ParentNode), AmlNodeGetVariableArgList (ParentNode),
&Node->Link)) { &Node->Link
))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -322,7 +331,8 @@ AmlVarListAddHead (
!IS_AML_OBJECT_NODE (ParentNode)) || !IS_AML_OBJECT_NODE (ParentNode)) ||
(!IS_AML_DATA_NODE (NewNode) && (!IS_AML_DATA_NODE (NewNode) &&
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode)) { !AML_NODE_IS_DETACHED (NewNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -379,7 +389,8 @@ AmlVarListAddTailInternal (
!IS_AML_OBJECT_NODE (ParentNode)) || !IS_AML_OBJECT_NODE (ParentNode)) ||
(!IS_AML_DATA_NODE (NewNode) && (!IS_AML_DATA_NODE (NewNode) &&
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode)) { !AML_NODE_IS_DETACHED (NewNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -462,14 +473,16 @@ AmlVarListAddBefore (
// Check arguments and that NewNode is not already attached to a tree. // Check arguments and that NewNode is not already attached to a tree.
if ((!IS_AML_DATA_NODE (NewNode) && if ((!IS_AML_DATA_NODE (NewNode) &&
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode)) { !AML_NODE_IS_DETACHED (NewNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
ParentNode = AmlGetParent (Node); ParentNode = AmlGetParent (Node);
if (!IS_AML_ROOT_NODE (ParentNode) && if (!IS_AML_ROOT_NODE (ParentNode) &&
!IS_AML_OBJECT_NODE (ParentNode)) { !IS_AML_OBJECT_NODE (ParentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -516,14 +529,16 @@ AmlVarListAddAfter (
// Check arguments and that NewNode is not already attached to a tree. // Check arguments and that NewNode is not already attached to a tree.
if ((!IS_AML_DATA_NODE (NewNode) && if ((!IS_AML_DATA_NODE (NewNode) &&
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode)) { !AML_NODE_IS_DETACHED (NewNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
ParentNode = AmlGetParent (Node); ParentNode = AmlGetParent (Node);
if (!IS_AML_ROOT_NODE (ParentNode) && if (!IS_AML_ROOT_NODE (ParentNode) &&
!IS_AML_OBJECT_NODE (ParentNode)) { !IS_AML_OBJECT_NODE (ParentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -570,7 +585,8 @@ AmlAppendRdNode (
if (!AmlNodeCompareOpCode (BufferOpNode, AML_BUFFER_OP, 0) || if (!AmlNodeCompareOpCode (BufferOpNode, AML_BUFFER_OP, 0) ||
!IS_AML_DATA_NODE (NewRdNode) || !IS_AML_DATA_NODE (NewRdNode) ||
(NewRdNode->DataType != EAmlNodeDataTypeResourceData)) { (NewRdNode->DataType != EAmlNodeDataTypeResourceData))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -596,7 +612,8 @@ AmlAppendRdNode (
); );
if ((LastRdNode == NULL) || if ((LastRdNode == NULL) ||
!IS_AML_DATA_NODE (LastRdNode) || !IS_AML_DATA_NODE (LastRdNode) ||
(LastRdNode->DataType != EAmlNodeDataTypeResourceData)) { (LastRdNode->DataType != EAmlNodeDataTypeResourceData))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -604,7 +621,8 @@ AmlAppendRdNode (
// Add NewRdNode before the EndTag. // Add NewRdNode before the EndTag.
Status = AmlVarListAddBefore ( Status = AmlVarListAddBefore (
(AML_NODE_HEADER *)LastRdNode, (AML_NODE_HEADER *)LastRdNode,
(AML_NODE_HEADER*)NewRdNode) (AML_NODE_HEADER *)NewRdNode
)
; ;
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return Status; return Status;
@ -644,7 +662,8 @@ AmlReplaceFixedArgument (
if (!IS_AML_OBJECT_NODE (ParentNode) || if (!IS_AML_OBJECT_NODE (ParentNode) ||
(!IS_AML_DATA_NODE (NewNode) && (!IS_AML_DATA_NODE (NewNode) &&
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode)) { !AML_NODE_IS_DETACHED (NewNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -658,10 +677,13 @@ AmlReplaceFixedArgument (
// AML_IS_FIELD_ELEMENT flag. // AML_IS_FIELD_ELEMENT flag.
if (!AmlNodeHasAttribute ( if (!AmlNodeHasAttribute (
(AML_OBJECT_NODE *)ParentNode, (AML_OBJECT_NODE *)ParentNode,
AML_HAS_FIELD_LIST)) { AML_HAS_FIELD_LIST
))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
// Fall through. // Fall through.
} }
@ -677,10 +699,12 @@ AmlReplaceFixedArgument (
// Note: This condition might be too strict, but safer. // Note: This condition might be too strict, but safer.
if (!IS_AML_DATA_NODE (NewNode) || if (!IS_AML_DATA_NODE (NewNode) ||
(((AML_DATA_NODE *)NewNode)->DataType != (((AML_DATA_NODE *)NewNode)->DataType !=
AmlTypeToNodeDataType (FixedArgType))) { AmlTypeToNodeDataType (FixedArgType)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
break; break;
} }
@ -781,14 +805,16 @@ AmlReplaceVariableArgument (
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode) || !AML_NODE_IS_DETACHED (NewNode) ||
AML_NODE_IS_DETACHED (OldNode) || AML_NODE_IS_DETACHED (OldNode) ||
AmlIsNodeFixedArgument (OldNode, &Index)) { AmlIsNodeFixedArgument (OldNode, &Index))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
ParentNode = AmlGetParent (OldNode); ParentNode = AmlGetParent (OldNode);
if (!IS_AML_ROOT_NODE (ParentNode) && if (!IS_AML_ROOT_NODE (ParentNode) &&
!IS_AML_OBJECT_NODE (ParentNode)) { !IS_AML_OBJECT_NODE (ParentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -804,7 +830,8 @@ AmlReplaceVariableArgument (
if (AmlNodeHasAttribute ((AML_OBJECT_NODE *)ParentNode, AML_HAS_BYTE_LIST)) { if (AmlNodeHasAttribute ((AML_OBJECT_NODE *)ParentNode, AML_HAS_BYTE_LIST)) {
if (!IS_AML_DATA_NODE (NewNode) || if (!IS_AML_DATA_NODE (NewNode) ||
((NewDataNode->DataType != EAmlNodeDataTypeRaw) && ((NewDataNode->DataType != EAmlNodeDataTypeRaw) &&
(NewDataNode->DataType != EAmlNodeDataTypeResourceData))) { (NewDataNode->DataType != EAmlNodeDataTypeResourceData)))
{
// A child node of a node with the BYTE_LIST flag must be a data node, // A child node of a node with the BYTE_LIST flag must be a data node,
// containing raw data or a resource data. // containing raw data or a resource data.
ASSERT (0); ASSERT (0);
@ -812,10 +839,14 @@ AmlReplaceVariableArgument (
} }
} else if (AmlNodeHasAttribute ( } else if (AmlNodeHasAttribute (
(AML_OBJECT_NODE *)ParentNode, (AML_OBJECT_NODE *)ParentNode,
AML_HAS_FIELD_LIST)) { AML_HAS_FIELD_LIST
))
{
if (!AmlNodeHasAttribute ( if (!AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)NewNode, (CONST AML_OBJECT_NODE *)NewNode,
AML_IS_FIELD_ELEMENT)) { AML_IS_FIELD_ELEMENT
))
{
// A child node of a node with the FIELD_LIST flag must be an object // A child node of a node with the FIELD_LIST flag must be an object
// node with AML_IS_FIELD_ELEMENT flag. // node with AML_IS_FIELD_ELEMENT flag.
ASSERT (0); ASSERT (0);
@ -895,7 +926,8 @@ AmlReplaceArgument (
!IS_AML_OBJECT_NODE (OldNode)) || !IS_AML_OBJECT_NODE (OldNode)) ||
(!IS_AML_DATA_NODE (NewNode) && (!IS_AML_DATA_NODE (NewNode) &&
!IS_AML_OBJECT_NODE (NewNode)) || !IS_AML_OBJECT_NODE (NewNode)) ||
!AML_NODE_IS_DETACHED (NewNode)) { !AML_NODE_IS_DETACHED (NewNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -903,7 +935,8 @@ AmlReplaceArgument (
// ParentNode can be a root node or an object node. // ParentNode can be a root node or an object node.
ParentNode = AmlGetParent (OldNode); ParentNode = AmlGetParent (OldNode);
if (!IS_AML_ROOT_NODE (ParentNode) && if (!IS_AML_ROOT_NODE (ParentNode) &&
!IS_AML_OBJECT_NODE (ParentNode)) { !IS_AML_OBJECT_NODE (ParentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -961,7 +994,8 @@ AmlDeleteTree (
// InitializeListHead. Thus it must be detached // InitializeListHead. Thus it must be detached
// from the tree to avoid memory leaks. // from the tree to avoid memory leaks.
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
!AML_NODE_IS_DETACHED (Node)) { !AML_NODE_IS_DETACHED (Node))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -124,4 +124,3 @@ AmlReplaceArgument (
); );
#endif // AML_TREE_H_ #endif // AML_TREE_H_

View File

@ -52,6 +52,7 @@ AmlEnumTree (
if (Status != NULL) { if (Status != NULL) {
*Status = EFI_INVALID_PARAMETER; *Status = EFI_INVALID_PARAMETER;
} }
return FALSE; return FALSE;
} }
@ -90,6 +91,7 @@ AmlEnumTree (
if (ContinueEnum == FALSE) { if (ContinueEnum == FALSE) {
return ContinueEnum; return ContinueEnum;
} }
CurrentLink = CurrentLink->ForwardLink; CurrentLink = CurrentLink->ForwardLink;
} // while } // while
} }

View File

@ -62,7 +62,8 @@ AmlIteratorGetNode (
(InternalIterator->Mode >= EAmlIteratorModeMax) || (InternalIterator->Mode >= EAmlIteratorModeMax) ||
!IS_AML_NODE_VALID (InternalIterator->InitialNode) || !IS_AML_NODE_VALID (InternalIterator->InitialNode) ||
((InternalIterator->CurrentNode != NULL) && ((InternalIterator->CurrentNode != NULL) &&
!IS_AML_NODE_VALID (InternalIterator->CurrentNode))) { !IS_AML_NODE_VALID (InternalIterator->CurrentNode)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -99,7 +100,8 @@ AmlIteratorGetNextLinear (
if ((InternalIterator == NULL) || if ((InternalIterator == NULL) ||
(InternalIterator->Mode != EAmlIteratorLinear) || (InternalIterator->Mode != EAmlIteratorLinear) ||
!IS_AML_NODE_VALID (InternalIterator->InitialNode) || !IS_AML_NODE_VALID (InternalIterator->InitialNode) ||
!IS_AML_NODE_VALID (InternalIterator->CurrentNode)) { !IS_AML_NODE_VALID (InternalIterator->CurrentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -112,6 +114,7 @@ AmlIteratorGetNextLinear (
if (NextNode != NULL) { if (NextNode != NULL) {
*NextNode = (AML_NODE_HEADER *)InternalIterator->CurrentNode; *NextNode = (AML_NODE_HEADER *)InternalIterator->CurrentNode;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -142,7 +145,8 @@ AmlIteratorGetPreviousLinear (
if ((InternalIterator == NULL) || if ((InternalIterator == NULL) ||
(InternalIterator->Mode != EAmlIteratorLinear) || (InternalIterator->Mode != EAmlIteratorLinear) ||
!IS_AML_NODE_VALID (InternalIterator->InitialNode) || !IS_AML_NODE_VALID (InternalIterator->InitialNode) ||
!IS_AML_NODE_VALID (InternalIterator->CurrentNode)) { !IS_AML_NODE_VALID (InternalIterator->CurrentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -154,6 +158,7 @@ AmlIteratorGetPreviousLinear (
if (PrevNode != NULL) { if (PrevNode != NULL) {
*PrevNode = (AML_NODE_HEADER *)InternalIterator->CurrentNode; *PrevNode = (AML_NODE_HEADER *)InternalIterator->CurrentNode;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -185,7 +190,8 @@ AmlIteratorGetNextBranch (
if ((InternalIterator == NULL) || if ((InternalIterator == NULL) ||
(InternalIterator->Mode != EAmlIteratorBranch) || (InternalIterator->Mode != EAmlIteratorBranch) ||
!IS_AML_NODE_VALID (InternalIterator->InitialNode) || !IS_AML_NODE_VALID (InternalIterator->InitialNode) ||
!IS_AML_NODE_VALID (InternalIterator->CurrentNode)) { !IS_AML_NODE_VALID (InternalIterator->CurrentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -193,7 +199,8 @@ AmlIteratorGetNextBranch (
Node = AmlGetNextNode (InternalIterator->CurrentNode); Node = AmlGetNextNode (InternalIterator->CurrentNode);
// Check whether NextNode is a sibling of InitialNode. // Check whether NextNode is a sibling of InitialNode.
if (AmlGetParent (Node) == if (AmlGetParent (Node) ==
AmlGetParent ((AML_NODE_HEADER*)InternalIterator->InitialNode)) { AmlGetParent ((AML_NODE_HEADER *)InternalIterator->InitialNode))
{
Node = NULL; Node = NULL;
} }
@ -202,6 +209,7 @@ AmlIteratorGetNextBranch (
if (NextNode != NULL) { if (NextNode != NULL) {
*NextNode = Node; *NextNode = Node;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -233,7 +241,8 @@ AmlIteratorGetPreviousBranch (
if ((InternalIterator == NULL) || if ((InternalIterator == NULL) ||
(InternalIterator->Mode != EAmlIteratorBranch) || (InternalIterator->Mode != EAmlIteratorBranch) ||
!IS_AML_NODE_VALID (InternalIterator->InitialNode) || !IS_AML_NODE_VALID (InternalIterator->InitialNode) ||
!IS_AML_NODE_VALID (InternalIterator->CurrentNode)) { !IS_AML_NODE_VALID (InternalIterator->CurrentNode))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -241,7 +250,8 @@ AmlIteratorGetPreviousBranch (
Node = AmlGetPreviousNode (InternalIterator->CurrentNode); Node = AmlGetPreviousNode (InternalIterator->CurrentNode);
// Check whether PreviousNode is a sibling of InitialNode. // Check whether PreviousNode is a sibling of InitialNode.
if (AmlGetParent (Node) == if (AmlGetParent (Node) ==
AmlGetParent ((AML_NODE_HEADER*)InternalIterator->InitialNode)) { AmlGetParent ((AML_NODE_HEADER *)InternalIterator->InitialNode))
{
Node = NULL; Node = NULL;
} }
@ -250,6 +260,7 @@ AmlIteratorGetPreviousBranch (
if (PrevNode != NULL) { if (PrevNode != NULL) {
*PrevNode = Node; *PrevNode = Node;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -279,7 +290,8 @@ AmlInitializeIterator (
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(IteratorMode <= EAmlIteratorUnknown) || (IteratorMode <= EAmlIteratorUnknown) ||
(IteratorMode >= EAmlIteratorModeMax) || (IteratorMode >= EAmlIteratorModeMax) ||
(IteratorPtr == NULL)) { (IteratorPtr == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }

View File

@ -175,7 +175,6 @@ typedef struct AmlTreeIterator {
EDKII_AML_TREE_ITERATOR_GET_PREVIOUS GetPrevious; EDKII_AML_TREE_ITERATOR_GET_PREVIOUS GetPrevious;
} AML_TREE_ITERATOR; } AML_TREE_ITERATOR;
/** Initialize an iterator. /** Initialize an iterator.
Note: The caller must call AmlDeleteIterator () to free the memory Note: The caller must call AmlDeleteIterator () to free the memory

View File

@ -47,7 +47,8 @@ AmlGetSiblingVariableArgument (
// and be in a variable list of arguments. // and be in a variable list of arguments.
if ((!IS_AML_OBJECT_NODE (VarArgNode) && if ((!IS_AML_OBJECT_NODE (VarArgNode) &&
!IS_AML_DATA_NODE (VarArgNode)) || !IS_AML_DATA_NODE (VarArgNode)) ||
AmlIsNodeFixedArgument (VarArgNode, &Index)) { AmlIsNodeFixedArgument (VarArgNode, &Index))
{
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
@ -98,7 +99,8 @@ AmlGetNextVariableArgument (
!IS_AML_OBJECT_NODE (Node)) || !IS_AML_OBJECT_NODE (Node)) ||
((CurrVarArg != NULL) && ((CurrVarArg != NULL) &&
(!IS_AML_OBJECT_NODE (CurrVarArg) && (!IS_AML_OBJECT_NODE (CurrVarArg) &&
!IS_AML_DATA_NODE (CurrVarArg)))) { !IS_AML_DATA_NODE (CurrVarArg))))
{
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
@ -114,6 +116,7 @@ AmlGetNextVariableArgument (
if (NextLink != StartLink) { if (NextLink != StartLink) {
return (AML_NODE_HEADER *)NextLink; return (AML_NODE_HEADER *)NextLink;
} }
// List is empty. // List is empty.
return NULL; return NULL;
} }
@ -172,7 +175,8 @@ AmlGetPreviousVariableArgument (
!IS_AML_OBJECT_NODE (Node)) || !IS_AML_OBJECT_NODE (Node)) ||
((CurrVarArg != NULL) && ((CurrVarArg != NULL) &&
(!IS_AML_OBJECT_NODE (CurrVarArg) && (!IS_AML_OBJECT_NODE (CurrVarArg) &&
!IS_AML_DATA_NODE (CurrVarArg)))) { !IS_AML_DATA_NODE (CurrVarArg))))
{
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
@ -188,6 +192,7 @@ AmlGetPreviousVariableArgument (
if (PreviousLink != StartLink) { if (PreviousLink != StartLink) {
return (AML_NODE_HEADER *)PreviousLink; return (AML_NODE_HEADER *)PreviousLink;
} }
// List is empty. // List is empty.
return NULL; return NULL;
} }
@ -253,7 +258,8 @@ AmlGetNextSibling (
!IS_AML_OBJECT_NODE (Node)) || !IS_AML_OBJECT_NODE (Node)) ||
((ChildNode != NULL) && ((ChildNode != NULL) &&
(!IS_AML_OBJECT_NODE (ChildNode) && (!IS_AML_OBJECT_NODE (ChildNode) &&
!IS_AML_DATA_NODE (ChildNode)))) { !IS_AML_DATA_NODE (ChildNode))))
{
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
@ -275,8 +281,10 @@ AmlGetNextSibling (
Index++; Index++;
// The node is part of the list of fixed arguments. // The node is part of the list of fixed arguments.
if (Index == (EAML_PARSE_INDEX)AmlGetFixedArgumentCount ( if (Index == (EAML_PARSE_INDEX)AmlGetFixedArgumentCount (
(AML_OBJECT_NODE*)Node) (AML_OBJECT_NODE *)Node
) { )
)
{
// It is at the last argument of the fixed argument list. // It is at the last argument of the fixed argument list.
// Get the first argument of the variable list of arguments. // Get the first argument of the variable list of arguments.
ChildNode = NULL; ChildNode = NULL;
@ -340,7 +348,8 @@ AmlGetPreviousSibling (
!IS_AML_OBJECT_NODE (Node)) || !IS_AML_OBJECT_NODE (Node)) ||
((ChildNode != NULL) && ((ChildNode != NULL) &&
(!IS_AML_OBJECT_NODE (ChildNode) && (!IS_AML_OBJECT_NODE (ChildNode) &&
!IS_AML_DATA_NODE (ChildNode)))) { !IS_AML_DATA_NODE (ChildNode))))
{
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
@ -353,7 +362,8 @@ AmlGetPreviousSibling (
// Otherwise the fixed argument list is checked first. // Otherwise the fixed argument list is checked first.
if ((ChildNode != NULL) && if ((ChildNode != NULL) &&
IS_AML_OBJECT_NODE (Node) && IS_AML_OBJECT_NODE (Node) &&
(MaxIndex != EAmlParseIndexTerm0)) { (MaxIndex != EAmlParseIndexTerm0))
{
if (AmlIsNodeFixedArgument (ChildNode, &Index)) { if (AmlIsNodeFixedArgument (ChildNode, &Index)) {
// The node is part of the list of fixed arguments. // The node is part of the list of fixed arguments.
if (Index == EAmlParseIndexTerm0) { if (Index == EAmlParseIndexTerm0) {
@ -379,6 +389,7 @@ AmlGetPreviousSibling (
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
// A Node has been found // A Node has been found
return CandidateNode; return CandidateNode;
} else if (MaxIndex != EAmlParseIndexTerm0) { } else if (MaxIndex != EAmlParseIndexTerm0) {
@ -435,6 +446,7 @@ AmlGetNextNode (
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
// A Node has been found // A Node has been found
return CandidateNode; return CandidateNode;
} else if (IS_AML_ROOT_NODE (Node)) { } else if (IS_AML_ROOT_NODE (Node)) {
@ -464,6 +476,7 @@ AmlGetNextNode (
ASSERT (0); ASSERT (0);
return NULL; return NULL;
} }
// A Node has been found // A Node has been found
return CandidateNode; return CandidateNode;
} }
@ -511,7 +524,6 @@ AmlGetPreviousNode (
} }
while (1) { while (1) {
if (IS_AML_ROOT_NODE (Node)) { if (IS_AML_ROOT_NODE (Node)) {
// This is the root node. // This is the root node.
return NULL; return NULL;
@ -539,7 +551,6 @@ AmlGetPreviousNode (
return CandidateNode; return CandidateNode;
} }
} // while } // while
} else { } else {
ASSERT (0); ASSERT (0);
return NULL; return NULL;

View File

@ -135,4 +135,3 @@ AmlGetPreviousNode (
); );
#endif // AML_TREE_TRAVERSAL_H_ #endif // AML_TREE_TRAVERSAL_H_

View File

@ -86,11 +86,13 @@ AmlComputeSizeCallback (
CONST AML_OBJECT_NODE *ParentNode; CONST AML_OBJECT_NODE *ParentNode;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(Context == NULL)) { (Context == NULL))
{
ASSERT (0); ASSERT (0);
if (Status != NULL) { if (Status != NULL) {
*Status = EFI_INVALID_PARAMETER; *Status = EFI_INVALID_PARAMETER;
} }
return FALSE; return FALSE;
} }
@ -100,11 +102,13 @@ AmlComputeSizeCallback (
ParentNode = (CONST AML_OBJECT_NODE *)AmlGetParent (Node); ParentNode = (CONST AML_OBJECT_NODE *)AmlGetParent (Node);
if (IS_AML_OBJECT_NODE (ParentNode) && if (IS_AML_OBJECT_NODE (ParentNode) &&
AmlNodeCompareOpCode (ParentNode, AML_METHOD_INVOC_OP, 0) && AmlNodeCompareOpCode (ParentNode, AML_METHOD_INVOC_OP, 0) &&
AmlIsNodeFixedArgument (Node, &IndexPtr)) { AmlIsNodeFixedArgument (Node, &IndexPtr))
{
if (IndexPtr == EAmlParseIndexTerm1) { if (IndexPtr == EAmlParseIndexTerm1) {
if (Status != NULL) { if (Status != NULL) {
*Status = EFI_SUCCESS; *Status = EFI_SUCCESS;
} }
return TRUE; return TRUE;
} }
} }
@ -116,7 +120,9 @@ AmlComputeSizeCallback (
} else if (IS_AML_OBJECT_NODE (Node) && } else if (IS_AML_OBJECT_NODE (Node) &&
!AmlNodeHasAttribute ( !AmlNodeHasAttribute (
(CONST AML_OBJECT_NODE *)Node, (CONST AML_OBJECT_NODE *)Node,
AML_IS_PSEUDO_OPCODE)) { AML_IS_PSEUDO_OPCODE
))
{
// Ignore pseudo-opcodes as they are not part of the // Ignore pseudo-opcodes as they are not part of the
// ACPI specification. // ACPI specification.
@ -126,7 +132,9 @@ AmlComputeSizeCallback (
// Add the size of the PkgLen. // Add the size of the PkgLen.
if (AmlNodeHasAttribute ( if (AmlNodeHasAttribute (
(AML_OBJECT_NODE *)Node, (AML_OBJECT_NODE *)Node,
AML_HAS_PKG_LENGTH)) { AML_HAS_PKG_LENGTH
))
{
Size += AmlComputePkgLengthWidth (((AML_OBJECT_NODE *)Node)->PkgLen); Size += AmlComputePkgLengthWidth (((AML_OBJECT_NODE *)Node)->PkgLen);
} }
} }
@ -166,7 +174,8 @@ AmlComputeSize (
EFI_STATUS Status; EFI_STATUS Status;
if (!IS_AML_NODE_VALID (Node) || if (!IS_AML_NODE_VALID (Node) ||
(Size == NULL)) { (Size == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -203,7 +212,8 @@ AmlNodeGetIntegerValue (
if ((!IsIntegerNode (Node) && if ((!IsIntegerNode (Node) &&
!IsSpecialIntegerNode (Node)) || !IsSpecialIntegerNode (Node)) ||
(Value == NULL)) { (Value == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -219,13 +229,15 @@ AmlNodeGetIntegerValue (
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
// For integer nodes, the value is in the first fixed argument. // For integer nodes, the value is in the first fixed argument.
DataNode = (AML_DATA_NODE *)Node->FixedArgs[EAmlParseIndexTerm0]; DataNode = (AML_DATA_NODE *)Node->FixedArgs[EAmlParseIndexTerm0];
if (!IS_AML_DATA_NODE (DataNode) || if (!IS_AML_DATA_NODE (DataNode) ||
(DataNode->DataType != EAmlNodeDataTypeUInt)) { (DataNode->DataType != EAmlNodeDataTypeUInt))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -373,7 +385,8 @@ AmlNodeSetIntegerValue (
if ((!IsIntegerNode (Node) && if ((!IsIntegerNode (Node) &&
!IsSpecialIntegerNode (Node)) || !IsSpecialIntegerNode (Node)) ||
(ValueWidthDiff == NULL)) { (ValueWidthDiff == NULL))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -396,6 +409,7 @@ AmlNodeSetIntegerValue (
ASSERT (0); ASSERT (0);
return Status; return Status;
} }
// The AmlUnwindSpecialInteger functions converts a special integer // The AmlUnwindSpecialInteger functions converts a special integer
// node to a UInt8/Byte data node. Thus, the size increments by one: // node to a UInt8/Byte data node. Thus, the size increments by one:
// special integer are encoded as one byte (the opcode only) while byte // special integer are encoded as one byte (the opcode only) while byte
@ -408,7 +422,8 @@ AmlNodeSetIntegerValue (
// For integer nodes, the value is in the first fixed argument. // For integer nodes, the value is in the first fixed argument.
DataNode = (AML_DATA_NODE *)Node->FixedArgs[EAmlParseIndexTerm0]; DataNode = (AML_DATA_NODE *)Node->FixedArgs[EAmlParseIndexTerm0];
if (!IS_AML_DATA_NODE (DataNode) || if (!IS_AML_DATA_NODE (DataNode) ||
(DataNode->DataType != EAmlNodeDataTypeUInt)) { (DataNode->DataType != EAmlNodeDataTypeUInt))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -473,6 +488,7 @@ AmlNodeSetIntegerValue (
ASSERT (0); ASSERT (0);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
DataNode->Size = NumberOfBytes; DataNode->Size = NumberOfBytes;
} }
@ -528,7 +544,8 @@ AmlNodeUpdateIntegerValue (
// Check for UINT64 over/underflow. // Check for UINT64 over/underflow.
if ((IsIncrement && (Value > (MAX_UINT64 - Diff))) || if ((IsIncrement && (Value > (MAX_UINT64 - Diff))) ||
(!IsIncrement && (Value < Diff))) { (!IsIncrement && (Value < Diff)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -586,7 +603,8 @@ AmlPropagateSize (
INT8 FieldWidthChange; INT8 FieldWidthChange;
if (!IS_AML_OBJECT_NODE (Node) && if (!IS_AML_OBJECT_NODE (Node) &&
!IS_AML_ROOT_NODE (Node)) { !IS_AML_ROOT_NODE (Node))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -624,7 +642,8 @@ AmlPropagateSize (
if ((IsIncrement && if ((IsIncrement &&
(FieldWidthChange < 0)) || (FieldWidthChange < 0)) ||
(!IsIncrement && (!IsIncrement &&
(FieldWidthChange > 0))) { (FieldWidthChange > 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -653,7 +672,8 @@ AmlPropagateSize (
// PkgLen is a 28 bit value, cf 20.2.4 Package Length Encoding // PkgLen is a 28 bit value, cf 20.2.4 Package Length Encoding
// i.e. the maximum value is (2^28 - 1) = ((BIT0 << 28) - 1). // i.e. the maximum value is (2^28 - 1) = ((BIT0 << 28) - 1).
if ((IsIncrement && ((((BIT0 << 28) - 1) - Value) < *Diff)) || if ((IsIncrement && ((((BIT0 << 28) - 1) - Value) < *Diff)) ||
(!IsIncrement && (Value < *Diff))) { (!IsIncrement && (Value < *Diff)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -682,7 +702,8 @@ AmlPropagateSize (
ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Value); ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Value);
if (ReComputedPkgLenWidth != NewPkgLenWidth) { if (ReComputedPkgLenWidth != NewPkgLenWidth) {
if ((ReComputedPkgLenWidth != 0) && if ((ReComputedPkgLenWidth != 0) &&
(ReComputedPkgLenWidth < 4)) { (ReComputedPkgLenWidth < 4))
{
// No need to recompute the PkgLen since a new threshold cannot // No need to recompute the PkgLen since a new threshold cannot
// be reached by incrementing the value by one. // be reached by incrementing the value by one.
Value += 1; Value += 1;
@ -715,14 +736,14 @@ AmlPropagateSize (
return Status; return Status;
} }
} }
} else if (IS_AML_ROOT_NODE (Node)) { } else if (IS_AML_ROOT_NODE (Node)) {
// Update the length field in the SDT header. // Update the length field in the SDT header.
Value = ((AML_ROOT_NODE *)Node)->SdtHeader->Length; Value = ((AML_ROOT_NODE *)Node)->SdtHeader->Length;
// Check for an over/underflows. // Check for an over/underflows.
if ((IsIncrement && (Value > (MAX_UINT32 - *Diff))) || if ((IsIncrement && (Value > (MAX_UINT32 - *Diff))) ||
(!IsIncrement && (Value < *Diff))) { (!IsIncrement && (Value < *Diff)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -776,7 +797,8 @@ AmlPropagateNodeCount (
// Currently there is no use case where (NodeCount > 1). // Currently there is no use case where (NodeCount > 1).
if (!IS_AML_OBJECT_NODE (ObjectNode) || if (!IS_AML_OBJECT_NODE (ObjectNode) ||
(FieldWidthChange == NULL) || (FieldWidthChange == NULL) ||
(NodeCount > 1)) { (NodeCount > 1))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -799,7 +821,8 @@ AmlPropagateNodeCount (
// Check for over/underflow. // Check for over/underflow.
CurrNodeCount = *(((AML_DATA_NODE *)NodeCountArg)->Buffer); CurrNodeCount = *(((AML_DATA_NODE *)NodeCountArg)->Buffer);
if ((IsIncrement && (CurrNodeCount == MAX_UINT8)) || if ((IsIncrement && (CurrNodeCount == MAX_UINT8)) ||
(!IsIncrement && (CurrNodeCount == 0))) { (!IsIncrement && (CurrNodeCount == 0)))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -857,7 +880,8 @@ AmlPropagateInformation (
// Currently there is no use case where (NodeCount > 1). // Currently there is no use case where (NodeCount > 1).
if ((!IS_AML_ROOT_NODE (Node) && if ((!IS_AML_ROOT_NODE (Node) &&
!IS_AML_OBJECT_NODE (Node)) || !IS_AML_OBJECT_NODE (Node)) ||
(NodeCount > 1)) { (NodeCount > 1))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -865,7 +889,8 @@ AmlPropagateInformation (
// Propagate the node count first as it may change the number of bytes // Propagate the node count first as it may change the number of bytes
// needed to store the node count, and then impact FieldWidthChange. // needed to store the node count, and then impact FieldWidthChange.
if ((NodeCount != 0) && if ((NodeCount != 0) &&
IS_AML_OBJECT_NODE (Node)) { IS_AML_OBJECT_NODE (Node))
{
Status = AmlPropagateNodeCount ( Status = AmlPropagateNodeCount (
(AML_OBJECT_NODE *)Node, (AML_OBJECT_NODE *)Node,
IsIncrement, IsIncrement,
@ -885,10 +910,12 @@ AmlPropagateInformation (
((Diff + (UINT8)FieldWidthChange) > MAX_UINT32))) || ((Diff + (UINT8)FieldWidthChange) > MAX_UINT32))) ||
(!IsIncrement && (!IsIncrement &&
((FieldWidthChange > 0) || ((FieldWidthChange > 0) ||
(Diff < (UINT32)ABS (FieldWidthChange))))) { (Diff < (UINT32)ABS (FieldWidthChange)))))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
Diff = (UINT32)(Diff + (UINT8)ABS (FieldWidthChange)); Diff = (UINT32)(Diff + (UINT8)ABS (FieldWidthChange));
} }
@ -953,7 +980,8 @@ AmlSetRdListCheckSum (
); );
if ((LastRdNode == NULL) || if ((LastRdNode == NULL) ||
!IS_AML_DATA_NODE (LastRdNode) || !IS_AML_DATA_NODE (LastRdNode) ||
(LastRdNode->DataType != EAmlNodeDataTypeResourceData)) { (LastRdNode->DataType != EAmlNodeDataTypeResourceData))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -969,7 +997,9 @@ AmlSetRdListCheckSum (
// no EndTag. Return EFI_NOT_FOUND is such case. // no EndTag. Return EFI_NOT_FOUND is such case.
if (!AmlRdCompareDescId ( if (!AmlRdCompareDescId (
&RdDataType, &RdDataType,
AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME))) { AML_RD_BUILD_SMALL_DESC_ID (ACPI_SMALL_END_TAG_DESCRIPTOR_NAME)
))
{
ASSERT (0); ASSERT (0);
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }

View File

@ -140,4 +140,3 @@ AmlSetRdListCheckSum (
); );
#endif // AML_UTILITY_H_ #endif // AML_UTILITY_H_

View File

@ -55,7 +55,8 @@ ValidateSerialPortInfo (
CONST CM_ARM_SERIAL_PORT_INFO *SerialPortInfo; CONST CM_ARM_SERIAL_PORT_INFO *SerialPortInfo;
if ((SerialPortInfoTable == NULL) || if ((SerialPortInfoTable == NULL) ||
(SerialPortCount == 0)) { (SerialPortCount == 0))
{
ASSERT (0); ASSERT (0);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -65,7 +66,8 @@ ValidateSerialPortInfo (
ASSERT (SerialPortInfo != NULL); ASSERT (SerialPortInfo != NULL);
if ((SerialPortInfo == NULL) || if ((SerialPortInfo == NULL) ||
(SerialPortInfo->BaseAddress == 0)) { (SerialPortInfo->BaseAddress == 0))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: UART port base address is invalid. BaseAddress = 0x%llx\n", "ERROR: UART port base address is invalid. BaseAddress = 0x%llx\n",
@ -83,7 +85,8 @@ ValidateSerialPortInfo (
(SerialPortInfo->PortSubtype != (SerialPortInfo->PortSubtype !=
EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_DCC) && EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_DCC) &&
(SerialPortInfo->PortSubtype != (SerialPortInfo->PortSubtype !=
EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_FULL_16550)) { EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_FULL_16550))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: UART port subtype is invalid." "ERROR: UART port subtype is invalid."
@ -97,7 +100,8 @@ ValidateSerialPortInfo (
DEBUG ((DEBUG_INFO, "UART Configuration:\n")); DEBUG ((DEBUG_INFO, "UART Configuration:\n"));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
" UART Base = 0x%llx\n", SerialPortInfo->BaseAddress " UART Base = 0x%llx\n",
SerialPortInfo->BaseAddress
)); ));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@ -157,6 +161,7 @@ FixupIds (
HidString = "PNP0501"; HidString = "PNP0501";
CidString = "PNP0500"; CidString = "PNP0500";
} }
break; break;
} }
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART: case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART:

View File

@ -566,7 +566,8 @@ PrintCmObjDesc (
if ((Data == NULL) || if ((Data == NULL) ||
(Parser == NULL) || (Parser == NULL) ||
(ItemCount == 0) || (ItemCount == 0) ||
(RemainingSize == NULL)) { (RemainingSize == NULL))
{
ASSERT (0); ASSERT (0);
return; return;
} }
@ -640,6 +641,7 @@ PrintCmObjDesc (
Parser[Index].Length Parser[Index].Length
)); ));
} }
DEBUG ((DEBUG_ERROR, "\n")); DEBUG ((DEBUG_ERROR, "\n"));
Data = (UINT8 *)Data + Parser[Index].Length; Data = (UINT8 *)Data + Parser[Index].Length;
} // for } // for
@ -675,6 +677,7 @@ ParseCmObjDesc (
ASSERT (0); ASSERT (0);
return; return;
} }
ParserArray = &StdNamespaceObjectParser[ObjId]; ParserArray = &StdNamespaceObjectParser[ObjId];
break; break;
case EObjNameSpaceArm: case EObjNameSpaceArm:
@ -682,6 +685,7 @@ ParseCmObjDesc (
ASSERT (0); ASSERT (0);
return; return;
} }
ParserArray = &ArmNamespaceObjectParser[ObjId]; ParserArray = &ArmNamespaceObjectParser[ObjId];
break; break;
default: default:

View File

@ -28,7 +28,6 @@ typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR8* Format, UINT8* Ptr);
*/ */
typedef struct CmObjParser CM_OBJ_PARSER; typedef struct CmObjParser CM_OBJ_PARSER;
struct CmObjParser { struct CmObjParser {
/// String describing the Cm Object /// String describing the Cm Object
CONST CHAR8 *NameStr; CONST CHAR8 *NameStr;
@ -59,7 +58,6 @@ struct CmObjParser {
with their object names. with their object names.
*/ */
typedef struct CmObjParserArray { typedef struct CmObjParserArray {
/// Object name /// Object name
CONST CHAR8 *ObjectName; CONST CHAR8 *ObjectName;

View File

@ -72,7 +72,8 @@ GetCgfMgrInfo (
} }
if (CmObjectDesc.Size < if (CmObjectDesc.Size <
(sizeof (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO) * CmObjectDesc.Count)) { (sizeof (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO) * CmObjectDesc.Count))
{
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"ERROR: EStdObjCfgMgrInfo: Buffer too small, size = 0x%x\n", "ERROR: EStdObjCfgMgrInfo: Buffer too small, size = 0x%x\n",
@ -130,7 +131,8 @@ AddAcpiHeader (
(AcpiHeader == NULL) || (AcpiHeader == NULL) ||
(AcpiTableInfo == NULL) || (AcpiTableInfo == NULL) ||
(Length < sizeof (EFI_ACPI_DESCRIPTION_HEADER)) (Length < sizeof (EFI_ACPI_DESCRIPTION_HEADER))
) { )
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -229,7 +231,8 @@ AddSsdtAcpiHeader (
if ((CfgMgrProtocol == NULL) || if ((CfgMgrProtocol == NULL) ||
(Generator == NULL) || (Generator == NULL) ||
(AcpiTableInfo == NULL)) { (AcpiTableInfo == NULL))
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -332,5 +335,6 @@ FindDuplicateValue (
} }
} }
} }
return FALSE; return FALSE;
} }