From nobody Mon Feb 9 19:30:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+63587+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63587+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1596212384; cv=none; d=zohomail.com; s=zohoarc; b=EqofJsTlf4B4DU0ZRNP7u6cvA2lP5fvShS3bNjPib6mjK6BWDi0zr2WXEViqQRZLaDahKkrUC/HneHlOazwCyXUMNRYBp84DfvdruGYjyiKgMmwVhr8YId7zI4ATQSJhWclb3O0gPt56HlCW6jRcbTw9EkUznL98M7ZHlAJKHUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596212384; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=DYX7WDolc4aux6wYY4NSt0xt8z9vRUiAfCHTxcTnmWc=; b=Iwk8qhNtUxL5jk9QH+9jXPMq5MWvC2E8vEUMwN3YHlNTO2oPKXgVndmSXP789aEfkg8F5GDGZb6XXKMa6I+c/PalAc4gjOEYES7eauEaJKlRYZaGisPp9i0a8BeP0XZv0IBlDLIRSphHh3J7KGgPfoEfMONusL87Xr79H1ct348= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63587+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1596212384612436.37951290475803; Fri, 31 Jul 2020 09:19:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id eJjTYY1788612xqD4xAQyNQI; Fri, 31 Jul 2020 09:19:44 -0700 X-Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.groups.io with SMTP id smtpd.web11.383.1596212382779352273 for ; Fri, 31 Jul 2020 09:19:43 -0700 X-Received: by mail-wr1-f47.google.com with SMTP id f1so27958957wro.2 for ; Fri, 31 Jul 2020 09:19:42 -0700 (PDT) X-Gm-Message-State: cBisbTGSNxUSyx1mpg5X3Eu2x1787277AA= X-Google-Smtp-Source: ABdhPJyxv3vc5RQ3bsDvpuXiWxqSv4s9FcIU9tN8MARcqMwVlzuLT3l3Q+YK4i4aYi1wR7cUX9ckRw== X-Received: by 2002:adf:f48b:: with SMTP id l11mr3994845wro.376.1596212377517; Fri, 31 Jul 2020 09:19:37 -0700 (PDT) X-Received: from localhost.localdomain (cpc159317-cmbg20-2-0-cust162.5-4.cable.virginm.net. [81.111.29.163]) by smtp.gmail.com with ESMTPSA id v11sm14149739wrr.10.2020.07.31.09.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 09:19:36 -0700 (PDT) From: "Tomas Pilar (tpilar)" To: devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov Subject: [edk2-devel] [PATCH 8/8] DynamicTablesPkg: Remove GET_OBJECT_LIST Date: Fri, 31 Jul 2020 17:19:26 +0100 Message-Id: <20200731161926.341330-9-tomas@nuviainc.com> In-Reply-To: <20200731161926.341330-1-tomas@nuviainc.com> References: <20200731161926.341330-1-tomas@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,tomas@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596212384; bh=gr+hMeJ59u9Zg6x7NWKsxUSB9F/eQDhTeKxEyqh0nuI=; h=Cc:Date:From:Reply-To:Subject:To; b=TcayaKcXQ+6u6eLTQlFkMxC9dZEStE7+UcFeJ7zEfjMD2p7dZy0Y+K4gazUH3mbzumq czvQc1SQEhewiH1HD3a1Ug6u8gLEAXr4RZBmuUEXgl75+RwzcdF6g45ZNd0B1ardRf/pV 2qRpdCAsKSI6dEQSPLLNP1VEHXIEcUkPsQg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Replace macro-generated accessor functions in DynamicTables generators with TableHelperLib helpers that are compatible with v1.1 revision of Configuration Manager Protocol. Cc: Sami Mujawar Cc: Alexei Fedorov Signed-off-by: Tomas Pilar --- .../DynamicTableFactoryDxe.c | 1 - .../DynamicTableManagerDxe.c | 34 +- .../Include/ConfigurationManagerHelper.h | 126 -- .../Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 34 +- .../Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 199 +--- .../Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 234 ++-- .../Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 1058 +++++------------ .../Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 304 ++--- .../Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c | 100 +- .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c | 287 ++--- .../Acpi/Arm/AcpiRawLibArm/RawGenerator.c | 1 - .../Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c | 35 +- .../Acpi/Arm/AcpiSratLibArm/SratGenerator.c | 437 +++---- 13 files changed, 785 insertions(+), 2065 deletions(-) delete mode 100644 DynamicTablesPkg/Include/ConfigurationManagerHelper.h diff --git a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFa= ctoryDxe.c b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFa= ctoryDxe.c index d1432348f0..b8f3e1c877 100644 --- a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDx= e.c +++ b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDx= e.c @@ -15,7 +15,6 @@ // Module specific include files. #include #include -#include #include #include #include diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableMa= nagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableMa= nagerDxe.c index b194a38659..ae827fdf2c 100644 --- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.c +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.c @@ -8,6 +8,7 @@ **/ =20 #include +#include #include #include #include @@ -15,22 +16,12 @@ // Module specific include files. #include #include -#include #include #include #include #include #include =20 -/** This macro expands to a function that retrieves the ACPI Table - List from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceStandard, - EStdObjAcpiTableList, - CM_STD_OBJ_ACPI_TABLE_INFO - ) - /** A helper function to build and install a single ACPI table. =20 This is a helper function that invokes the Table generator interface @@ -516,12 +507,7 @@ ProcessAcpiTables ( return Status; } =20 - Status =3D GetEStdObjAcpiTableList ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &AcpiTableInfo, - &AcpiTableCount - ); + Status =3D CfgMgrCountObjects (EStdObjAcpiTableList, &AcpiTableCount); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -546,6 +532,9 @@ ProcessAcpiTables ( AcpiTableCount )); =20 + CfgMgrGetObjects ( + EStdObjAcpiTableList, CM_NULL_TOKEN, (VOID**)&AcpiTableInfo, &AcpiTabl= eCount); + // Check if mandatory ACPI tables are present. Status =3D VerifyMandatoryTablesArePresent ( AcpiTableInfo, @@ -558,7 +547,7 @@ ProcessAcpiTables ( " Status =3D %r\n", Status )); - return Status; + goto EXIT; } =20 // Add the FADT Table first. @@ -578,7 +567,7 @@ ProcessAcpiTables ( " Status =3D %r\n", Status )); - return Status; + goto EXIT; } break; } @@ -626,10 +615,12 @@ ProcessAcpiTables ( " Status =3D %r\n", Status )); - return Status; + goto EXIT; } } // for =20 +EXIT: + FreePool(AcpiTableInfo); return Status; } =20 @@ -697,11 +688,6 @@ DynamicTableManagerDxeInitialize ( =20 Status =3D CfgMgrGetInfo (&CfgMgrInfo); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: Failed to get Configuration Manager info. Status =3D %r\n", - Status - )); return Status; } =20 diff --git a/DynamicTablesPkg/Include/ConfigurationManagerHelper.h b/Dynami= cTablesPkg/Include/ConfigurationManagerHelper.h deleted file mode 100644 index 29f34a0434..0000000000 --- a/DynamicTablesPkg/Include/ConfigurationManagerHelper.h +++ /dev/null @@ -1,126 +0,0 @@ -/** @file - - Copyright (c) 2017 - 2019, ARM Limited. All rights reserved. - - SPDX-License-Identifier: BSD-2-Clause-Patent - - @par Glossary: - - Cm or CM - Configuration Manager - - Obj or OBJ - Object -**/ - -#ifndef CONFIGURATION_MANAGER_HELPER_H_ -#define CONFIGURATION_MANAGER_HELPER_H_ - -/** The GET_OBJECT_LIST macro expands to a function that is used to retrie= ve - an object or an object list from the Configuration Manager using the - Configuration Manager Protocol interface. - - The macro expands to a function which has the following prototype: - - STATIC - EFI_STATUS - EFIAPI - Get ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, - IN CONST CM_OBJECT_TOKEN Token OPTIONAL, - OUT Type ** List, - OUT UINT32 * Count OPTIONAL - ); - - Generated function parameters: - @param [in] CfgMgrProtocol Pointer to the Configuration Manager protocol - interface. - @param [in] Token Reference token for the Object. - @param [out] List Pointer to the Object list. - @param [out] Count Count of the objects returned in the list. - - Macro Parameters: - @param [in] CmObjectNameSpace The Object Namespace - @param [in] CmObjectId Object Id. - @param [in] Type Structure used to describe the Object. - - @retval EFI_SUCCESS Success. - @retval EFI_INVALID_PARAMETER A parameter is invalid. - @retval EFI_NOT_FOUND The required object information is not fou= nd. - @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration - Manager is less than the Object size for t= he - requested object. -**/ -#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type) = \ -STATIC = \ -EFI_STATUS = \ -EFIAPI = \ -Get##CmObjectId ( = \ - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, = \ - IN CONST CM_OBJECT_TOKEN Token OPTIONAL, = \ - OUT Type ** List, = \ - OUT UINT32 * CONST Count OPTIONAL = \ - ) = \ -{ = \ - EFI_STATUS Status; = \ - CM_OBJ_DESCRIPTOR CmObjectDesc; = \ - UINT32 ObjCount =3D 0; = \ - if (List =3D=3D NULL) { = \ - Status =3D EFI_INVALID_PARAMETER; = \ - DEBUG (( = \ - DEBUG_ERROR, = \ - "ERROR: Get" #CmObjectId ": Invalid out parameter for" = \ - " object list. Status =3D %r\n", = \ - Status = \ - )); = \ - goto error_handler; = \ - } = \ - Status =3D CfgMgrProtocol->GetObject ( = \ - CfgMgrProtocol, = \ - CREATE_CM_OBJECT_ID ( = \ - CmObjectNameSpace, = \ - CmObjectId = \ - ), = \ - Token, = \ - &CmObjectDesc = \ - ); = \ - if (EFI_ERROR (Status)) { = \ - DEBUG (( = \ - DEBUG_INFO, = \ - "INFO: Get" #CmObjectId ": Platform does not implement " = \ - #CmObjectId ". Status =3D %r\n", = \ - Status = \ - )); = \ - *List =3D NULL; = \ - goto error_handler; = \ - } = \ - if (CmObjectDesc.ObjectId !=3D = \ - CREATE_CM_OBJECT_ID (CmObjectNameSpace, CmObjectId)) { = \ - DEBUG (( = \ - DEBUG_ERROR, = \ - "ERROR: Get" #CmObjectId ": " #CmObjectId = \ - ": Invalid ObjectId =3D 0x%x\n, expected Id =3D 0x%x\n", = \ - CmObjectDesc.ObjectId, = \ - CREATE_CM_OBJECT_ID (CmObjectNameSpace, CmObjectId) = \ - )); = \ - ASSERT (FALSE); = \ - Status =3D EFI_INVALID_PARAMETER; = \ - goto error_handler; = \ - } = \ - if (CmObjectDesc.Size < (sizeof (Type) * CmObjectDesc.Count)) { = \ - DEBUG (( = \ - DEBUG_ERROR, = \ - "ERROR: Get" #CmObjectId ": " #CmObjectId = \ - ": Buffer too small, size =3D 0x%x\n", = \ - CmObjectDesc.Size = \ - )); = \ - ASSERT (FALSE); = \ - Status =3D EFI_BAD_BUFFER_SIZE; = \ - goto error_handler; = \ - } = \ - ObjCount =3D CmObjectDesc.Count; = \ - *List =3D (Type*)CmObjectDesc.Data; = \ -error_handler: = \ - if (Count !=3D NULL) { = \ - *Count =3D ObjCount; = \ - } = \ - return Status; = \ -} - -#endif // CONFIGURATION_MANAGER_HELPER_H_ diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c index 21a7f9bf64..b6a1dc0ddf 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -166,15 +166,6 @@ DBG2_TABLE AcpiDbg2 =3D { =20 #pragma pack() =20 -/** This macro expands to a function that retrieves the Serial - debug port information from the Configuration Manager -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjSerialDebugPortInfo, - CM_ARM_SERIAL_PORT_INFO - ); - /** Initialize the PL011/SBSA UART with the parameters obtained from the Configuration Manager. =20 @@ -285,21 +276,14 @@ BuildDbg2Table ( return EFI_INVALID_PARAMETER; } =20 + // Pointers to allocated memory *Table =3D NULL; =20 - Status =3D GetEArmObjSerialDebugPortInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &SerialPortInfo, - NULL - ); + Status =3D CfgMgrGetSimpleObject ( + EArmObjSerialDebugPortInfo, (VOID **)&SerialPortInfo); + if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: DBG2: Failed to get serial port information. Status =3D %r\n= ", - Status - )); - goto error_handler; + return Status; } =20 if (SerialPortInfo->BaseAddress =3D=3D 0) { @@ -335,11 +319,6 @@ BuildDbg2Table ( AcpiTableInfo, sizeof (DBG2_TABLE)); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: DBG2: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 @@ -372,6 +351,7 @@ BuildDbg2Table ( *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2; =20 error_handler: + FreePool(SerialPortInfo); return Status; } =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c index febaca3dae..8b523b0e3d 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c @@ -11,12 +11,12 @@ =20 #include #include +#include #include =20 // Module specific include files. #include #include -#include #include #include =20 @@ -198,47 +198,8 @@ EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt =3D= { =20 #pragma pack() =20 -/** This macro expands to a function that retrieves the Power - Management Profile Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjPowerManagementProfileInfo, - CM_ARM_POWER_MANAGEMENT_PROFILE_INFO - ); - -/** This macro expands to a function that retrieves the Boot - Architecture Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjBootArchInfo, - CM_ARM_BOOT_ARCH_INFO - ); - -/** This macro expands to a function that retrieves the Hypervisor - Vendor ID from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjHypervisorVendorIdentity, - CM_ARM_HYPERVISOR_VENDOR_ID - ); - -/** This macro expands to a function that retrieves the Fixed - feature flags for the platform from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjFixedFeatureFlags, - CM_ARM_FIXED_FEATURE_FLAGS - ); - /** Update the Power Management Profile information in the FADT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. - @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND The required object was not found. @@ -249,30 +210,16 @@ GET_OBJECT_LIST ( STATIC EFI_STATUS EFIAPI -FadtAddPmProfileInfo ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol -) +FadtAddPmProfileInfo (VOID) { EFI_STATUS Status; CM_ARM_POWER_MANAGEMENT_PROFILE_INFO * PmProfile; =20 - ASSERT (CfgMgrProtocol !=3D NULL); - // Get the Power Management Profile from the Platform Configuration Mana= ger - Status =3D GetEArmObjPowerManagementProfileInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &PmProfile, - NULL - ); + Status =3D CfgMgrGetSimpleObject ( + EArmObjPowerManagementProfileInfo, (VOID **)&PmProfile); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: FADT: Failed to get Power Management Profile information." \ - " Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 DEBUG (( @@ -283,15 +230,13 @@ FadtAddPmProfileInfo ( =20 AcpiFadt.PreferredPmProfile =3D PmProfile->PowerManagementProfile; =20 -error_handler: - return Status; + FreePool(PmProfile); + + return EFI_SUCCESS; } =20 /** Updates the Boot Architecture information in the FADT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. - @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND The required object was not found. @@ -302,29 +247,15 @@ error_handler: STATIC EFI_STATUS EFIAPI -FadtAddBootArchInfo ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol -) +FadtAddBootArchInfo (VOID) { EFI_STATUS Status; CM_ARM_BOOT_ARCH_INFO * BootArchInfo; =20 - ASSERT (CfgMgrProtocol !=3D NULL); - // Get the Boot Architecture flags from the Platform Configuration Manag= er - Status =3D GetEArmObjBootArchInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &BootArchInfo, - NULL - ); + Status =3D CfgMgrGetSimpleObject (EArmObjBootArchInfo, (VOID **)&BootArc= hInfo); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: FADT: Failed to get Boot Architecture flags. Status =3D %r\n= ", - Status - )); - goto error_handler; + return Status; } =20 DEBUG (( @@ -335,15 +266,13 @@ FadtAddBootArchInfo ( =20 AcpiFadt.ArmBootArch =3D BootArchInfo->BootArchFlags; =20 -error_handler: - return Status; + FreePool(BootArchInfo); + + return EFI_SUCCESS; } =20 /** Update the Hypervisor Vendor ID in the FADT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. - @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND The required object was not found. @@ -354,38 +283,16 @@ error_handler: STATIC EFI_STATUS EFIAPI -FadtAddHypervisorVendorId ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol -) +FadtAddHypervisorVendorId (VOID) { EFI_STATUS Status; CM_ARM_HYPERVISOR_VENDOR_ID * HypervisorVendorInfo; =20 - ASSERT (CfgMgrProtocol !=3D NULL); - // Get the Hypervisor Vendor ID from the Platform Configuration Manager - Status =3D GetEArmObjHypervisorVendorIdentity ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &HypervisorVendorInfo, - NULL - ); + Status =3D CfgMgrGetSimpleObject ( + EArmObjHypervisorVendorIdentity, (VOID **) &HypervisorVendorInfo); if (EFI_ERROR (Status)) { - if (Status =3D=3D EFI_NOT_FOUND) { - DEBUG (( - DEBUG_INFO, - "INFO: FADT: Platform does not have a Hypervisor Vendor ID." - "Status =3D %r\n", - Status - )); - } else { - DEBUG (( - DEBUG_ERROR, - "ERROR: FADT: Failed to get Hypervisor Vendor ID. Status =3D %r\n", - Status - )); - } - goto error_handler; + return Status; } =20 DEBUG (( @@ -396,8 +303,9 @@ FadtAddHypervisorVendorId ( =20 AcpiFadt.HypervisorVendorIdentity =3D HypervisorVendorInfo->HypervisorVe= ndorId; =20 -error_handler: - return Status; + FreePool (HypervisorVendorInfo); + + return EFI_SUCCESS; } =20 /** Update the Fixed Feature Flags in the FADT Table. @@ -415,38 +323,17 @@ error_handler: STATIC EFI_STATUS EFIAPI -FadtAddFixedFeatureFlags ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol -) +FadtAddFixedFeatureFlags (VOID) { EFI_STATUS Status; CM_ARM_FIXED_FEATURE_FLAGS * FixedFeatureFlags; =20 - ASSERT (CfgMgrProtocol !=3D NULL); - // Get the Fixed feature flags from the Platform Configuration Manager - Status =3D GetEArmObjFixedFeatureFlags ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &FixedFeatureFlags, - NULL - ); + + Status =3D CfgMgrGetSimpleObject ( + EArmObjFixedFeatureFlags, (VOID **)&FixedFeatureFlags); if (EFI_ERROR (Status)) { - if (Status =3D=3D EFI_NOT_FOUND) { - DEBUG (( - DEBUG_INFO, - "INFO: FADT: Platform does not define additional Fixed feature fla= gs." - "Status =3D %r\n", - Status - )); - } else { - DEBUG (( - DEBUG_ERROR, - "ERROR: FADT: Failed to get Fixed feature flags. Status =3D %r\n", - Status - )); - } - goto error_handler; + return Status; } =20 DEBUG (( @@ -467,8 +354,9 @@ FadtAddFixedFeatureFlags ( AcpiFadt.Flags |=3D (FixedFeatureFlags->Flags & VALID_HARDWARE_REDUCED_FLAG_MASK); =20 -error_handler: - return Status; + FreePool (FixedFeatureFlags); + + return EFI_SUCCESS; } =20 /** Construct the FADT table. @@ -507,7 +395,6 @@ BuildFadtTable ( =20 ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (Table !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); @@ -533,30 +420,25 @@ BuildFadtTable ( AcpiTableInfo, sizeof (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE)); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: FADT: Failed to add ACPI header. Status =3D %r\n", - Status - )); return Status; } =20 // Update PmProfile Info - Status =3D FadtAddPmProfileInfo (CfgMgrProtocol); + Status =3D FadtAddPmProfileInfo (); if (EFI_ERROR (Status)) { - goto error_handler; + return Status; } =20 // Update BootArch Info - Status =3D FadtAddBootArchInfo (CfgMgrProtocol); + Status =3D FadtAddBootArchInfo (); if (EFI_ERROR (Status)) { - goto error_handler; + return Status; } =20 // Add the Hypervisor Vendor Id if present // Note if no hypervisor is present the zero bytes // will be placed in this field. - Status =3D FadtAddHypervisorVendorId (CfgMgrProtocol); + Status =3D FadtAddHypervisorVendorId (); if (EFI_ERROR (Status)) { if (Status =3D=3D EFI_NOT_FOUND) { DEBUG (( @@ -570,11 +452,11 @@ BuildFadtTable ( "ERROR: FADT: Error reading Hypervisor Vendor ID, Status =3D %r", Status )); - goto error_handler; + return Status; } } =20 - Status =3D FadtAddFixedFeatureFlags (CfgMgrProtocol); + Status =3D FadtAddFixedFeatureFlags (); if (EFI_ERROR (Status)) { if (Status =3D=3D EFI_NOT_FOUND) { DEBUG (( @@ -582,20 +464,19 @@ BuildFadtTable ( "INFO: FADT: No Fixed feature flags found," \ " assuming no additional flags are defined for the platform.\n" )); - Status =3D EFI_SUCCESS; } else { DEBUG (( DEBUG_ERROR, "ERROR: FADT: Error reading Fixed feature flags, Status =3D %r", Status )); - goto error_handler; + return Status; } } =20 - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt; -error_handler: - return Status; + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER *) &AcpiFadt; + + return EFI_SUCCESS; } =20 /** This macro defines the FADT Table Generator revision. diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c index 4af410fb5b..119265187a 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c @@ -17,7 +17,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -32,49 +31,11 @@ Requirements: - EArmObjGTBlockTimerFrameInfo (OPTIONAL) */ =20 -/** This macro expands to a function that retrieves the Generic - Timer Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGenericTimerInfo, - CM_ARM_GENERIC_TIMER_INFO - ); - -/** This macro expands to a function that retrieves the SBSA Generic - Watchdog Timer Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjPlatformGenericWatchdogInfo, - CM_ARM_GENERIC_WATCHDOG_INFO - ); - -/** This macro expands to a function that retrieves the Platform Generic - Timer Block Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjPlatformGTBlockInfo, - CM_ARM_GTBLOCK_INFO - ); - -/** This macro expands to a function that retrieves the Generic - Timer Block Timer Frame Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGTBlockTimerFrameInfo, - CM_ARM_GTBLOCK_TIMER_FRAME_INFO - ); - /** Add the Generic Timer Information to the GTDT table. =20 Also update the Platform Timer offset information if the platform implements platform timers. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Gtdt Pointer to the GTDT Table. @param [in] PlatformTimerCount Platform timer count. @param [in] AcpiTableRevision Acpi Revision targeted by the platform. @@ -90,7 +51,6 @@ STATIC EFI_STATUS EFIAPI AddGenericTimerInfo ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrPro= tocol, IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt, IN CONST UINT32 PlatformT= imerCount, IN CONST UINT32 AcpiTable= Revision @@ -99,24 +59,13 @@ AddGenericTimerInfo ( EFI_STATUS Status; CM_ARM_GENERIC_TIMER_INFO * GenericTimerInfo; =20 - ASSERT (CfgMgrProtocol !=3D NULL); - ASSERT (Gtdt !=3D NULL); - - Status =3D GetEArmObjGenericTimerInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GenericTimerInfo, - NULL - ); + ASSERT (Gtdt !=3D NULL); =20 - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: GTDT: Failed to get GenericTimerInfo. Status =3D %r\n", - Status - )); - return Status; - } + Status =3D CfgMgrGetSimpleObject ( + EArmObjGenericTimerInfo, (VOID **)&GenericTimerInfo); + if (EFI_ERROR (Status)) { + return Status; + } =20 Gtdt->CntControlBasePhysicalAddress =3D GenericTimerInfo->CounterControlBaseAddress; @@ -140,7 +89,9 @@ AddGenericTimerInfo ( Gtdt->VirtualPL2TimerFlags =3D GenericTimerInfo->VirtualPL2TimerFlags; } =20 - return Status; + FreePool (GenericTimerInfo); + + return EFI_SUCCESS; } =20 /** Add the SBSA Generic Watchdog Timers to the GTDT table. @@ -148,26 +99,36 @@ AddGenericTimerInfo ( @param [in] Gtdt Pointer to the GTDT Table. @param [in] WatchdogOffset Offset to the watchdog information in the GTDT Table. - @param [in] WatchdogInfoList Pointer to the watchdog information list. - @param [in] WatchdogCount Platform timer count. **/ STATIC VOID AddGenericWatchdogList ( IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt, - IN CONST UINT32 WatchdogOffset, - IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoLis= t, - IN UINT32 WatchdogCount + IN CONST UINT32 WatchdogOffset ) { EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE * Watchdog; + UINT32 WatchdogCount; + VOID *WatchdogInfoList; + CM_ARM_GENERIC_WATCHDOG_INFO *Cursor; + EFI_STATUS Status; =20 ASSERT (Gtdt !=3D NULL); - ASSERT (WatchdogInfoList !=3D NULL); + + Status =3D CfgMgrGetObjects ( + EArmObjPlatformGenericWatchdogInfo, + CM_NULL_TOKEN, + &WatchdogInfoList, + &WatchdogCount); + + if (EFI_ERROR(Status)) { + return; + } =20 Watchdog =3D (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE *) ((UINT8*)Gtdt + WatchdogOffset); =20 + Cursor =3D WatchdogInfoList; while (WatchdogCount-- !=3D 0) { // Add watchdog entry DEBUG ((DEBUG_INFO, "GTDT: Watchdog =3D 0x%p\n", Watchdog)); @@ -176,14 +137,16 @@ AddGenericWatchdogList ( sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE); Watchdog->Reserved =3D EFI_ACPI_RESERVED_BYTE; Watchdog->RefreshFramePhysicalAddress =3D - WatchdogInfoList->RefreshFrameAddress; + Cursor->RefreshFrameAddress; Watchdog->WatchdogControlFramePhysicalAddress =3D - WatchdogInfoList->ControlFrameAddress; - Watchdog->WatchdogTimerGSIV =3D WatchdogInfoList->TimerGSIV; - Watchdog->WatchdogTimerFlags =3D WatchdogInfoList->Flags; + Cursor->ControlFrameAddress; + Watchdog->WatchdogTimerGSIV =3D Cursor->TimerGSIV; + Watchdog->WatchdogTimerFlags =3D Cursor->Flags; Watchdog++; - WatchdogInfoList++; + Cursor++; } // for + + FreePool (WatchdogInfoList); } =20 /** @@ -313,8 +276,6 @@ AddGTBlockTimerFrames ( =20 /** Add the GT Block Timers in the GTDT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Gtdt Pointer to the GTDT Table. @param [in] GTBlockOffset Offset of the GT Block information in the GTDT Table. @@ -328,7 +289,6 @@ AddGTBlockTimerFrames ( STATIC EFI_STATUS AddGTBlockList ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoco= l, IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt, IN CONST UINT32 GTBlockOffset, IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo, @@ -351,12 +311,11 @@ AddGTBlockList ( while (BlockTimerCount-- !=3D 0) { DEBUG ((DEBUG_INFO, "GTDT: GTBlock =3D 0x%p\n", GTBlock)); =20 - Status =3D GetEArmObjGTBlockTimerFrameInfo ( - CfgMgrProtocol, - GTBlockInfo->GTBlockTimerFrameToken, - >BlockTimerFrameList, - >BlockTimerFrameCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjGTBlockTimerFrameInfo, + GTBlockInfo->GTBlockTimerFrameToken, + NULL, + >BlockTimerFrameCount); if (EFI_ERROR (Status) || (GTBlockTimerFrameCount !=3D GTBlockInfo->GTBlockTimerFrameCount))= { DEBUG (( @@ -397,18 +356,20 @@ AddGTBlockList ( GtBlockFrame =3D (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE*) ((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset); =20 + CfgMgrGetObjects ( + EArmObjGTBlockTimerFrameInfo, + GTBlockInfo->GTBlockTimerFrameToken, + (VOID **)>BlockTimerFrameList, + >BlockTimerFrameCount); + // Add GT Block Timer frames Status =3D AddGTBlockTimerFrames ( GtBlockFrame, GTBlockTimerFrameList, GTBlockTimerFrameCount ); + FreePool (GTBlockTimerFrameList); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: GTDT: Failed to add Generic Timer Frames. Status =3D %r\n", - Status - )); return Status; } =20 @@ -458,7 +419,6 @@ BuildGtdtTable ( UINT32 PlatformTimerCount; UINT32 WatchdogCount; UINT32 BlockTimerCount; - CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList; CM_ARM_GTBLOCK_INFO * GTBlockInfo; EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt; UINT32 Idx; @@ -467,7 +427,6 @@ BuildGtdtTable ( =20 ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (Table !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); @@ -485,46 +444,15 @@ BuildGtdtTable ( return EFI_INVALID_PARAMETER; } =20 - *Table =3D NULL; - Status =3D GetEArmObjPlatformGTBlockInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - >BlockInfo, - &BlockTimerCount - ); - if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: GTDT: Failed to Get Platform GT Block Information." \ - " Status =3D %r\n", - Status - )); - goto error_handler; - } - - Status =3D GetEArmObjPlatformGenericWatchdogInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &WatchdogInfoList, - &WatchdogCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjPlatformGTBlockInfo, + CM_NULL_TOKEN, + (VOID **)>BlockInfo, + &BlockTimerCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: GTDT: Failed to Get Platform Generic Watchdog Information." \ - " Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 - DEBUG (( - DEBUG_INFO, - "GTDT: BlockTimerCount =3D %d, WatchdogCount =3D %d\n", - BlockTimerCount, - WatchdogCount - )); - // Calculate the GTDT Table Size PlatformTimerCount =3D 0; TableSize =3D sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE); @@ -558,6 +486,20 @@ BuildGtdtTable ( )); } =20 + WatchdogCount =3D 0; + Status =3D CfgMgrCountObjects ( + EArmObjPlatformGenericWatchdogInfo, &WatchdogCount); + if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { + goto error_handler; + } + + DEBUG (( + DEBUG_INFO, + "GTDT: BlockTimerCount =3D %d, WatchdogCount =3D %d\n", + BlockTimerCount, + WatchdogCount + )); + WatchdogOffset =3D 0; if (WatchdogCount !=3D 0) { WatchdogOffset =3D TableSize; @@ -572,20 +514,12 @@ BuildGtdtTable ( )); } =20 - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); - if (*Table =3D=3D NULL) { + Gtdt =3D AllocateZeroPool (TableSize); + if (Gtdt =3D=3D NULL) { Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: GTDT: Failed to allocate memory for GTDT Table, Size =3D %d,= " \ - " Status =3D %r\n", - TableSize, - Status - )); goto error_handler; } =20 - Gtdt =3D (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table; DEBUG (( DEBUG_INFO, "GTDT: Gtdt =3D 0x%p TableSize =3D 0x%x\n", @@ -595,20 +529,11 @@ BuildGtdtTable ( =20 Status =3D AddAcpiHeader (This, &Gtdt->Header, AcpiTableInfo, TableSize); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: GTDT: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 Status =3D AddGenericTimerInfo ( - CfgMgrProtocol, - Gtdt, - PlatformTimerCount, - AcpiTableInfo->AcpiTableRevision - ); + Gtdt, PlatformTimerCount, AcpiTableInfo->AcpiTableRevision); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -619,13 +544,7 @@ BuildGtdtTable ( } =20 if (BlockTimerCount !=3D 0) { - Status =3D AddGTBlockList ( - CfgMgrProtocol, - Gtdt, - GTBlockOffset, - GTBlockInfo, - BlockTimerCount - ); + Status =3D AddGTBlockList (Gtdt, GTBlockOffset, GTBlockInfo, BlockTime= rCount); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -637,21 +556,19 @@ BuildGtdtTable ( } =20 if (WatchdogCount !=3D 0) { - AddGenericWatchdogList ( - Gtdt, - WatchdogOffset, - WatchdogInfoList, - WatchdogCount - ); + AddGenericWatchdogList (Gtdt, WatchdogOffset); } =20 + FreePool (GTBlockInfo); + + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER *)Gtdt; return Status; =20 error_handler: - if (*Table !=3D NULL) { - FreePool (*Table); - *Table =3D NULL; + if (Gtdt !=3D NULL) { + FreePool (Gtdt); } + FreePool (GTBlockInfo); return Status; } =20 @@ -677,7 +594,6 @@ FreeGtdtTableResources ( { ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 97f86ddb30..dc518238c7 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -20,7 +20,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -42,244 +41,82 @@ Requirements: - EArmObjGicItsIdentifierArray */ =20 -/** This macro expands to a function that retrieves the ITS - Group node information from the Configuration Manager. +/* + Function type that evaluates the size of a node and sets + the node pointer to the next node. Used in iteration over + node lists. */ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjItsGroup, - CM_ARM_ITS_GROUP_NODE - ); - -/** This macro expands to a function that retrieves the - Named Component node information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjNamedComponent, - CM_ARM_NAMED_COMPONENT_NODE - ); - -/** This macro expands to a function that retrieves the - Root Complex node information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjRootComplex, - CM_ARM_ROOT_COMPLEX_NODE - ); - -/** This macro expands to a function that retrieves the - SMMU v1/v2 node information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjSmmuV1SmmuV2, - CM_ARM_SMMUV1_SMMUV2_NODE - ); - -/** This macro expands to a function that retrieves the - SMMU v3 node information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjSmmuV3, - CM_ARM_SMMUV3_NODE - ); - -/** This macro expands to a function that retrieves the - PMCG node information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjPmcg, - CM_ARM_PMCG_NODE - ); - -/** This macro expands to a function that retrieves the - ITS Identifier Array information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicItsIdentifierArray, - CM_ARM_ITS_IDENTIFIER - ); - -/** This macro expands to a function that retrieves the - Id Mapping Array information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjIdMappingArray, - CM_ARM_ID_MAPPING - ); - -/** This macro expands to a function that retrieves the - SMMU Interrupt Array information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjSmmuInterruptArray, - CM_ARM_SMMU_INTERRUPT - ); +typedef UINT32 (EFIAPI *INDEX_NODE)(VOID ** Node); =20 -/** Returns the size of the ITS Group node. - - @param [in] Node Pointer to ITS Group node. +/** Returns the size of the ITS Group node, increments + to the next node. =20 + @param [in,out] Ptr Pointer to ITS Group node. @retval Size of the ITS Group Node. **/ STATIC UINT32 GetItsGroupNodeSize ( - IN CONST CM_ARM_ITS_GROUP_NODE * Node + IN OUT VOID ** Ptr ) { - ASSERT (Node !=3D NULL); + ASSERT (Ptr !=3D NULL && *Ptr !=3D NULL); + + CM_ARM_ITS_GROUP_NODE *Node =3D *Ptr; + *Ptr =3D Node + 1; =20 /* Size of ITS Group Node + Size of ITS Identifier array */ - return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE) + - (Node->ItsIdCount * sizeof (UINT32))); -} - -/** Returns the total size required for the ITS Group nodes and - updates the Node Indexer. - - This function calculates the size required for the node group - and also populates the Node Indexer array with offsets for the - individual nodes. - - @param [in] NodeStartOffset Offset from the start of the - IORT where this node group starts. - @param [in] NodeList Pointer to ITS Group node list. - @param [in] NodeCount Count of the ITS Group nodes. - @param [in, out] NodeIndexer Pointer to the next Node Indexer. - - @retval Total size of the ITS Group Nodes. -**/ -STATIC -UINT64 -GetSizeofItsGroupNodes ( - IN CONST UINT32 NodeStartOffset, - IN CONST CM_ARM_ITS_GROUP_NODE * NodeList, - IN UINT32 NodeCount, - IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer - ) -{ - UINT64 Size; - - ASSERT (NodeList !=3D NULL); - - Size =3D 0; - while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID*)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); - DEBUG (( - DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", - *NodeIndexer, - (*NodeIndexer)->Token, - (*NodeIndexer)->Object, - (*NodeIndexer)->Offset - )); - - Size +=3D GetItsGroupNodeSize (NodeList); - (*NodeIndexer)++; - NodeList++; - } - return Size; + return (UINT32) ( + sizeof (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE) + + (Node->ItsIdCount) * sizeof (UINT32)); } =20 -/** Returns the size of the Named Component node. - - @param [in] Node Pointer to Named Component node. +/** Returns the size of the Named Component node and + point to the next node =20 + @param [in,out] Ptr Pointer to Named Component node. @retval Size of the Named Component node. **/ STATIC UINT32 GetNamedComponentNodeSize ( - IN CONST CM_ARM_NAMED_COMPONENT_NODE * Node + IN OUT VOID ** Ptr ) { - ASSERT (Node !=3D NULL); + ASSERT (Ptr !=3D NULL && *Ptr !=3D NULL); + + CM_ARM_NAMED_COMPONENT_NODE * Node =3D *Ptr; + *Ptr =3D Node + 1; =20 /* Size of Named Component node + Size of ID mapping array + Size of ASCII string + 'padding to 32-bit word aligned'. */ + return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + - (Node->IdMappingCount * + ((Node->IdMappingCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) + - ALIGN_VALUE (AsciiStrSize (Node->ObjectName), 4)); -} - -/** Returns the total size required for the Named Component nodes and - updates the Node Indexer. - - This function calculates the size required for the node group - and also populates the Node Indexer array with offsets for the - individual nodes. - - @param [in] NodeStartOffset Offset from the start of the - IORT where this node group starts. - @param [in] NodeList Pointer to Named Component node list. - @param [in] NodeCount Count of the Named Component nodes. - @param [in, out] NodeIndexer Pointer to the next Node Indexer. - - @retval Total size of the Named Component nodes. -**/ -STATIC -UINT64 -GetSizeofNamedComponentNodes ( - IN CONST UINT32 NodeStartOffset, - IN CONST CM_ARM_NAMED_COMPONENT_NODE * NodeList, - IN UINT32 NodeCount, - IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer - ) -{ - UINT64 Size; - - ASSERT (NodeList !=3D NULL); - - Size =3D 0; - while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID*)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); - DEBUG (( - DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", - *NodeIndexer, - (*NodeIndexer)->Token, - (*NodeIndexer)->Object, - (*NodeIndexer)->Offset - )); - - Size +=3D GetNamedComponentNodeSize (NodeList); - (*NodeIndexer)++; - NodeList++; - } - - return Size; + ALIGN_VALUE (AsciiStrSize (Node->ObjectName), 4))); } =20 -/** Returns the size of the Root Complex node. - - @param [in] Node Pointer to Root Complex node. +/** Returns the size of the Root Complex node and point + to the next node. =20 + @param [in,out] Ptr Pointer to Root Complex node. @retval Size of the Root Complex node. **/ STATIC UINT32 GetRootComplexNodeSize ( - IN CONST CM_ARM_ROOT_COMPLEX_NODE * Node + IN OUT VOID ** Ptr ) { - ASSERT (Node !=3D NULL); + ASSERT (Ptr !=3D NULL && *Ptr !=3D NULL); + + CM_ARM_ROOT_COMPLEX_NODE *Node =3D *Ptr; + *Ptr =3D Node + 1; =20 /* Size of Root Complex node + Size of ID mapping array @@ -289,69 +126,22 @@ GetRootComplexNodeSize ( sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE))); } =20 -/** Returns the total size required for the Root Complex nodes and - updates the Node Indexer. - - This function calculates the size required for the node group - and also populates the Node Indexer array with offsets for the - individual nodes. - - @param [in] NodeStartOffset Offset from the start of the - IORT where this node group starts. - @param [in] NodeList Pointer to Root Complex node list. - @param [in] NodeCount Count of the Root Complex nodes. - @param [in, out] NodeIndexer Pointer to the next Node Indexer. - - @retval Total size of the Root Complex nodes. -**/ -STATIC -UINT64 -GetSizeofRootComplexNodes ( - IN CONST UINT32 NodeStartOffset, - IN CONST CM_ARM_ROOT_COMPLEX_NODE * NodeList, - IN UINT32 NodeCount, - IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer - ) -{ - UINT64 Size; - - ASSERT (NodeList !=3D NULL); - - Size =3D 0; - while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID*)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); - DEBUG (( - DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", - *NodeIndexer, - (*NodeIndexer)->Token, - (*NodeIndexer)->Object, - (*NodeIndexer)->Offset - )); - - Size +=3D GetRootComplexNodeSize (NodeList); - (*NodeIndexer)++; - NodeList++; - } - - return Size; -} - -/** Returns the size of the SMMUv1/SMMUv2 node. - - @param [in] Node Pointer to SMMUv1/SMMUv2 node list. +/** Returns the size of the SMMUv1/SMMUv2 node and point + to the next node. =20 + @param [in,out] Ptr Pointer to SMMUv1/SMMUv2 node list. @retval Size of the SMMUv1/SMMUv2 node. **/ STATIC UINT32 GetSmmuV1V2NodeSize ( - IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * Node + IN OUT VOID **Ptr ) { - ASSERT (Node !=3D NULL); + ASSERT (Ptr !=3D NULL && *Ptr !=3D NULL); + + CM_ARM_SMMUV1_SMMUV2_NODE * Node =3D *Ptr; + *Ptr =3D Node + 1; =20 /* Size of SMMU v1/SMMU v2 node + Size of ID mapping array + @@ -367,68 +157,22 @@ GetSmmuV1V2NodeSize ( sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT))); } =20 -/** Returns the total size required for the SMMUv1/SMMUv2 nodes and - updates the Node Indexer. - - This function calculates the size required for the node group - and also populates the Node Indexer array with offsets for the - individual nodes. - - @param [in] NodeStartOffset Offset from the start of the - IORT where this node group starts. - @param [in] NodeList Pointer to SMMUv1/SMMUv2 node list. - @param [in] NodeCount Count of the SMMUv1/SMMUv2 nodes. - @param [in, out] NodeIndexer Pointer to the next Node Indexer. - - @retval Total size of the SMMUv1/SMMUv2 nodes. -**/ -STATIC -UINT64 -GetSizeofSmmuV1V2Nodes ( - IN CONST UINT32 NodeStartOffset, - IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * NodeList, - IN UINT32 NodeCount, - IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer - ) -{ - UINT64 Size; - - ASSERT (NodeList !=3D NULL); - - Size =3D 0; - while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID*)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); - DEBUG (( - DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", - *NodeIndexer, - (*NodeIndexer)->Token, - (*NodeIndexer)->Object, - (*NodeIndexer)->Offset - )); - - Size +=3D GetSmmuV1V2NodeSize (NodeList); - (*NodeIndexer)++; - NodeList++; - } - return Size; -} - -/** Returns the size of the SMMUv3 node. - - @param [in] Node Pointer to SMMUv3 node list. +/** Returns the size of the SMMUv3 node and point to the next + node. =20 + @param [in,out] Ptr Pointer to SMMUv3 node list. @retval Total size of the SMMUv3 nodes. **/ STATIC UINT32 GetSmmuV3NodeSize ( - IN CONST CM_ARM_SMMUV3_NODE * Node + IN OUT VOID ** Ptr ) { - ASSERT (Node !=3D NULL); + ASSERT (Ptr !=3D NULL && *Ptr !=3D NULL); + + CM_ARM_SMMUV3_NODE *Node =3D *Ptr; + *Ptr =3D Node + 1; =20 /* Size of SMMU v1/SMMU v2 node + Size of ID mapping array @@ -438,68 +182,22 @@ GetSmmuV3NodeSize ( sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE))); } =20 -/** Returns the total size required for the SMMUv3 nodes and - updates the Node Indexer. - - This function calculates the size required for the node group - and also populates the Node Indexer array with offsets for the - individual nodes. - - @param [in] NodeStartOffset Offset from the start of the - IORT where this node group starts. - @param [in] NodeList Pointer to SMMUv3 node list. - @param [in] NodeCount Count of the SMMUv3 nodes. - @param [in, out] NodeIndexer Pointer to the next Node Indexer. - - @retval Total size of the SMMUv3 nodes. -**/ -STATIC -UINT64 -GetSizeofSmmuV3Nodes ( - IN CONST UINT32 NodeStartOffset, - IN CONST CM_ARM_SMMUV3_NODE * NodeList, - IN UINT32 NodeCount, - IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer - ) -{ - UINT64 Size; - - ASSERT (NodeList !=3D NULL); - - Size =3D 0; - while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID*)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); - DEBUG (( - DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", - *NodeIndexer, - (*NodeIndexer)->Token, - (*NodeIndexer)->Object, - (*NodeIndexer)->Offset - )); - - Size +=3D GetSmmuV3NodeSize (NodeList); - (*NodeIndexer)++; - NodeList++; - } - return Size; -} - -/** Returns the size of the PMCG node. - - @param [in] Node Pointer to PMCG node. +/** Returns the size of the PMCG node and point to the next + node. =20 + @param [in,out] Ptr Pointer to PMCG node. @retval Size of the PMCG node. **/ STATIC UINT32 GetPmcgNodeSize ( - IN CONST CM_ARM_PMCG_NODE * Node + IN OUT VOID ** Ptr ) { - ASSERT (Node !=3D NULL); + ASSERT (Ptr !=3D NULL && *Ptr !=3D NULL); + + CM_ARM_PMCG_NODE * Node =3D *Ptr; + *Ptr =3D Node + 1; =20 /* Size of PMCG node + Size of ID mapping array @@ -509,38 +207,49 @@ GetPmcgNodeSize ( sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE))); } =20 -/** Returns the total size required for the PMCG nodes and - updates the Node Indexer. +/** Returns the total size required for a group of IORT nodes. The configu= ration + manager objects specified by object id must contain CM_OBJECT_TOKEN as + their first field. =20 This function calculates the size required for the node group and also populates the Node Indexer array with offsets for the individual nodes. =20 + @param [in] ObjectId The configuration manager object id = of + nodes that are to be summed. @param [in] NodeStartOffset Offset from the start of the IORT where this node group starts. - @param [in] NodeList Pointer to PMCG node list. - @param [in] NodeCount Count of the PMCG nodes. @param [in, out] NodeIndexer Pointer to the next Node Indexer. + @param [in] GetNodeSize The function to determine the size o= f a single node + of the appropriate type determined b= y object id. =20 - @retval Total size of the PMCG nodes. + @retval Total size of the group of nodes **/ STATIC UINT64 -GetSizeofPmcgNodes ( - IN CONST UINT32 NodeStartOffset, - IN CONST CM_ARM_PMCG_NODE * NodeList, - IN UINT32 NodeCount, - IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer +GetSizeOfNodes ( + IN CONST CM_OBJECT_ID ObjectId, + IN CONST UINT32 NodeStartOffset, + IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer, + IN CONST INDEX_NODE IndexNode ) { - UINT64 Size; - - ASSERT (NodeList !=3D NULL); + UINT64 Size; + EFI_STATUS Status; + VOID *NodeList; + UINT32 NodeCount; + VOID *Cursor; + + Status =3D CfgMgrGetObjects (ObjectId, CM_NULL_TOKEN, &NodeList, &NodeCo= unt); + if (EFI_ERROR(Status)) { + return 0; + } =20 + Cursor =3D NodeList; Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID*)NodeList; + (*NodeIndexer)->Token =3D *(CM_OBJECT_TOKEN *) Cursor; // CM_OBJECT_TO= KEN is always the first element of a node + (*NodeIndexer)->Object =3D Cursor; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); DEBUG (( DEBUG_INFO, @@ -551,10 +260,11 @@ GetSizeofPmcgNodes ( (*NodeIndexer)->Offset )); =20 - Size +=3D GetPmcgNodeSize (NodeList); + Size +=3D IndexNode (&Cursor); (*NodeIndexer)++; - NodeList++; } + + FreePool (NodeList); return Size; } =20 @@ -631,14 +341,14 @@ STATIC EFI_STATUS AddIdMappingArray ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProto= col, IN EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray, IN UINT32 IdCount, IN CONST CM_OBJECT_TOKEN IdMappingTo= ken ) { EFI_STATUS Status; - CM_ARM_ID_MAPPING * IdMappings; + VOID * IdMappings; + CM_ARM_ID_MAPPING * Cursor; UINT32 IdMappingCount; ACPI_IORT_GENERATOR * Generator; =20 @@ -647,18 +357,12 @@ AddIdMappingArray ( Generator =3D (ACPI_IORT_GENERATOR*)This; =20 // Get the Id Mapping Array - Status =3D GetEArmObjIdMappingArray ( - CfgMgrProtocol, - IdMappingToken, - &IdMappings, - &IdMappingCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjIdMappingArray, + IdMappingToken, + &IdMappings, + &IdMappingCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get Id Mapping array. Status =3D %r\n", - Status - )); return Status; } =20 @@ -667,15 +371,17 @@ AddIdMappingArray ( DEBUG_ERROR, "ERROR: IORT: Failed to get the required number of Id Mappings.\n" )); - return EFI_NOT_FOUND; + Status =3D EFI_NOT_FOUND; + goto EXIT; } =20 + Cursor =3D IdMappings; // Populate the Id Mapping array while (IdCount-- !=3D 0) { Status =3D GetNodeOffsetReferencedByToken ( Generator->NodeIndexer, Generator->IortNodeCount, - IdMappings->OutputReferenceToken, + Cursor->OutputReferenceToken, &IdMapArray->OutputReference ); if (EFI_ERROR (Status)) { @@ -684,22 +390,24 @@ AddIdMappingArray ( "ERROR: IORT: Failed to get Output Reference for ITS Identifier ar= ray." "Reference Token =3D %p" " Status =3D %r\n", - IdMappings->OutputReferenceToken, + Cursor->OutputReferenceToken, Status )); - return Status; + goto EXIT; } =20 - IdMapArray->InputBase =3D IdMappings->InputBase; - IdMapArray->NumIds =3D IdMappings->NumIds; - IdMapArray->OutputBase =3D IdMappings->OutputBase; - IdMapArray->Flags =3D IdMappings->Flags; + IdMapArray->InputBase =3D Cursor->InputBase; + IdMapArray->NumIds =3D Cursor->NumIds; + IdMapArray->OutputBase =3D Cursor->OutputBase; + IdMapArray->Flags =3D Cursor->Flags; =20 IdMapArray++; - IdMappings++; + Cursor++; } // Id Mapping array =20 - return EFI_SUCCESS; +EXIT: + FreePool (IdMappings); + return Status; } =20 /** Update the ITS Group Node Information. @@ -722,10 +430,9 @@ STATIC EFI_STATUS AddItsGroupNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOffset, - IN CONST CM_ARM_ITS_GROUP_NODE * NodeList, + IN VOID * NodeList, IN UINT32 NodeCount ) { @@ -736,6 +443,7 @@ AddItsGroupNodes ( UINT32 ItsIdentifierCount; UINT32 IdIndex; UINT64 NodeLength; + CM_ARM_ITS_GROUP_NODE *Node; =20 ASSERT (Iort !=3D NULL); =20 @@ -743,7 +451,8 @@ AddItsGroupNodes ( NodesStartOffset); =20 while (NodeCount-- !=3D 0) { - NodeLength =3D GetItsGroupNodeSize (NodeList); + Node =3D (CM_ARM_ITS_GROUP_NODE *) NodeList; + NodeLength =3D GetItsGroupNodeSize (&NodeList); // Advances NodeList if (NodeLength > MAX_UINT16) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -765,22 +474,16 @@ AddItsGroupNodes ( ItsGroupNode->Node.IdReference =3D 0; =20 // IORT specific data - ItsGroupNode->NumItsIdentifiers =3D NodeList->ItsIdCount; + ItsGroupNode->NumItsIdentifiers =3D Node->ItsIdCount; ItsIds =3D (UINT32*)((UINT8*)ItsGroupNode + sizeof (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE)); =20 - Status =3D GetEArmObjGicItsIdentifierArray ( - CfgMgrProtocol, - NodeList->ItsIdToken, - &ItsIdentifier, - &ItsIdentifierCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjGicItsIdentifierArray, + Node->ItsIdToken, + (VOID **)&ItsIdentifier, + &ItsIdentifierCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get ITS Identifier array. Status =3D %r\n", - Status - )); return Status; } =20 @@ -789,7 +492,8 @@ AddItsGroupNodes ( DEBUG_ERROR, "ERROR: IORT: Failed to get the required number of ITS Identifiers= .\n" )); - return EFI_NOT_FOUND; + Status =3D EFI_NOT_FOUND; + goto EXIT; } =20 // Populate the ITS identifier array @@ -800,10 +504,11 @@ AddItsGroupNodes ( // Next IORT Group Node ItsGroupNode =3D (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE*)((UINT8*)ItsGrou= pNode + ItsGroupNode->Node.Length); - NodeList++; } // IORT Group Node =20 - return EFI_SUCCESS; +EXIT: + FreePool (ItsIdentifier); + return Status; } =20 /** Update the Named Component Node Information. @@ -812,8 +517,6 @@ AddItsGroupNodes ( table. =20 @param [in] This Pointer to the table Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the Named Component Nodes. @@ -829,10 +532,9 @@ STATIC EFI_STATUS AddNamedComponentNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProto= col, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartO= ffset, - IN CONST CM_ARM_NAMED_COMPONENT_NODE * NodeList, + IN VOID * NodeList, IN UINT32 NodeCount ) { @@ -842,6 +544,7 @@ AddNamedComponentNodes ( CHAR8 * ObjectName; UINTN ObjectNameLength; UINT64 NodeLength; + CM_ARM_NAMED_COMPONENT_NODE * Node; =20 ASSERT (Iort !=3D NULL); =20 @@ -849,7 +552,8 @@ AddNamedComponentNodes ( NodesStartOffset); =20 while (NodeCount-- !=3D 0) { - NodeLength =3D GetNamedComponentNodeSize (NodeList); + Node =3D (CM_ARM_NAMED_COMPONENT_NODE*) NodeList; + NodeLength =3D GetNamedComponentNodeSize (&NodeList); // Advances Nod= eList if (NodeLength > MAX_UINT16) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -867,20 +571,20 @@ AddNamedComponentNodes ( NcNode->Node.Length =3D (UINT16)NodeLength; NcNode->Node.Revision =3D 2; NcNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; - NcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; + NcNode->Node.NumIdMappings =3D Node->IdMappingCount; =20 - ObjectNameLength =3D AsciiStrLen (NodeList->ObjectName) + 1; + ObjectNameLength =3D AsciiStrLen (Node->ObjectName) + 1; NcNode->Node.IdReference =3D (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + (ALIGN_VALUE (ObjectNameLength, 4))); =20 // Named Component specific data - NcNode->Flags =3D NodeList->Flags; - NcNode->CacheCoherent =3D NodeList->CacheCoherent; - NcNode->AllocationHints =3D NodeList->AllocationHints; + NcNode->Flags =3D Node->Flags; + NcNode->CacheCoherent =3D Node->CacheCoherent; + NcNode->AllocationHints =3D Node->AllocationHints; NcNode->Reserved =3D EFI_ACPI_RESERVED_WORD; - NcNode->MemoryAccessFlags =3D NodeList->MemoryAccessFlags; - NcNode->AddressSizeLimit =3D NodeList->AddressSizeLimit; + NcNode->MemoryAccessFlags =3D Node->MemoryAccessFlags; + NcNode->AddressSizeLimit =3D Node->AddressSizeLimit; =20 // Copy the object name ObjectName =3D (CHAR8*)((UINT8*)NcNode + @@ -888,7 +592,7 @@ AddNamedComponentNodes ( Status =3D AsciiStrCpyS ( ObjectName, ObjectNameLength, - NodeList->ObjectName + Node->ObjectName ); if (EFI_ERROR (Status)) { DEBUG (( @@ -899,19 +603,14 @@ AddNamedComponentNodes ( return Status; } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if ((Node->IdMappingCount > 0) && + (Node->IdMappingToken !=3D CM_NULL_TOKEN)) { // Ids for Named Component IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)NcNode + NcNode->Node.IdReference); =20 Status =3D AddIdMappingArray ( - This, - CfgMgrProtocol, - IdMapArray, - NodeList->IdMappingCount, - NodeList->IdMappingToken - ); + This, IdMapArray, Node->IdMappingCount, Node->IdMappingToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -925,7 +624,6 @@ AddNamedComponentNodes ( // Next Named Component Node NcNode =3D (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE*)((UINT8*)NcNode= + NcNode->Node.Length); - NodeList++; } // Named Component Node =20 return EFI_SUCCESS; @@ -936,8 +634,6 @@ AddNamedComponentNodes ( This function updates the Root Complex node information in the IORT ta= ble. =20 @param [in] This Pointer to the table Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the Root Comp= lex Nodes. @@ -953,10 +649,9 @@ STATIC EFI_STATUS AddRootComplexNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProto= col, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartO= ffset, - IN CONST CM_ARM_ROOT_COMPLEX_NODE * NodeList, + IN VOID * NodeList, IN UINT32 NodeCount ) { @@ -964,6 +659,7 @@ AddRootComplexNodes ( EFI_ACPI_6_0_IO_REMAPPING_RC_NODE * RcNode; EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray; UINT64 NodeLength; + CM_ARM_ROOT_COMPLEX_NODE * Node; =20 ASSERT (Iort !=3D NULL); =20 @@ -971,7 +667,8 @@ AddRootComplexNodes ( NodesStartOffset); =20 while (NodeCount-- !=3D 0) { - NodeLength =3D GetRootComplexNodeSize (NodeList); + Node =3D (CM_ARM_ROOT_COMPLEX_NODE *) NodeList; + NodeLength =3D GetRootComplexNodeSize (&NodeList); // Advances NodeLi= st if (NodeLength > MAX_UINT16) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -989,33 +686,28 @@ AddRootComplexNodes ( RcNode->Node.Length =3D (UINT16)NodeLength; RcNode->Node.Revision =3D 1; RcNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; - RcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; + RcNode->Node.NumIdMappings =3D Node->IdMappingCount; RcNode->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE= ); =20 // Root Complex specific data - RcNode->CacheCoherent =3D NodeList->CacheCoherent; - RcNode->AllocationHints =3D NodeList->AllocationHints; + RcNode->CacheCoherent =3D Node->CacheCoherent; + RcNode->AllocationHints =3D Node->AllocationHints; RcNode->Reserved =3D EFI_ACPI_RESERVED_WORD; - RcNode->MemoryAccessFlags =3D NodeList->MemoryAccessFlags; - RcNode->AtsAttribute =3D NodeList->AtsAttribute; - RcNode->PciSegmentNumber =3D NodeList->PciSegmentNumber; - RcNode->MemoryAddressSize =3D NodeList->MemoryAddressSize; + RcNode->MemoryAccessFlags =3D Node->MemoryAccessFlags; + RcNode->AtsAttribute =3D Node->AtsAttribute; + RcNode->PciSegmentNumber =3D Node->PciSegmentNumber; + RcNode->MemoryAddressSize =3D Node->MemoryAddressSize; RcNode->Reserved1[0] =3D EFI_ACPI_RESERVED_BYTE; RcNode->Reserved1[1] =3D EFI_ACPI_RESERVED_BYTE; RcNode->Reserved1[2] =3D EFI_ACPI_RESERVED_BYTE; =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if ((Node->IdMappingCount > 0) && + (Node->IdMappingToken !=3D CM_NULL_TOKEN)) { // Ids for Root Complex IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)RcNode + RcNode->Node.IdReference); Status =3D AddIdMappingArray ( - This, - CfgMgrProtocol, - IdMapArray, - NodeList->IdMappingCount, - NodeList->IdMappingToken - ); + This, IdMapArray, Node->IdMappingCount, Node->IdMappingToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1029,7 +721,6 @@ AddRootComplexNodes ( // Next Root Complex Node RcNode =3D (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE*)((UINT8*)RcNode + RcNode->Node.Length); - NodeList++; } // Root Complex Node =20 return EFI_SUCCESS; @@ -1040,8 +731,6 @@ AddRootComplexNodes ( This function retrieves the InterruptArray object referenced by the InterruptToken and updates the SMMU InterruptArray. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in, out] InterruptArray Pointer to an array of Interrupts. @param [in] InterruptCount Number of entries in the InterruptAr= ray. @param [in] InterruptToken Reference Token for retrieving the S= MMU @@ -1054,31 +743,25 @@ AddRootComplexNodes ( STATIC EFI_STATUS AddSmmuInterrruptArray ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, IN OUT EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * InterruptArr= ay, IN UINT32 InterruptCou= nt, IN CONST CM_OBJECT_TOKEN InterruptTok= en ) { EFI_STATUS Status; - CM_ARM_SMMU_INTERRUPT * SmmuInterrupt; + CM_ARM_SMMU_INTERRUPT * Cursor; + VOID * SmmuInterrupt; UINT32 SmmuInterruptCount; =20 ASSERT (InterruptArray !=3D NULL); =20 // Get the SMMU Interrupt Array - Status =3D GetEArmObjSmmuInterruptArray ( - CfgMgrProtocol, - InterruptToken, - &SmmuInterrupt, - &SmmuInterruptCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjSmmuInterruptArray, + InterruptToken, + &SmmuInterrupt, + &SmmuInterruptCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get SMMU Interrupt array. Status =3D %r\n", - Status - )); return Status; } =20 @@ -1087,25 +770,27 @@ AddSmmuInterrruptArray ( DEBUG_ERROR, "ERROR: IORT: Failed to get the required number of SMMU Interrupts.\= n" )); - return EFI_NOT_FOUND; + Status =3D EFI_NOT_FOUND; + goto EXIT; } =20 + Cursor =3D SmmuInterrupt; // Populate the Id Mapping array while (InterruptCount-- !=3D 0) { - InterruptArray->Interrupt =3D SmmuInterrupt->Interrupt; - InterruptArray->InterruptFlags =3D SmmuInterrupt->Flags; + InterruptArray->Interrupt =3D Cursor->Interrupt; + InterruptArray->InterruptFlags =3D Cursor->Flags; InterruptArray++; - SmmuInterrupt++; + Cursor++; } // Id Mapping array =20 +EXIT: + FreePool (SmmuInterrupt); return EFI_SUCCESS; } =20 /** Update the SMMU v1/v2 Node Information. =20 @param [in] This Pointer to the table Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the SMMU v1/v2 Nodes. @@ -1121,10 +806,9 @@ STATIC EFI_STATUS AddSmmuV1V2Nodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOf= fset, - IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * NodeList, + IN VOID * NodeList, IN UINT32 NodeCount ) { @@ -1135,6 +819,7 @@ AddSmmuV1V2Nodes ( EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * ContextInterruptArray; EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * PmuInterruptArray; UINT64 NodeLength; + CM_ARM_SMMUV1_SMMUV2_NODE * Node; =20 ASSERT (Iort !=3D NULL); =20 @@ -1142,7 +827,8 @@ AddSmmuV1V2Nodes ( NodesStartOffset); =20 while (NodeCount-- !=3D 0) { - NodeLength =3D GetSmmuV1V2NodeSize (NodeList); + Node =3D (CM_ARM_SMMUV1_SMMUV2_NODE*) NodeList; + NodeLength =3D GetSmmuV1V2NodeSize (&NodeList); // Advances NodeList if (NodeLength > MAX_UINT16) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1159,25 +845,25 @@ AddSmmuV1V2Nodes ( SmmuNode->Node.Length =3D (UINT16)NodeLength; SmmuNode->Node.Revision =3D 0; SmmuNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; - SmmuNode->Node.NumIdMappings =3D NodeList->IdMappingCount; + SmmuNode->Node.NumIdMappings =3D Node->IdMappingCount; SmmuNode->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_= NODE) + - (NodeList->ContextInterruptCount * + (Node->ContextInterruptCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) + - (NodeList->PmuInterruptCount * + (Node->PmuInterruptCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)); =20 // SMMU v1/v2 specific data - SmmuNode->Base =3D NodeList->BaseAddress; - SmmuNode->Span =3D NodeList->Span; - SmmuNode->Model =3D NodeList->Model; - SmmuNode->Flags =3D NodeList->Flags; + SmmuNode->Base =3D Node->BaseAddress; + SmmuNode->Span =3D Node->Span; + SmmuNode->Model =3D Node->Model; + SmmuNode->Flags =3D Node->Flags; =20 // Reference to Global Interrupt Array SmmuNode->GlobalInterruptArrayRef =3D OFFSET_OF (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE, SMMU_NSgIrpt); =20 // Context Interrupt - SmmuNode->NumContextInterrupts =3D NodeList->ContextInterruptCount; + SmmuNode->NumContextInterrupts =3D Node->ContextInterruptCount; SmmuNode->ContextInterruptArrayRef =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE); ContextInterruptArray =3D @@ -1185,26 +871,24 @@ AddSmmuV1V2Nodes ( sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE)); =20 // PMU Interrupt - SmmuNode->NumPmuInterrupts =3D NodeList->PmuInterruptCount; + SmmuNode->NumPmuInterrupts =3D Node->PmuInterruptCount; SmmuNode->PmuInterruptArrayRef =3D SmmuNode->ContextInterruptArrayRef + - (NodeList->ContextInterruptCount * + (Node->ContextInterruptCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)); PmuInterruptArray =3D (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode + SmmuNode->PmuInterruptArrayRef); =20 - SmmuNode->SMMU_NSgIrpt =3D NodeList->SMMU_NSgIrpt; - SmmuNode->SMMU_NSgIrptFlags =3D NodeList->SMMU_NSgIrptFlags; - SmmuNode->SMMU_NSgCfgIrpt =3D NodeList->SMMU_NSgCfgIrpt; - SmmuNode->SMMU_NSgCfgIrptFlags =3D NodeList->SMMU_NSgCfgIrptFlags; + SmmuNode->SMMU_NSgIrpt =3D Node->SMMU_NSgIrpt; + SmmuNode->SMMU_NSgIrptFlags =3D Node->SMMU_NSgIrptFlags; + SmmuNode->SMMU_NSgCfgIrpt =3D Node->SMMU_NSgCfgIrpt; + SmmuNode->SMMU_NSgCfgIrptFlags =3D Node->SMMU_NSgCfgIrptFlags; =20 // Add Context Interrupt Array Status =3D AddSmmuInterrruptArray ( - CfgMgrProtocol, - ContextInterruptArray, - SmmuNode->NumContextInterrupts, - NodeList->ContextInterruptToken - ); + ContextInterruptArray, + SmmuNode->NumContextInterrupts, + Node->ContextInterruptToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1216,13 +900,11 @@ AddSmmuV1V2Nodes ( =20 // Add PMU Interrupt Array if ((SmmuNode->NumPmuInterrupts > 0) && - (NodeList->PmuInterruptToken !=3D CM_NULL_TOKEN)) { + (Node->PmuInterruptToken !=3D CM_NULL_TOKEN)) { Status =3D AddSmmuInterrruptArray ( - CfgMgrProtocol, - PmuInterruptArray, - SmmuNode->NumPmuInterrupts, - NodeList->PmuInterruptToken - ); + PmuInterruptArray, + SmmuNode->NumPmuInterrupts, + Node->PmuInterruptToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1233,18 +915,13 @@ AddSmmuV1V2Nodes ( } } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if ((Node->IdMappingCount > 0) && + (Node->IdMappingToken !=3D CM_NULL_TOKEN)) { // Ids for SMMU v1/v2 Node IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuNod= e + SmmuNode->Node.IdReference); Status =3D AddIdMappingArray ( - This, - CfgMgrProtocol, - IdMapArray, - NodeList->IdMappingCount, - NodeList->IdMappingToken - ); + This, IdMapArray, Node->IdMappingCount, Node->IdMappingToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1257,7 +934,6 @@ AddSmmuV1V2Nodes ( // Next SMMU v1/v2 Node SmmuNode =3D (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE*)((UINT8*)SmmuNode + SmmuNode->Node.Length); - NodeList++; } // SMMU v1/v2 Node =20 return EFI_SUCCESS; @@ -1268,8 +944,6 @@ AddSmmuV1V2Nodes ( This function updates the SMMUv3 node information in the IORT table. =20 @param [in] This Pointer to the table Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the SMMUv3 No= des. @param [in] NodeList Pointer to an array of SMMUv3 Node Ob= jects. @@ -1283,10 +957,9 @@ STATIC EFI_STATUS AddSmmuV3Nodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOf= fset, - IN CONST CM_ARM_SMMUV3_NODE * NodeList, + IN VOID * NodeList, IN UINT32 NodeCount ) { @@ -1294,6 +967,7 @@ AddSmmuV3Nodes ( EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE * SmmuV3Node; EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray; UINT64 NodeLength; + CM_ARM_SMMUV3_NODE * Node; =20 ASSERT (Iort !=3D NULL); =20 @@ -1301,7 +975,8 @@ AddSmmuV3Nodes ( NodesStartOffset); =20 while (NodeCount-- !=3D 0) { - NodeLength =3D GetSmmuV3NodeSize (NodeList); + Node =3D (CM_ARM_SMMUV3_NODE*) NodeList; + NodeLength =3D GetSmmuV3NodeSize (&NodeList); // Advances NodeList if (NodeLength > MAX_UINT16) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1318,24 +993,24 @@ AddSmmuV3Nodes ( SmmuV3Node->Node.Length =3D (UINT16)NodeLength; SmmuV3Node->Node.Revision =3D 2; SmmuV3Node->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; - SmmuV3Node->Node.NumIdMappings =3D NodeList->IdMappingCount; + SmmuV3Node->Node.NumIdMappings =3D Node->IdMappingCount; SmmuV3Node->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE); =20 // SMMUv3 specific data - SmmuV3Node->Base =3D NodeList->BaseAddress; - SmmuV3Node->Flags =3D NodeList->Flags; + SmmuV3Node->Base =3D Node->BaseAddress; + SmmuV3Node->Flags =3D Node->Flags; SmmuV3Node->Reserved =3D EFI_ACPI_RESERVED_WORD; - SmmuV3Node->VatosAddress =3D NodeList->VatosAddress; - SmmuV3Node->Model =3D NodeList->Model; - SmmuV3Node->Event =3D NodeList->EventInterrupt; - SmmuV3Node->Pri =3D NodeList->PriInterrupt; - SmmuV3Node->Gerr =3D NodeList->GerrInterrupt; - SmmuV3Node->Sync =3D NodeList->SyncInterrupt; + SmmuV3Node->VatosAddress =3D Node->VatosAddress; + SmmuV3Node->Model =3D Node->Model; + SmmuV3Node->Event =3D Node->EventInterrupt; + SmmuV3Node->Pri =3D Node->PriInterrupt; + SmmuV3Node->Gerr =3D Node->GerrInterrupt; + SmmuV3Node->Sync =3D Node->SyncInterrupt; =20 if ((SmmuV3Node->Flags & EFI_ACPI_IORT_SMMUv3_FLAG_PROXIMITY_DOMAIN) != =3D 0) { // The Proximity Domain Valid flag is set to 1 - SmmuV3Node->ProximityDomain =3D NodeList->ProximityDomain; + SmmuV3Node->ProximityDomain =3D Node->ProximityDomain; } else { SmmuV3Node->ProximityDomain =3D 0; } @@ -1346,21 +1021,16 @@ AddSmmuV3Nodes ( // the DeviceID mapping index field is ignored. SmmuV3Node->DeviceIdMappingIndex =3D 0; } else { - SmmuV3Node->DeviceIdMappingIndex =3D NodeList->DeviceIdMappingIndex; + SmmuV3Node->DeviceIdMappingIndex =3D Node->DeviceIdMappingIndex; } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if ((Node->IdMappingCount > 0) && + (Node->IdMappingToken !=3D CM_NULL_TOKEN)) { // Ids for SMMUv3 node IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuV3N= ode + SmmuV3Node->Node.IdReference); Status =3D AddIdMappingArray ( - This, - CfgMgrProtocol, - IdMapArray, - NodeList->IdMappingCount, - NodeList->IdMappingToken - ); + This, IdMapArray, Node->IdMappingCount, Node->IdMappingToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1374,7 +1044,6 @@ AddSmmuV3Nodes ( // Next SMMUv3 Node SmmuV3Node =3D (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE*)((UINT8*)SmmuV3N= ode + SmmuV3Node->Node.Length); - NodeList++; } // SMMUv3 Node =20 return EFI_SUCCESS; @@ -1385,8 +1054,6 @@ AddSmmuV3Nodes ( This function updates the PMCG node information in the IORT table. =20 @param [in] This Pointer to the table Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the PMCG Node= s. @param [in] NodeList Pointer to an array of PMCG Node Obje= cts. @@ -1400,10 +1067,9 @@ STATIC EFI_STATUS AddPmcgNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOf= fset, - IN CONST CM_ARM_PMCG_NODE * NodeList, + IN VOID * NodeList, IN UINT32 NodeCount ) { @@ -1412,6 +1078,7 @@ AddPmcgNodes ( EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray; ACPI_IORT_GENERATOR * Generator; UINT64 NodeLength; + CM_ARM_PMCG_NODE * Node; =20 ASSERT (Iort !=3D NULL); =20 @@ -1420,7 +1087,8 @@ AddPmcgNodes ( NodesStartOffset); =20 while (NodeCount-- !=3D 0) { - NodeLength =3D GetPmcgNodeSize (NodeList); + Node =3D (CM_ARM_PMCG_NODE*) NodeList; + NodeLength =3D GetPmcgNodeSize (&NodeList); // Advances NodeList if (NodeLength > MAX_UINT16) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1437,18 +1105,18 @@ AddPmcgNodes ( PmcgNode->Node.Length =3D (UINT16)NodeLength; PmcgNode->Node.Revision =3D 1; PmcgNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; - PmcgNode->Node.NumIdMappings =3D NodeList->IdMappingCount; + PmcgNode->Node.NumIdMappings =3D Node->IdMappingCount; PmcgNode->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_= NODE); =20 // PMCG specific data - PmcgNode->Base =3D NodeList->BaseAddress; - PmcgNode->OverflowInterruptGsiv =3D NodeList->OverflowInterrupt; - PmcgNode->Page1Base =3D NodeList->Page1BaseAddress; + PmcgNode->Base =3D Node->BaseAddress; + PmcgNode->OverflowInterruptGsiv =3D Node->OverflowInterrupt; + PmcgNode->Page1Base =3D Node->Page1BaseAddress; =20 Status =3D GetNodeOffsetReferencedByToken ( Generator->NodeIndexer, Generator->IortNodeCount, - NodeList->ReferenceToken, + Node->ReferenceToken, &PmcgNode->NodeReference ); if (EFI_ERROR (Status)) { @@ -1457,25 +1125,20 @@ AddPmcgNodes ( "ERROR: IORT: Failed to get Output Reference for PMCG Node." "Reference Token =3D %p" " Status =3D %r\n", - NodeList->ReferenceToken, + Node->ReferenceToken, Status )); return Status; } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if ((Node->IdMappingCount > 0) && + (Node->IdMappingToken !=3D CM_NULL_TOKEN)) { // Ids for PMCG node IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)PmcgNod= e + PmcgNode->Node.IdReference); =20 Status =3D AddIdMappingArray ( - This, - CfgMgrProtocol, - IdMapArray, - NodeList->IdMappingCount, - NodeList->IdMappingToken - ); + This, IdMapArray, Node->IdMappingCount, Node->IdMappingToken); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1489,7 +1152,6 @@ AddPmcgNodes ( // Next PMCG Node PmcgNode =3D (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE*)((UINT8*)PmcgNode + PmcgNode->Node.Length); - NodeList++; } // PMCG Node =20 return EFI_SUCCESS; @@ -1547,20 +1209,13 @@ BuildIortTable ( UINT32 SmmuV3Offset; UINT32 PmcgOffset; =20 - CM_ARM_ITS_GROUP_NODE * ItsGroupNodeList; - CM_ARM_NAMED_COMPONENT_NODE * NamedComponentNodeList; - CM_ARM_ROOT_COMPLEX_NODE * RootComplexNodeList; - CM_ARM_SMMUV1_SMMUV2_NODE * SmmuV1V2NodeList; - CM_ARM_SMMUV3_NODE * SmmuV3NodeList; - CM_ARM_PMCG_NODE * PmcgNodeList; - + VOID * NodeList; EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort; IORT_NODE_INDEXER * NodeIndexer; ACPI_IORT_GENERATOR * Generator; =20 ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (Table !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); @@ -1579,136 +1234,68 @@ BuildIortTable ( } =20 Generator =3D (ACPI_IORT_GENERATOR*)This; + + // Pointers to allocated memory *Table =3D NULL; =20 // Get the ITS group node info - Status =3D GetEArmObjItsGroup ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &ItsGroupNodeList, - &ItsGroupNodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjItsGroup, &ItsGroupNodeCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get ITS Group Node Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 // Add the ITS group node count IortNodeCount =3D ItsGroupNodeCount; =20 // Get the Named component node info - Status =3D GetEArmObjNamedComponent ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &NamedComponentNodeList, - &NamedComponentNodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjNamedComponent, &NamedComponentNod= eCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get Named Component Node Info. Status =3D %r= \n", - Status - )); - goto error_handler; + return Status; } =20 // Add the Named Component group count IortNodeCount +=3D NamedComponentNodeCount; =20 // Get the Root complex node info - Status =3D GetEArmObjRootComplex ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &RootComplexNodeList, - &RootComplexNodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjRootComplex, &RootComplexNodeCount= ); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get Root Complex Node Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 // Add the Root Complex node count IortNodeCount +=3D RootComplexNodeCount; =20 // Get the SMMU v1/v2 node info - Status =3D GetEArmObjSmmuV1SmmuV2 ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &SmmuV1V2NodeList, - &SmmuV1V2NodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjSmmuV1SmmuV2, &SmmuV1V2NodeCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get SMMUv1/SMMUv2 Node Info. Status =3D %r\n= ", - Status - )); - goto error_handler; + return Status; } =20 // Add the SMMU v1/v2 node count IortNodeCount +=3D SmmuV1V2NodeCount; =20 // Get the SMMUv3 node info - Status =3D GetEArmObjSmmuV3 ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &SmmuV3NodeList, - &SmmuV3NodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjSmmuV3, &SmmuV3NodeCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get SMMUv3 Node Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 // Add the SMMUv3 node count IortNodeCount +=3D SmmuV3NodeCount; =20 // Get the PMCG node info - Status =3D GetEArmObjPmcg ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &PmcgNodeList, - &PmcgNodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjPmcg, &PmcgNodeCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to get PMCG Node Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 // Add the PMCG node count IortNodeCount +=3D PmcgNodeCount; =20 // Allocate Node Indexer array - NodeIndexer =3D (IORT_NODE_INDEXER*)AllocateZeroPool ( - (sizeof (IORT_NODE_INDEXER) * - IortNodeCount) - ); + NodeIndexer =3D AllocateZeroPool ((sizeof (IORT_NODE_INDEXER) * IortNode= Count)); if (NodeIndexer =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to allocate memory for Node Indexer" \ - " Status =3D %r\n", - Status - )); - goto error_handler; + return EFI_OUT_OF_RESOURCES; } =20 DEBUG ((DEBUG_INFO, "INFO: NodeIndexer =3D %p\n", NodeIndexer)); @@ -1721,13 +1308,10 @@ BuildIortTable ( // ITS Group Nodes if (ItsGroupNodeCount > 0) { ItsGroupOffset =3D (UINT32)TableSize; - // Size of ITS Group node list. - NodeSize =3D GetSizeofItsGroupNodes ( - ItsGroupOffset, - ItsGroupNodeList, - ItsGroupNodeCount, - &NodeIndexer - ); + + NodeSize =3D GetSizeOfNodes ( + EArmObjItsGroup, ItsGroupOffset, &NodeIndexer, GetItsGroupNodeSize); + if (NodeSize > MAX_UINT32) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1751,13 +1335,13 @@ BuildIortTable ( // Named Component Nodes if (NamedComponentNodeCount > 0) { NamedComponentOffset =3D (UINT32)TableSize; - // Size of Named Component node list. - NodeSize =3D GetSizeofNamedComponentNodes ( - NamedComponentOffset, - NamedComponentNodeList, - NamedComponentNodeCount, - &NodeIndexer - ); + + NodeSize =3D GetSizeOfNodes ( + EArmObjNamedComponent, + NamedComponentOffset, + &NodeIndexer, + GetNamedComponentNodeSize); + if (NodeSize > MAX_UINT32) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1781,13 +1365,13 @@ BuildIortTable ( // Root Complex Nodes if (RootComplexNodeCount > 0) { RootComplexOffset =3D (UINT32)TableSize; - // Size of Root Complex node list. - NodeSize =3D GetSizeofRootComplexNodes ( - RootComplexOffset, - RootComplexNodeList, - RootComplexNodeCount, - &NodeIndexer - ); + + NodeSize =3D GetSizeOfNodes ( + EArmObjRootComplex, + RootComplexOffset, + &NodeIndexer, + GetRootComplexNodeSize); + if (NodeSize > MAX_UINT32) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1811,13 +1395,9 @@ BuildIortTable ( // SMMUv1/SMMUv2 Nodes if (SmmuV1V2NodeCount > 0) { SmmuV1V2Offset =3D (UINT32)TableSize; - // Size of SMMUv1/SMMUv2 node list. - NodeSize =3D GetSizeofSmmuV1V2Nodes ( - SmmuV1V2Offset, - SmmuV1V2NodeList, - SmmuV1V2NodeCount, - &NodeIndexer - ); + + NodeSize =3D GetSizeOfNodes ( + EArmObjSmmuV1SmmuV2, SmmuV1V2Offset, &NodeIndexer, GetSmmuV1V2NodeSi= ze); if (NodeSize > MAX_UINT32) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1841,13 +1421,9 @@ BuildIortTable ( // SMMUv3 Nodes if (SmmuV3NodeCount > 0) { SmmuV3Offset =3D (UINT32)TableSize; - // Size of SMMUv3 node list. - NodeSize =3D GetSizeofSmmuV3Nodes ( - SmmuV3Offset, - SmmuV3NodeList, - SmmuV3NodeCount, - &NodeIndexer - ); + + NodeSize =3D GetSizeOfNodes ( + EArmObjSmmuV3, SmmuV3Offset, &NodeIndexer, GetSmmuV3NodeSize); if (NodeSize > MAX_UINT32) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1871,13 +1447,9 @@ BuildIortTable ( // PMCG Nodes if (PmcgNodeCount > 0) { PmcgOffset =3D (UINT32)TableSize; - // Size of PMCG node list. - NodeSize =3D GetSizeofPmcgNodes ( - PmcgOffset, - PmcgNodeList, - PmcgNodeCount, - &NodeIndexer - ); + + NodeSize =3D GetSizeOfNodes ( + EArmObjPmcg, PmcgOffset, &NodeIndexer, GetPmcgNodeSize); if (NodeSize > MAX_UINT32) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( @@ -1920,21 +1492,12 @@ BuildIortTable ( } =20 // Allocate the Buffer for IORT table - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); - if (*Table =3D=3D NULL) { + Iort =3D AllocateZeroPool (TableSize); + if (Iort =3D=3D NULL) { Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to allocate memory for IORT Table, Size =3D %d,= " \ - " Status =3D %r\n", - TableSize, - Status - )); goto error_handler; } =20 - Iort =3D (EFI_ACPI_6_0_IO_REMAPPING_TABLE*)*Table; - DEBUG (( DEBUG_INFO, "IORT: Iort =3D 0x%p TableSize =3D 0x%lx\n", @@ -1944,11 +1507,6 @@ BuildIortTable ( =20 Status =3D AddAcpiHeader (This, &Iort->Header, AcpiTableInfo, (UINT32) T= ableSize); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 @@ -1958,14 +1516,10 @@ BuildIortTable ( Iort->Reserved =3D EFI_ACPI_RESERVED_DWORD; =20 if (ItsGroupNodeCount > 0) { + CfgMgrGetSimpleObject(EArmObjItsGroup, &NodeList); Status =3D AddItsGroupNodes ( - This, - CfgMgrProtocol, - Iort, - ItsGroupOffset, - ItsGroupNodeList, - ItsGroupNodeCount - ); + This, Iort, ItsGroupOffset, NodeList, ItsGroupNodeCount); + FreePool (NodeList); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1977,14 +1531,10 @@ BuildIortTable ( } =20 if (NamedComponentNodeCount > 0) { + CfgMgrGetSimpleObject(EArmObjNamedComponent, &NodeList); Status =3D AddNamedComponentNodes ( - This, - CfgMgrProtocol, - Iort, - NamedComponentOffset, - NamedComponentNodeList, - NamedComponentNodeCount - ); + This, Iort, NamedComponentOffset, NodeList, NamedComponentNodeCount); + FreePool (NodeList); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1996,14 +1546,10 @@ BuildIortTable ( } =20 if (RootComplexNodeCount > 0) { + CfgMgrGetSimpleObject(EArmObjRootComplex, &NodeList); Status =3D AddRootComplexNodes ( - This, - CfgMgrProtocol, - Iort, - RootComplexOffset, - RootComplexNodeList, - RootComplexNodeCount - ); + This, Iort, RootComplexOffset, NodeList, RootComplexNodeCount); + FreePool (NodeList); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -2015,14 +1561,10 @@ BuildIortTable ( } =20 if (SmmuV1V2NodeCount > 0) { + CfgMgrGetSimpleObject(EArmObjSmmuV1SmmuV2, &NodeList); Status =3D AddSmmuV1V2Nodes ( - This, - CfgMgrProtocol, - Iort, - SmmuV1V2Offset, - SmmuV1V2NodeList, - SmmuV1V2NodeCount - ); + This, Iort, SmmuV1V2Offset, NodeList, SmmuV1V2NodeCount); + FreePool (NodeList); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -2034,14 +1576,10 @@ BuildIortTable ( } =20 if (SmmuV3NodeCount > 0) { + CfgMgrGetSimpleObject(EArmObjSmmuV3, &NodeList); Status =3D AddSmmuV3Nodes ( - This, - CfgMgrProtocol, - Iort, - SmmuV3Offset, - SmmuV3NodeList, - SmmuV3NodeCount - ); + This, Iort, SmmuV3Offset, NodeList, SmmuV3NodeCount); + FreePool (NodeList); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -2053,14 +1591,9 @@ BuildIortTable ( } =20 if (PmcgNodeCount > 0) { - Status =3D AddPmcgNodes ( - This, - CfgMgrProtocol, - Iort, - PmcgOffset, - PmcgNodeList, - PmcgNodeCount - ); + CfgMgrGetSimpleObject(EArmObjPmcg, &NodeList); + Status =3D AddPmcgNodes (This, Iort, PmcgOffset, NodeList, PmcgNodeCou= nt); + FreePool (NodeList); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -2071,6 +1604,8 @@ BuildIortTable ( } } =20 + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*) Iort; + return EFI_SUCCESS; =20 error_handler: @@ -2078,11 +1613,10 @@ error_handler: FreePool (Generator->NodeIndexer); Generator->NodeIndexer =3D NULL; } - - if (*Table !=3D NULL) { - FreePool (*Table); - *Table =3D NULL; + if (Iort !=3D NULL) { + FreePool (Iort); } + return Status; } =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c index ab42c96b06..0d75a24724 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c @@ -17,7 +17,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -33,54 +32,6 @@ Requirements: - EArmObjGicItsInfo (OPTIONAL) */ =20 -/** This macro expands to a function that retrieves the GIC - CPU interface Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicCInfo, - CM_ARM_GICC_INFO - ); - -/** This macro expands to a function that retrieves the GIC - Distributor Information from the Configuration Manager. -*/ - -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicDInfo, - CM_ARM_GICD_INFO - ); - -/** This macro expands to a function that retrieves the GIC - MSI Frame Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicMsiFrameInfo, - CM_ARM_GIC_MSI_FRAME_INFO - ); - -/** This macro expands to a function that retrieves the GIC - Redistributor Information from the Configuration Manager. -*/ - -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicRedistributorInfo, - CM_ARM_GIC_REDIST_INFO - ); - -/** This macro expands to a function that retrieves the GIC - Interrupt Translation Service Information from the - Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicItsInfo, - CM_ARM_GIC_ITS_INFO - ); - /** This function updates the GIC CPU Interface Information in the EFI_ACPI_6_3_GIC_STRUCTURE structure. =20 @@ -215,15 +166,21 @@ STATIC EFI_STATUS AddGICCList ( IN EFI_ACPI_6_3_GIC_STRUCTURE * Gicc, - IN CONST CM_ARM_GICC_INFO * GicCInfo, - IN UINT32 GicCCount, IN CONST UINT8 MadtRev ) { BOOLEAN IsAcpiProcUidDuplicated; + CM_ARM_GICC_INFO *Cursor; + VOID *GicCInfo; + UINT32 GicCCount; =20 ASSERT (Gicc !=3D NULL); - ASSERT (GicCInfo !=3D NULL); + + EFI_STATUS Status =3D + CfgMgrGetObjects (EArmObjGicCInfo, CM_NULL_TOKEN, &GicCInfo, &GicCCoun= t); + if (EFI_ERROR (Status)) { + return Status; + } =20 IsAcpiProcUidDuplicated =3D FindDuplicateValue ( GicCInfo, @@ -234,31 +191,40 @@ AddGICCList ( // Duplicate ACPI Processor UID was found so the GICC info provided // is invalid if (IsAcpiProcUidDuplicated) { + FreePool (GicCInfo); return EFI_INVALID_PARAMETER; } =20 + Cursor =3D GicCInfo; while (GicCCount-- !=3D 0) { - AddGICC (Gicc++, GicCInfo++, MadtRev); + AddGICC (Gicc++, Cursor++, MadtRev); } =20 + FreePool (GicCInfo); return EFI_SUCCESS; } =20 /** Update the GIC Distributor Information in the MADT Table. =20 @param [in] Gicd Pointer to GIC Distributor structure. - @param [in] GicDInfo Pointer to the GIC Distributor Information. **/ STATIC VOID AddGICD ( - EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE * CONST Gicd, - CONST CM_ARM_GICD_INFO * CONST GicDInfo -) + EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE * CONST Gicd + ) { + EFI_STATUS Status; + CM_ARM_GICD_INFO *GicDInfo; + ASSERT (Gicd !=3D NULL); ASSERT (GicDInfo !=3D NULL); =20 + Status =3D CfgMgrGetSimpleObject (EArmObjGicDInfo, (VOID **)&GicDInfo); + if (EFI_ERROR (Status)) { + return; + } + // UINT8 Type Gicd->Type =3D EFI_ACPI_6_3_GICD; // UINT8 Length @@ -279,6 +245,8 @@ AddGICD ( Gicd->Reserved2[0] =3D EFI_ACPI_RESERVED_BYTE; Gicd->Reserved2[1] =3D EFI_ACPI_RESERVED_BYTE; Gicd->Reserved2[2] =3D EFI_ACPI_RESERVED_BYTE; + + FreePool (GicDInfo); } =20 /** Update the GIC MSI Frame Information. @@ -310,23 +278,32 @@ AddGICMsiFrame ( /** Add the GIC MSI Frame Information to the MADT Table. =20 @param [in] GicMsiFrame Pointer to GIC MSI Frame structure list. - @param [in] GicMsiFrameInfo Pointer to the GIC MSI Frame info list. - @param [in] GicMsiFrameCount Count of GIC MSI Frames. **/ STATIC VOID AddGICMsiFrameInfoList ( - IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE * GicMsiFrame, - IN CONST CM_ARM_GIC_MSI_FRAME_INFO * GicMsiFrameInfo, - IN UINT32 GicMsiFrameCount -) + IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE * GicMsiFrame + ) { + EFI_STATUS Status; + VOID *GicMsiInfo; + CM_ARM_GIC_MSI_FRAME_INFO *Cursor; + UINT32 GicMsiCount; + ASSERT (GicMsiFrame !=3D NULL); - ASSERT (GicMsiFrameInfo !=3D NULL); =20 - while (GicMsiFrameCount-- !=3D 0) { - AddGICMsiFrame (GicMsiFrame++, GicMsiFrameInfo++); + Status =3D CfgMgrGetObjects ( + EArmObjGicMsiFrameInfo, CM_NULL_TOKEN, &GicMsiInfo, &GicMsiCount); + if (EFI_ERROR(Status)) { + return; + } + + Cursor =3D GicMsiInfo; + while (GicMsiCount-- !=3D 0) { + AddGICMsiFrame (GicMsiFrame++, Cursor++); } + + FreePool (GicMsiInfo); } =20 /** Update the GIC Redistributor Information. @@ -355,23 +332,32 @@ AddGICRedistributor ( /** Add the GIC Redistributor Information to the MADT Table. =20 @param [in] Gicr Pointer to GIC Redistributor structure list. - @param [in] GicRInfo Pointer to the GIC Distributor info list. - @param [in] GicRCount Count of GIC Distributors. **/ STATIC VOID AddGICRedistributorList ( - IN EFI_ACPI_6_3_GICR_STRUCTURE * Gicr, - IN CONST CM_ARM_GIC_REDIST_INFO * GicRInfo, - IN UINT32 GicRCount + IN EFI_ACPI_6_3_GICR_STRUCTURE * Gicr ) { + CM_ARM_GIC_REDIST_INFO *Cursor; + VOID *GicRInfo; + UINT32 GicRCount; + EFI_STATUS Status; + ASSERT (Gicr !=3D NULL); - ASSERT (GicRInfo !=3D NULL); =20 + Status =3D CfgMgrGetObjects ( + EArmObjGicRedistributorInfo, CM_NULL_TOKEN, &GicRInfo, &GicRCount); + if (EFI_ERROR (Status)) { + return; + } + + Cursor =3D GicRInfo; while (GicRCount-- !=3D 0) { - AddGICRedistributor (Gicr++, GicRInfo++); + AddGICRedistributor (Gicr++, Cursor++); } + + FreePool (GicRInfo); } =20 /** Update the GIC Interrupt Translation Service Information @@ -401,23 +387,32 @@ AddGICInterruptTranslationService ( to the MADT Table. =20 @param [in] GicIts Pointer to GIC ITS structure list. - @param [in] GicItsInfo Pointer to the GIC ITS list. - @param [in] GicItsCount Count of GIC ITS. **/ STATIC VOID AddGICItsList ( - IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE * GicIts, - IN CONST CM_ARM_GIC_ITS_INFO * GicItsInfo, - IN UINT32 GicItsCount + IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE * GicIts ) { + CM_ARM_GIC_ITS_INFO *Cursor; + VOID *GicItsInfo; + UINT32 GicItsCount; + EFI_STATUS Status; + ASSERT (GicIts !=3D NULL); - ASSERT (GicItsInfo !=3D NULL); =20 + Status =3D CfgMgrGetObjects ( + EArmObjGicItsInfo, CM_NULL_TOKEN, &GicItsInfo, &GicItsCount); + if (EFI_ERROR(Status)) { + return; + } + + Cursor =3D GicItsInfo; while (GicItsCount-- !=3D 0) { - AddGICInterruptTranslationService (GicIts++, GicItsInfo++); + AddGICInterruptTranslationService (GicIts++, Cursor++); } + + FreePool (GicItsInfo); } =20 /** Construct the MADT ACPI table. @@ -454,16 +449,13 @@ BuildMadtTable ( { EFI_STATUS Status; UINT32 TableSize; + UINT32 GicCCount; UINT32 GicDCount; UINT32 GicMSICount; UINT32 GicRedistCount; UINT32 GicItsCount; - CM_ARM_GICC_INFO * GicCInfo; - CM_ARM_GICD_INFO * GicDInfo; - CM_ARM_GIC_MSI_FRAME_INFO * GicMSIInfo; - CM_ARM_GIC_REDIST_INFO * GicRedistInfo; - CM_ARM_GIC_ITS_INFO * GicItsInfo; + UINT32 GicCOffset; UINT32 GicDOffset; UINT32 GicMSIOffset; @@ -474,7 +466,6 @@ BuildMadtTable ( =20 ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (Table !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); @@ -492,21 +483,12 @@ BuildMadtTable ( return EFI_INVALID_PARAMETER; } =20 + // Allocated memory pointers *Table =3D NULL; =20 - Status =3D GetEArmObjGicCInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicCInfo, - &GicCCount - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to get GICC Info. Status =3D %r\n", - Status - )); - goto error_handler; + Status =3D CfgMgrCountObjects (EArmObjGicCInfo, &GicCCount); + if (EFI_ERROR(Status)) { + return Status; } =20 if (GicCCount =3D=3D 0) { @@ -515,23 +497,12 @@ BuildMadtTable ( "ERROR: MADT: GIC CPU Interface information not provided.\n" )); ASSERT (GicCCount !=3D 0); - Status =3D EFI_INVALID_PARAMETER; - goto error_handler; + return EFI_INVALID_PARAMETER; } =20 - Status =3D GetEArmObjGicDInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicDInfo, - &GicDCount - ); + Status =3D CfgMgrCountObjects (EArmObjGicDInfo, &GicDCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to get GICD Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 if (GicDCount =3D=3D 0) { @@ -540,8 +511,7 @@ BuildMadtTable ( "ERROR: MADT: GIC Distributor information not provided.\n" )); ASSERT (GicDCount !=3D 0); - Status =3D EFI_INVALID_PARAMETER; - goto error_handler; + return EFI_INVALID_PARAMETER; } =20 if (GicDCount > 1) { @@ -552,53 +522,22 @@ BuildMadtTable ( GicDCount )); ASSERT (GicDCount <=3D 1); - Status =3D EFI_INVALID_PARAMETER; - goto error_handler; + return EFI_INVALID_PARAMETER; } =20 - Status =3D GetEArmObjGicMsiFrameInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicMSIInfo, - &GicMSICount - ); + Status =3D CfgMgrCountObjects (EArmObjGicMsiFrameInfo, &GicMSICount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to get GIC MSI Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 - Status =3D GetEArmObjGicRedistributorInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicRedistInfo, - &GicRedistCount - ); + Status =3D CfgMgrCountObjects (EArmObjGicRedistributorInfo, &GicRedistCo= unt); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to get GIC Redistributor Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 - Status =3D GetEArmObjGicItsInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicItsInfo, - &GicItsCount - ); + Status =3D CfgMgrCountObjects (EArmObjGicItsInfo, &GicItsCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to get GIC ITS Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 TableSize =3D sizeof (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADE= R); @@ -619,21 +558,11 @@ BuildMadtTable ( TableSize +=3D (sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE) * GicItsCount); =20 // Allocate the Buffer for MADT table - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); - if (*Table =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to allocate memory for MADT Table, Size =3D %d,= " \ - " Status =3D %r\n", - TableSize, - Status - )); - goto error_handler; + Madt =3D AllocateZeroPool (TableSize); + if (Madt =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; } =20 - Madt =3D (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER*)*Table; - DEBUG (( DEBUG_INFO, "MADT: Madt =3D 0x%p TableSize =3D 0x%x\n", @@ -643,20 +572,13 @@ BuildMadtTable ( =20 Status =3D AddAcpiHeader (This, &Madt->Header, AcpiTableInfo, TableSize); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MADT: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 Status =3D AddGICCList ( - (EFI_ACPI_6_3_GIC_STRUCTURE*)((UINT8*)Madt + GicCOffset), - GicCInfo, - GicCCount, - Madt->Header.Revision - ); + (EFI_ACPI_6_3_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset), + Madt->Header.Revision); + if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -666,42 +588,25 @@ BuildMadtTable ( goto error_handler; } =20 - AddGICD ( - (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE*)((UINT8*)Madt + GicDOffset), - GicDInfo - ); + AddGICD ((VOID *)((UINT8 *)Madt + GicDOffset)); =20 if (GicMSICount !=3D 0) { - AddGICMsiFrameInfoList ( - (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE*)((UINT8*)Madt + GicMSIOffset), - GicMSIInfo, - GicMSICount - ); + AddGICMsiFrameInfoList ((VOID *)((UINT8 *)Madt + GicMSIOffset)); } =20 if (GicRedistCount !=3D 0) { - AddGICRedistributorList ( - (EFI_ACPI_6_3_GICR_STRUCTURE*)((UINT8*)Madt + GicRedistOffset), - GicRedistInfo, - GicRedistCount - ); + AddGICRedistributorList ((VOID *)((UINT8 *)Madt + GicRedistOffset)); } =20 if (GicItsCount !=3D 0) { - AddGICItsList ( - (EFI_ACPI_6_3_GIC_ITS_STRUCTURE*)((UINT8*)Madt + GicItsOffset), - GicItsInfo, - GicItsCount - ); + AddGICItsList ((VOID *)((UINT8 *)Madt + GicItsOffset)); } =20 + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)Madt; return EFI_SUCCESS; =20 error_handler: - if (*Table !=3D NULL) { - FreePool (*Table); - *Table =3D NULL; - } + FreePool (Madt); return Status; } =20 @@ -727,7 +632,6 @@ FreeMadtTableResources ( { ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c index a486e2297a..0283ea11f5 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c @@ -18,7 +18,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -48,50 +47,52 @@ typedef =20 #pragma pack() =20 -/** Retrieve the PCI Configuration Space Information. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjPciConfigSpaceInfo, - CM_ARM_PCI_CONFIG_SPACE_INFO - ); - /** Add the PCI Enhanced Configuration Space Information to the MCFG Table. =20 @param [in] Mcfg Pointer to MCFG Table. @param [in] PciCfgSpaceOffset Offset for the PCI Configuration Space Info structure in the MCFG Table. - @param [in] PciCfgSpaceInfoList Pointer to the PCI Configuration Space - Info List. - @param [in] PciCfgSpaceCount Count of PCI Configuration Space Info. **/ STATIC VOID AddPciConfigurationSpaceList ( IN MCFG_TABLE * CONST Mcfg, - IN CONST UINT32 PciCfgSpaceOffset, - IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO * PciCfgSpaceInfoList, - IN UINT32 PciCfgSpaceCount + IN CONST UINT32 PciCfgSpaceOffset ) { - MCFG_CFG_SPACE_ADDR * PciCfgSpace; + MCFG_CFG_SPACE_ADDR *PciCfgSpace; + CM_ARM_PCI_CONFIG_SPACE_INFO *Cursor; + VOID *PciCfgSpaceInfoList; + UINT32 PciCfgSpaceCount; + EFI_STATUS Status; =20 ASSERT (Mcfg !=3D NULL); - ASSERT (PciCfgSpaceInfoList !=3D NULL); + + Status =3D CfgMgrGetObjects ( + EArmObjPciConfigSpaceInfo, + CM_NULL_TOKEN, + &PciCfgSpaceInfoList, + &PciCfgSpaceCount); + if (EFI_ERROR (Status)) { + return; + } =20 PciCfgSpace =3D (MCFG_CFG_SPACE_ADDR *)((UINT8*)Mcfg + PciCfgSpaceOffset= ); =20 + Cursor =3D PciCfgSpaceInfoList; while (PciCfgSpaceCount-- !=3D 0) { // Add PCI Configuration Space entry - PciCfgSpace->BaseAddress =3D PciCfgSpaceInfoList->BaseAddress; + PciCfgSpace->BaseAddress =3D Cursor->BaseAddress; PciCfgSpace->PciSegmentGroupNumber =3D - PciCfgSpaceInfoList->PciSegmentGroupNumber; - PciCfgSpace->StartBusNumber =3D PciCfgSpaceInfoList->StartBusNumber; - PciCfgSpace->EndBusNumber =3D PciCfgSpaceInfoList->EndBusNumber; + Cursor->PciSegmentGroupNumber; + PciCfgSpace->StartBusNumber =3D Cursor->StartBusNumber; + PciCfgSpace->EndBusNumber =3D Cursor->EndBusNumber; PciCfgSpace->Reserved =3D EFI_ACPI_RESERVED_DWORD; PciCfgSpace++; - PciCfgSpaceInfoList++; + Cursor++; } + + FreePool (PciCfgSpaceInfoList); } =20 /** Construct the MCFG ACPI table. @@ -152,20 +153,14 @@ BuildMcfgTable ( return EFI_INVALID_PARAMETER; } =20 + // Pointers to allocated memory *Table =3D NULL; - Status =3D GetEArmObjPciConfigSpaceInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &PciConfigSpaceInfoList, - &ConfigurationSpaceCount - ); + PciConfigSpaceInfoList =3D NULL; + + Status =3D + CfgMgrCountObjects (EArmObjPciConfigSpaceInfo, &ConfigurationSpaceCoun= t); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, - "ERROR: MCFG: Failed to get PCI Configuration Space Information." \ - " Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 if (ConfigurationSpaceCount =3D=3D 0) { @@ -174,9 +169,8 @@ BuildMcfgTable ( "ERROR: MCFG: Configuration Space Count =3D %d\n", ConfigurationSpaceCount )); - Status =3D EFI_INVALID_PARAMETER; ASSERT (ConfigurationSpaceCount !=3D 0); - goto error_handler; + return EFI_INVALID_PARAMETER; } =20 DEBUG (( @@ -189,20 +183,11 @@ BuildMcfgTable ( TableSize =3D sizeof (MCFG_TABLE) + ((sizeof (MCFG_CFG_SPACE_ADDR) * ConfigurationSpaceCount)); =20 - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); - if (*Table =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: MCFG: Failed to allocate memory for MCFG Table, Size =3D %d,= " \ - " Status =3D %r\n", - TableSize, - Status - )); - goto error_handler; + Mcfg =3D AllocateZeroPool (TableSize); + if (Mcfg =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; } =20 - Mcfg =3D (MCFG_TABLE*)*Table; DEBUG (( DEBUG_INFO, "MCFG: Mcfg =3D 0x%p TableSize =3D 0x%x\n", @@ -212,30 +197,19 @@ BuildMcfgTable ( =20 Status =3D AddAcpiHeader (This, &Mcfg->Header, AcpiTableInfo, TableSize); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: MCFG: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 Mcfg->Reserved =3D EFI_ACPI_RESERVED_QWORD; =20 - AddPciConfigurationSpaceList ( - Mcfg, - sizeof (MCFG_TABLE), - PciConfigSpaceInfoList, - ConfigurationSpaceCount - ); + AddPciConfigurationSpaceList (Mcfg, sizeof (MCFG_TABLE)); + + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*) Mcfg; =20 return EFI_SUCCESS; =20 error_handler: - if (*Table !=3D NULL) { - FreePool (*Table); - *Table =3D NULL; - } + FreePool (Mcfg); return Status; } =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c index 99eb6e0929..0722b469f0 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c @@ -21,7 +21,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -39,56 +38,6 @@ - EArmObjGicCInfo (REQUIRED) */ =20 -/** - This macro expands to a function that retrieves the Processor Hierarchy - information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjProcHierarchyInfo, - CM_ARM_PROC_HIERARCHY_INFO - ); - -/** - This macro expands to a function that retrieves the cache information - from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjCacheInfo, - CM_ARM_CACHE_INFO - ); - -/** - This macro expands to a function that retrieves the ID information for - Processor Hierarchy Nodes from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjProcNodeIdInfo, - CM_ARM_PROC_NODE_ID_INFO - ); - -/** - This macro expands to a function that retrieves the cross-CM-object- - reference information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjCmRef, - CM_ARM_OBJ_REF - ); - -/** - This macro expands to a function that retrieves the GIC CPU interface - information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicCInfo, - CM_ARM_GICC_INFO - ); - /** Returns the size of the PPTT Processor Hierarchy Node (Type 0) given a Processor Hierarchy Info CM object. @@ -279,8 +228,6 @@ DetectCyclesInTopology ( Update the array of private resources for a given Processor Hierarchy No= de. =20 @param [in] Generator Pointer to the PPTT Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] PrivResArray Pointer to the array of private resour= ces. @param [in] PrivResCount Number of private resources. @param [in] PrivResArrayToken Reference Token for the CM_ARM_OBJ_REF @@ -294,20 +241,19 @@ STATIC EFI_STATUS AddPrivateResources ( IN CONST ACPI_PPTT_GENERATOR * CONST Generator, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN UINT32 * PrivResArray, IN UINT32 PrivResCount, IN CONST CM_OBJECT_TOKEN PrivResArrayTok= en ) { EFI_STATUS Status; - CM_ARM_OBJ_REF * CmObjRefs; + CM_ARM_OBJ_REF * Cursor; + VOID * CmObjRefs; UINT32 CmObjRefCount; PPTT_NODE_INDEXER * PpttNodeFound; =20 ASSERT ( (Generator !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && (PrivResArray !=3D NULL) && (PrivResCount !=3D 0) ); @@ -327,12 +273,8 @@ AddPrivateResources ( =20 CmObjRefCount =3D 0; // Get the CM Object References - Status =3D GetEArmObjCmRef ( - CfgMgrProtocol, - PrivResArrayToken, - &CmObjRefs, - &CmObjRefCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjCmRef, PrivResArrayToken, (VOID **)&CmObjRefs, &CmObjRefCount); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -356,11 +298,12 @@ AddPrivateResources ( PrivResArrayToken, Status )); - return Status; + goto EXIT; } =20 + Cursor =3D CmObjRefs; while (PrivResCount-- !=3D 0) { - if (CmObjRefs->ReferenceToken =3D=3D CM_NULL_TOKEN) { + if (Cursor->ReferenceToken =3D=3D CM_NULL_TOKEN) { Status =3D EFI_INVALID_PARAMETER; DEBUG (( DEBUG_ERROR, @@ -368,7 +311,7 @@ AddPrivateResources ( "private resource. Status =3D %r\n", Status )); - return Status; + goto EXIT; } =20 // The Node indexer has the Processor hierarchy nodes at the begining @@ -378,7 +321,7 @@ AddPrivateResources ( Generator->CacheStructIndexedList, (Generator->ProcTopologyStructCount - Generator->ProcHierarchyNodeCount), - CmObjRefs->ReferenceToken, + Cursor->ReferenceToken, &PpttNodeFound ); if (EFI_ERROR (Status)) { @@ -386,19 +329,21 @@ AddPrivateResources ( DEBUG_ERROR, "ERROR: PPTT: Failed to get a private resource with Token =3D %p f= rom " \ "Node Indexer. Status =3D %r\n", - CmObjRefs->ReferenceToken, + Cursor->ReferenceToken, Status )); - return Status; + goto EXIT; } =20 // Update the offset of the private resources in the Processor // Hierarchy Node structure *(PrivResArray++) =3D PpttNodeFound->Offset; - CmObjRefs++; + Cursor++; } =20 - return EFI_SUCCESS; +EXIT: + FreePool (CmObjRefs); + return Status; } =20 /** @@ -485,7 +430,6 @@ STATIC EFI_STATUS AddProcHierarchyNodes ( IN CONST ACPI_PPTT_GENERATOR * CONST Generator, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt, IN CONST UINT32 NodesStartOffset ) @@ -508,7 +452,6 @@ AddProcHierarchyNodes ( =20 ASSERT ( (Generator !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && (Pptt !=3D NULL) ); =20 @@ -533,6 +476,9 @@ AddProcHierarchyNodes ( =20 UniqueGicCRefCount =3D 0; =20 + // Pointers to allocated memory + GicCInfoList =3D NULL; + while (NodeCount-- !=3D 0) { ProcInfoNode =3D (CM_ARM_PROC_HIERARCHY_INFO*)ProcNodeIterator->Object; =20 @@ -632,12 +578,11 @@ AddProcHierarchyNodes ( )); return Status; } else { - Status =3D GetEArmObjGicCInfo ( - CfgMgrProtocol, - ProcInfoNode->GicCToken, - &GicCInfoList, - &GicCInfoCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjGicCInfo, + ProcInfoNode->GicCToken, + (VOID **)&GicCInfoList, + &GicCInfoCount); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -664,6 +609,7 @@ AddProcHierarchyNodes ( ProcInfoNode->Token, Status )); + FreePool (GicCInfoList); return Status; } =20 @@ -673,6 +619,7 @@ AddProcHierarchyNodes ( // Increment the reference count for the number of // Unique GICC objects that were retrieved. UniqueGicCRefCount++; + FreePool (GicCInfoList); } =20 ProcStruct->NumberOfPrivateResources =3D ProcInfoNode->NoOfPrivateReso= urces; @@ -683,7 +630,6 @@ AddProcHierarchyNodes ( // Populate the private resources array Status =3D AddPrivateResources ( Generator, - CfgMgrProtocol, PrivateResources, ProcStruct->NumberOfPrivateResources, ProcInfoNode->PrivateResourcesArrayToken @@ -707,18 +653,8 @@ AddProcHierarchyNodes ( =20 // Knowing the total number of GICC references made and that all GICC To= ken // references are unique, we can test if no GICC instances have been lef= t out. - Status =3D GetEArmObjGicCInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicCInfoList, - &GicCInfoCount - ); + Status =3D CfgMgrCountObjects (EArmObjGicCInfo, &GicCInfoCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to get GICC Info. Status =3D %r\n", - Status - )); return Status; } =20 @@ -749,8 +685,6 @@ AddProcHierarchyNodes ( the Configuration Manager and adds this information to the PPTT table. =20 @param [in] Generator Pointer to the PPTT Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Pptt Pointer to PPTT table structure. @param [in] NodesStartOffset Offset from the start of PPTT table to= the start of Cache Type Structures. @@ -763,7 +697,6 @@ STATIC EFI_STATUS AddCacheTypeStructures ( IN CONST ACPI_PPTT_GENERATOR * CONST Generator, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt, IN CONST UINT32 NodesStartOffset ) @@ -775,11 +708,8 @@ AddCacheTypeStructures ( PPTT_NODE_INDEXER * CacheNodeIterator; UINT32 NodeCount; =20 - ASSERT ( - (Generator !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && - (Pptt !=3D NULL) - ); + ASSERT (Generator !=3D NULL); + ASSERT (Pptt !=3D NULL); =20 CacheStruct =3D (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE*)((UINT8*)Pptt + NodesStartOffset); @@ -971,8 +901,6 @@ AddCacheTypeStructures ( the Configuration Manager and and adds this information to the PPTT tabl= e. =20 @param [in] Generator Pointer to the PPTT Generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Pptt Pointer to PPTT table structure. @param [in] NodesStartOffset Offset from the start of PPTT table to t= he start of ID Type Structures. @@ -985,7 +913,6 @@ STATIC EFI_STATUS AddIdTypeStructures ( IN CONST ACPI_PPTT_GENERATOR * CONST Generator, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt, IN CONST UINT32 NodesStartOffset ) @@ -998,7 +925,6 @@ AddIdTypeStructures ( =20 ASSERT ( (Generator !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && (Pptt !=3D NULL) ); =20 @@ -1074,10 +1000,7 @@ BuildPpttTable ( UINT32 CacheStructOffset; UINT32 IdStructOffset; =20 - CM_ARM_PROC_HIERARCHY_INFO * ProcHierarchyNodeList; - CM_ARM_CACHE_INFO * CacheStructList; - CM_ARM_PROC_NODE_ID_INFO * IdStructList; - + VOID * NodeList; ACPI_PPTT_GENERATOR * Generator; =20 // Pointer to the Node Indexer array @@ -1088,7 +1011,6 @@ BuildPpttTable ( ASSERT ( (This !=3D NULL) && (AcpiTableInfo !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && (Table !=3D NULL) && (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID) && (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignature) @@ -1108,23 +1030,12 @@ BuildPpttTable ( } =20 Generator =3D (ACPI_PPTT_GENERATOR*)This; - *Table =3D NULL; =20 // Get the processor hierarchy info and update the processor topology // structure count with Processor Hierarchy Nodes (Type 0) - Status =3D GetEArmObjProcHierarchyInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &ProcHierarchyNodeList, - &ProcHierarchyNodeCount - ); + Status =3D CfgMgrCountObjects (EArmObjProcHierarchyInfo, &ProcHierarchyN= odeCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to get processor hierarchy info. Status =3D %r\= n", - Status - )); - goto error_handler; + return Status; } =20 ProcTopologyStructCount =3D ProcHierarchyNodeCount; @@ -1132,19 +1043,9 @@ BuildPpttTable ( =20 // Get the cache info and update the processor topology structure count = with // Cache Type Structures (Type 1) - Status =3D GetEArmObjCacheInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &CacheStructList, - &CacheStructCount - ); + Status =3D CfgMgrCountObjects (EArmObjCacheInfo, &CacheStructCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to get cache info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 ProcTopologyStructCount +=3D CacheStructCount; @@ -1152,38 +1053,18 @@ BuildPpttTable ( =20 // Get the processor hierarchy node ID info and update the processor top= ology // structure count with ID Structures (Type 2) - Status =3D GetEArmObjProcNodeIdInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &IdStructList, - &IdStructCount - ); + Status =3D CfgMgrCountObjects (EArmObjProcNodeIdInfo, &IdStructCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to get processor hierarchy node ID info. " \ - "Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 ProcTopologyStructCount +=3D IdStructCount; Generator->IdStructCount =3D IdStructCount; =20 // Allocate Node Indexer array - NodeIndexer =3D (PPTT_NODE_INDEXER*)AllocateZeroPool ( - sizeof (PPTT_NODE_INDEXER) * - ProcTopologyStructCount - ); + NodeIndexer =3D AllocateZeroPool (sizeof (PPTT_NODE_INDEXER) * ProcTopol= ogyStructCount); if (NodeIndexer =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to allocate memory for Node Indexer. Status =3D= %r\n ", - Status - )); - goto error_handler; + return EFI_OUT_OF_RESOURCES; } =20 DEBUG ((DEBUG_INFO, "INFO: NodeIndexer =3D %p\n", NodeIndexer)); @@ -1197,12 +1078,14 @@ BuildPpttTable ( if (Generator->ProcHierarchyNodeCount !=3D 0) { ProcHierarchyNodeOffset =3D TableSize; Generator->ProcHierarchyNodeIndexedList =3D NodeIndexer; + + CfgMgrGetSimpleObject(EArmObjProcHierarchyInfo, &NodeList); TableSize +=3D GetSizeofProcHierarchyNodes ( - ProcHierarchyNodeOffset, - ProcHierarchyNodeList, - Generator->ProcHierarchyNodeCount, - &NodeIndexer - ); + ProcHierarchyNodeOffset, + NodeList, + Generator->ProcHierarchyNodeCount, + &NodeIndexer); + FreePool (NodeList); =20 DEBUG (( DEBUG_INFO, @@ -1220,33 +1103,32 @@ BuildPpttTable ( if (Generator->CacheStructCount !=3D 0) { CacheStructOffset =3D TableSize; Generator->CacheStructIndexedList =3D NodeIndexer; + + CfgMgrGetSimpleObject(EArmObjCacheInfo, &NodeList); TableSize +=3D GetSizeofCacheTypeStructs ( - CacheStructOffset, - CacheStructList, - Generator->CacheStructCount, - &NodeIndexer - ); - DEBUG (( - DEBUG_INFO, - " CacheStructCount =3D %d\n" \ - " CacheStructOffset =3D 0x%x\n" \ - " CacheStructIndexedList =3D 0x%p\n", - Generator->CacheStructCount, - CacheStructOffset, - Generator->CacheStructIndexedList - )); + CacheStructOffset, NodeList, Generator->CacheStructCount, &NodeIndex= er); + FreePool (NodeList); + + DEBUG ( + (DEBUG_INFO, + " CacheStructCount =3D %d\n" + " CacheStructOffset =3D 0x%x\n" + " CacheStructIndexedList =3D 0x%p\n", + Generator->CacheStructCount, + CacheStructOffset, + Generator->CacheStructIndexedList)); } =20 // Include the size of ID Type Structures and index them if (Generator->IdStructCount !=3D 0) { IdStructOffset =3D TableSize; Generator->IdStructIndexedList =3D NodeIndexer; + + CfgMgrGetSimpleObject (EArmObjProcNodeIdInfo, &NodeList); TableSize +=3D GetSizeofIdStructs ( - IdStructOffset, - IdStructList, - Generator->IdStructCount, - &NodeIndexer - ); + IdStructOffset, NodeList, Generator->IdStructCount, &NodeIndexer); + FreePool (NodeList); + DEBUG (( DEBUG_INFO, " IdStructCount =3D %d\n" \ @@ -1268,21 +1150,12 @@ BuildPpttTable ( )); =20 // Allocate the Buffer for the PPTT table - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); - if (*Table =3D=3D NULL) { + Pptt =3D AllocateZeroPool (TableSize); + if (Pptt =3D=3D NULL) { Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to allocate memory for PPTT Table. " \ - "Size =3D %d. Status =3D %r\n", - TableSize, - Status - )); goto error_handler; } =20 - Pptt =3D (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER*)*Tabl= e; - DEBUG (( DEBUG_INFO, "PPTT: Pptt =3D 0x%p. TableSize =3D 0x%x\n", @@ -1293,22 +1166,12 @@ BuildPpttTable ( // Add ACPI header Status =3D AddAcpiHeader (This, &Pptt->Header, AcpiTableInfo, TableSize); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: PPTT: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 // Add Processor Hierarchy Nodes (Type 0) to the generated table if (Generator->ProcHierarchyNodeCount !=3D 0) { - Status =3D AddProcHierarchyNodes ( - Generator, - CfgMgrProtocol, - Pptt, - ProcHierarchyNodeOffset - ); + Status =3D AddProcHierarchyNodes (Generator, Pptt, ProcHierarchyNodeOf= fset); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1321,12 +1184,7 @@ BuildPpttTable ( =20 // Add Cache Type Structures (Type 1) to the generated table if (Generator->CacheStructCount !=3D 0) { - Status =3D AddCacheTypeStructures ( - Generator, - CfgMgrProtocol, - Pptt, - CacheStructOffset - ); + Status =3D AddCacheTypeStructures (Generator, Pptt, CacheStructOffset); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1339,12 +1197,7 @@ BuildPpttTable ( =20 // Add ID Type Structures (Type 2) to the generated table if (Generator->IdStructCount !=3D 0) { - Status =3D AddIdTypeStructures ( - Generator, - CfgMgrProtocol, - Pptt, - IdStructOffset - ); + Status =3D AddIdTypeStructures (Generator, Pptt, IdStructOffset); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, @@ -1366,6 +1219,7 @@ BuildPpttTable ( goto error_handler; } =20 + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)Pptt; return Status; =20 error_handler: @@ -1374,9 +1228,8 @@ error_handler: Generator->NodeIndexer =3D NULL; } =20 - if (*Table !=3D NULL) { - FreePool (*Table); - *Table =3D NULL; + if (Pptt !=3D NULL) { + FreePool (Pptt); } =20 return Status; diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c= b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c index 2facfaa048..2a8e392d84 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c @@ -12,7 +12,6 @@ // Module specific include files. #include #include -#include #include #include =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c index 46f53f819a..0a7e9da96e 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c @@ -14,12 +14,12 @@ #include #include #include +#include #include =20 // Module specific include files. #include #include -#include #include #include =20 @@ -83,15 +83,6 @@ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE AcpiSpcr = =3D { =20 #pragma pack() =20 -/** This macro expands to a function that retrieves the Serial - Port Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjSerialConsolePortInfo, - CM_ARM_SERIAL_PORT_INFO - ) - /** Construct the SPCR ACPI table. =20 This function invokes the Configuration Manager protocol interface @@ -131,7 +122,6 @@ BuildSpcrTable ( =20 ASSERT (This !=3D NULL); ASSERT (AcpiTableInfo !=3D NULL); - ASSERT (CfgMgrProtocol !=3D NULL); ASSERT (Table !=3D NULL); ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); @@ -149,21 +139,10 @@ BuildSpcrTable ( return EFI_INVALID_PARAMETER; } =20 - *Table =3D NULL; - - Status =3D GetEArmObjSerialConsolePortInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &SerialPortInfo, - NULL - ); + Status =3D CfgMgrGetSimpleObject ( + EArmObjSerialConsolePortInfo, (VOID **)&SerialPortInfo); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SPCR: Failed to get serial port information. Status =3D %r\n= ", - Status - )); - goto error_handler; + return Status; } =20 if (SerialPortInfo->BaseAddress =3D=3D 0) { @@ -207,11 +186,6 @@ BuildSpcrTable ( AcpiTableInfo, sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE)); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SPCR: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 @@ -268,6 +242,7 @@ BuildSpcrTable ( *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr; =20 error_handler: + FreePool (SerialPortInfo); return Status; } =20 diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c index fda0837f32..28cc8f9e8e 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c @@ -21,7 +21,6 @@ // Module specific include files. #include #include -#include #include #include =20 @@ -38,65 +37,6 @@ - EArmObjDeviceHandlePci (OPTIONAL) */ =20 -/** This macro expands to a function that retrieves the GIC - CPU interface Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicCInfo, - CM_ARM_GICC_INFO - ); - -/** This macro expands to a function that retrieves the GIC - Interrupt Translation Service Information from the - Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGicItsInfo, - CM_ARM_GIC_ITS_INFO - ); - -/** - This macro expands to a function that retrieves the Memory Affinity - information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjMemoryAffinityInfo, - CM_ARM_MEMORY_AFFINITY_INFO - ); - -/** - This macro expands to a function that retrieves the Generic Initiator Af= finity - information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjGenericInitiatorAffinityInfo, - CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO - ); - -/** - This macro expands to a function that retrieves the ACPI Device Handle - information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjDeviceHandleAcpi, - CM_ARM_DEVICE_HANDLE_ACPI - ); - -/** - This macro expands to a function that retrieves the PCI Device Handle - information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjDeviceHandlePci, - CM_ARM_DEVICE_HANDLE_PCI - ); - =20 /** Return the PCI Device information in BDF format =20 @@ -123,147 +63,163 @@ GetBdf ( =20 /** Add the GICC Affinity Structures in the SRAT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Srat Pointer to the SRAT Table. @param [in] GicCAffOffset Offset of the GICC Affinity information in the SRAT Table. - @param [in] GicCInfo Pointer to the GIC CPU Information list. - @param [in] GicCCount Count of GIC CPU Interfaces. =20 @retval EFI_SUCCESS Table generated successfully. **/ STATIC EFI_STATUS AddGICCAffinity ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProt= ocol, IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat, - IN CONST UINT32 GicCAffOff= set, - IN CONST CM_ARM_GICC_INFO * GicCInfo, - IN UINT32 GicCCount + IN CONST UINT32 GicCAffOff= set ) { - EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE * GicCAff; + EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *GicCAff; + VOID *GicCInfo; + CM_ARM_GICC_INFO *Cursor; + UINT32 GicCCount; + EFI_STATUS Status; =20 ASSERT (Srat !=3D NULL); - ASSERT (GicCInfo !=3D NULL); + + Status =3D + CfgMgrGetObjects (EArmObjGicCInfo, CM_NULL_TOKEN, &GicCInfo, &GicCCoun= t); + if (EFI_ERROR (Status)) { + return Status; + } =20 GicCAff =3D (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *)((UINT8*)Srat + GicCAffOffset); =20 + Cursor =3D GicCInfo; while (GicCCount-- !=3D 0) { DEBUG ((DEBUG_INFO, "SRAT: GicCAff =3D 0x%p\n", GicCAff)); =20 GicCAff->Type =3D EFI_ACPI_6_3_GICC_AFFINITY; GicCAff->Length =3D sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE); - GicCAff->ProximityDomain =3D GicCInfo->ProximityDomain; - GicCAff->AcpiProcessorUid =3D GicCInfo->AcpiProcessorUid; - GicCAff->Flags =3D GicCInfo->AffinityFlags; - GicCAff->ClockDomain =3D GicCInfo->ClockDomain; + GicCAff->ProximityDomain =3D Cursor->ProximityDomain; + GicCAff->AcpiProcessorUid =3D Cursor->AcpiProcessorUid; + GicCAff->Flags =3D Cursor->AffinityFlags; + GicCAff->ClockDomain =3D Cursor->ClockDomain; =20 // Next GicCAff++; - GicCInfo++; + Cursor++; }// while + + FreePool (GicCInfo); return EFI_SUCCESS; } =20 /** Add the GIC ITS Affinity Structures in the SRAT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Srat Pointer to the SRAT Table. @param [in] GicItsAffOffset Offset of the GIC ITS Affinity information in the SRAT Table. - @param [in] GicItsInfo Pointer to the GIC ITS Information list. - @param [in] GicItsCount Count of GIC ITS. =20 @retval EFI_SUCCESS Table generated successfully. **/ STATIC EFI_STATUS AddGICItsAffinity ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProt= ocol, IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat, - IN CONST UINT32 GicItsAffO= ffset, - IN CONST CM_ARM_GIC_ITS_INFO * GicItsInfo, - IN UINT32 GicItsCount + IN CONST UINT32 GicItsAffO= ffset ) { - EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE * GicItsAff; + EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *GicItsAff; + CM_ARM_GIC_ITS_INFO *Cursor; + VOID *GicItsInfo; + UINT32 GicItsCount; + EFI_STATUS Status; =20 ASSERT (Srat !=3D NULL); - ASSERT (GicItsInfo !=3D NULL); + + Status =3D CfgMgrGetObjects ( + EArmObjGicItsInfo, CM_NULL_TOKEN, (VOID **)&GicItsInfo, &GicItsCount); + if (EFI_ERROR (Status)) { + return Status; + } =20 GicItsAff =3D (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *)((UINT8*)Srat + GicItsAffOffset); =20 + Cursor =3D GicItsInfo; while (GicItsCount-- !=3D 0) { DEBUG ((DEBUG_INFO, "SRAT: GicItsAff =3D 0x%p\n", GicItsAff)); =20 GicItsAff->Type =3D EFI_ACPI_6_3_GIC_ITS_AFFINITY; GicItsAff->Length =3D sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE); - GicItsAff->ProximityDomain =3D GicItsInfo->ProximityDomain; + GicItsAff->ProximityDomain =3D Cursor->ProximityDomain; GicItsAff->Reserved[0] =3D EFI_ACPI_RESERVED_BYTE; GicItsAff->Reserved[1] =3D EFI_ACPI_RESERVED_BYTE; - GicItsAff->ItsId =3D GicItsInfo->GicItsId; + GicItsAff->ItsId =3D Cursor->GicItsId; =20 // Next GicItsAff++; - GicItsInfo++; + Cursor++; }// while + + FreePool (GicItsInfo); return EFI_SUCCESS; } =20 /** Add the Memory Affinity Structures in the SRAT Table. =20 - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. @param [in] Srat Pointer to the SRAT Table. @param [in] MemAffOffset Offset of the Memory Affinity information in the SRAT Table. - @param [in] MemAffInfo Pointer to the Memory Affinity Information= list. - @param [in] MemAffCount Count of Memory Affinity objects. =20 @retval EFI_SUCCESS Table generated successfully. **/ STATIC EFI_STATUS AddMemoryAffinity ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProt= ocol, IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat, - IN CONST UINT32 MemAffOffs= et, - IN CONST CM_ARM_MEMORY_AFFINITY_INFO * MemAffInfo, - IN UINT32 MemAffCount + IN CONST UINT32 MemAffOffs= et ) { - EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE * MemAff; + EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE *MemAff; + CM_ARM_MEMORY_AFFINITY_INFO *Cursor; + VOID *MemAffInfo; + UINT32 MemAffCount; + EFI_STATUS Status; =20 ASSERT (Srat !=3D NULL); - ASSERT (MemAffInfo !=3D NULL); + + Status =3D CfgMgrGetObjects ( + EArmObjMemoryAffinityInfo, CM_NULL_TOKEN, &MemAffInfo, &MemAffCount); + if (EFI_ERROR (Status)) { + return Status; + } =20 MemAff =3D (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE *)((UINT8*)Srat + MemAffOffset); =20 + + Cursor =3D MemAffInfo; while (MemAffCount-- !=3D 0) { DEBUG ((DEBUG_INFO, "SRAT: MemAff =3D 0x%p\n", MemAff)); =20 MemAff->Type =3D EFI_ACPI_6_3_MEMORY_AFFINITY; MemAff->Length =3D sizeof (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE); - MemAff->ProximityDomain =3D MemAffInfo->ProximityDomain; + MemAff->ProximityDomain =3D Cursor->ProximityDomain; MemAff->Reserved1 =3D EFI_ACPI_RESERVED_WORD; - MemAff->AddressBaseLow =3D (UINT32)(MemAffInfo->BaseAddress & MAX_UINT= 32); - MemAff->AddressBaseHigh =3D (UINT32)(MemAffInfo->BaseAddress >> 32); - MemAff->LengthLow =3D (UINT32)(MemAffInfo->Length & MAX_UINT32); - MemAff->LengthHigh =3D (UINT32)(MemAffInfo->Length >> 32); + MemAff->AddressBaseLow =3D (UINT32)(Cursor->BaseAddress & MAX_UINT32); + MemAff->AddressBaseHigh =3D (UINT32)(Cursor->BaseAddress >> 32); + MemAff->LengthLow =3D (UINT32)(Cursor->Length & MAX_UINT32); + MemAff->LengthHigh =3D (UINT32)(Cursor->Length >> 32); MemAff->Reserved2 =3D EFI_ACPI_RESERVED_DWORD; - MemAff->Flags =3D MemAffInfo->Flags; + MemAff->Flags =3D Cursor->Flags; MemAff->Reserved3 =3D EFI_ACPI_RESERVED_QWORD; =20 // Next MemAff++; - MemAffInfo++; + Cursor++; }// while + + FreePool (MemAffInfo); return EFI_SUCCESS; } =20 @@ -290,11 +246,8 @@ AddMemoryAffinity ( STATIC EFI_STATUS AddGenericInitiatorAffinity ( - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProt= ocol, IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat, - IN CONST UINT32 GenInitAff= Off, - IN CONST CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO * GenInitAff= Info, - IN UINT32 GenInitAff= Count + IN CONST UINT32 GenInitAff= Off ) { EFI_STATUS Status; @@ -302,13 +255,25 @@ AddGenericInitiatorAffinity ( CM_ARM_DEVICE_HANDLE_ACPI * DeviceHandleAcp= i; CM_ARM_DEVICE_HANDLE_PCI * DeviceHandlePci; UINT32 DeviceHandleCou= nt; + CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO * Cursor; + VOID * GenInitAffInfo; + UINT32 GenInitAffCount; =20 ASSERT (Srat !=3D NULL); - ASSERT (GenInitAffInfo !=3D NULL); + + Status =3D CfgMgrGetObjects ( + EArmObjGenericInitiatorAffinityInfo, + CM_NULL_TOKEN, + &GenInitAffInfo, + &GenInitAffCount); + if (EFI_ERROR (Status)) { + return Status; + } =20 GenInitAff =3D (EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE *)( (UINT8*)Srat + GenInitAffOff); =20 + Cursor =3D GenInitAffInfo; while (GenInitAffCount-- !=3D 0) { DEBUG ((DEBUG_INFO, "SRAT: GenInitAff =3D 0x%p\n", GenInitAff)); =20 @@ -316,35 +281,35 @@ AddGenericInitiatorAffinity ( GenInitAff->Length =3D sizeof (EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE); GenInitAff->Reserved1 =3D EFI_ACPI_RESERVED_WORD; - GenInitAff->DeviceHandleType =3D GenInitAffInfo->DeviceHandleType; - GenInitAff->ProximityDomain =3D GenInitAffInfo->ProximityDomain; + GenInitAff->DeviceHandleType =3D Cursor->DeviceHandleType; + GenInitAff->ProximityDomain =3D Cursor->ProximityDomain; =20 - if (GenInitAffInfo->DeviceHandleToken =3D=3D CM_NULL_TOKEN) { + if (Cursor->DeviceHandleToken =3D=3D CM_NULL_TOKEN) { DEBUG (( DEBUG_ERROR, "ERROR: SRAT: Invalid Device Handle Token.\n" )); ASSERT (0); - return EFI_INVALID_PARAMETER; + Status =3D EFI_INVALID_PARAMETER; + goto EXIT; } =20 - if (GenInitAffInfo->DeviceHandleType =3D=3D EFI_ACPI_6_3_ACPI_DEVICE_H= ANDLE) { - Status =3D GetEArmObjDeviceHandleAcpi ( - CfgMgrProtocol, - GenInitAffInfo->DeviceHandleToken, - &DeviceHandleAcpi, - &DeviceHandleCount - ); + if (Cursor->DeviceHandleType =3D=3D EFI_ACPI_6_3_ACPI_DEVICE_HANDLE) { + Status =3D CfgMgrGetObjects ( + EArmObjDeviceHandleAcpi, + Cursor->DeviceHandleToken, + (VOID **) &DeviceHandleAcpi, + &DeviceHandleCount); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, "ERROR: SRAT: Failed to get ACPI Device Handle Inf." " DeviceHandleToken =3D %p." " Status =3D %r\n", - GenInitAffInfo->DeviceHandleToken, + Cursor->DeviceHandleToken, Status )); - return Status; + goto EXIT; } =20 // We are expecting only one device handle. @@ -357,24 +322,24 @@ AddGenericInitiatorAffinity ( GenInitAff->DeviceHandle.Acpi.Reserved[1] =3D EFI_ACPI_RESERVED_BYTE; GenInitAff->DeviceHandle.Acpi.Reserved[2] =3D EFI_ACPI_RESERVED_BYTE; GenInitAff->DeviceHandle.Acpi.Reserved[3] =3D EFI_ACPI_RESERVED_BYTE; - } else if (GenInitAffInfo->DeviceHandleType =3D=3D + FreePool (DeviceHandleAcpi); + } else if (Cursor->DeviceHandleType =3D=3D EFI_ACPI_6_3_PCI_DEVICE_HANDLE) { - Status =3D GetEArmObjDeviceHandlePci ( - CfgMgrProtocol, - GenInitAffInfo->DeviceHandleToken, - &DeviceHandlePci, - &DeviceHandleCount - ); + Status =3D CfgMgrGetObjects ( + EArmObjDeviceHandlePci, + Cursor->DeviceHandleToken, + (VOID **) &DeviceHandlePci, + &DeviceHandleCount); if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, "ERROR: SRAT: Failed to get ACPI Device Handle Inf." " DeviceHandleToken =3D %p." " Status =3D %r\n", - GenInitAffInfo->DeviceHandleToken, + Cursor->DeviceHandleToken, Status )); - return Status; + goto EXIT; } =20 // We are expecting only one device handle @@ -384,6 +349,8 @@ AddGenericInitiatorAffinity ( GenInitAff->DeviceHandle.Pci.PciSegment =3D DeviceHandlePci->Segment= Number; GenInitAff->DeviceHandle.Pci.PciBdfNumber =3D GetBdf (DeviceHandlePc= i); =20 + FreePool (DeviceHandlePci); + GenInitAff->DeviceHandle.Pci.Reserved[0] =3D EFI_ACPI_RESERVED_BYTE; GenInitAff->DeviceHandle.Pci.Reserved[1] =3D EFI_ACPI_RESERVED_BYTE; GenInitAff->DeviceHandle.Pci.Reserved[2] =3D EFI_ACPI_RESERVED_BYTE; @@ -405,15 +372,18 @@ AddGenericInitiatorAffinity ( return EFI_INVALID_PARAMETER; } =20 - GenInitAff->Flags =3D GenInitAffInfo->Flags; + GenInitAff->Flags =3D Cursor->Flags; GenInitAff->Reserved2[0] =3D EFI_ACPI_RESERVED_BYTE; GenInitAff->Reserved2[1] =3D EFI_ACPI_RESERVED_BYTE; =20 // Next GenInitAff++; - GenInitAffInfo++; + Cursor++; }// while - return EFI_SUCCESS; + +EXIT: + FreePool (GenInitAffInfo); + return Status; } =20 /** Construct the SRAT ACPI table. @@ -450,6 +420,7 @@ BuildSratTable ( ) { EFI_STATUS Status; + UINT32 TableSize; UINT32 GicCCount; UINT32 GicItsCount; @@ -461,21 +432,13 @@ BuildSratTable ( UINT32 MemAffOffset; UINT32 GenInitiatorAffOffset; =20 - CM_ARM_GICC_INFO * GicCInfo; - CM_ARM_GIC_ITS_INFO * GicItsInfo; - CM_ARM_MEMORY_AFFINITY_INFO * MemAffInfo; - CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO * GenInitiatorAffInfo; - EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * Srat; =20 - ASSERT ( - (This !=3D NULL) && - (AcpiTableInfo !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && - (Table !=3D NULL) && - (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID) && - (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignature) - ); + ASSERT (This !=3D NULL); + ASSERT (AcpiTableInfo !=3D NULL); + ASSERT (Table !=3D NULL); + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); + ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); =20 if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { @@ -490,21 +453,9 @@ BuildSratTable ( return EFI_INVALID_PARAMETER; } =20 - *Table =3D NULL; - - Status =3D GetEArmObjGicCInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicCInfo, - &GicCCount - ); + Status =3D CfgMgrCountObjects (EArmObjGicCInfo, &GicCCount); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to get GICC Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 if (GicCCount =3D=3D 0) { @@ -513,54 +464,23 @@ BuildSratTable ( "ERROR: SRAT: GIC CPU Interface information not provided.\n" )); ASSERT (0); - Status =3D EFI_INVALID_PARAMETER; - goto error_handler; + return EFI_INVALID_PARAMETER; } =20 - Status =3D GetEArmObjGicItsInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicItsInfo, - &GicItsCount - ); + Status =3D CfgMgrCountObjects (EArmObjGicItsInfo, &GicItsCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to get GIC ITS Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 - Status =3D GetEArmObjMemoryAffinityInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &MemAffInfo, - &MemAffCount - ); + Status =3D CfgMgrCountObjects (EArmObjMemoryAffinityInfo, &MemAffCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to get Memory Affinity Info. Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 - Status =3D GetEArmObjGenericInitiatorAffinityInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GenInitiatorAffInfo, - &GenInitiatorAffCount - ); + Status =3D CfgMgrCountObjects ( + EArmObjGenericInitiatorAffinityInfo, &GenInitiatorAffCount); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to get Generic Initiator Affinity Info." - " Status =3D %r\n", - Status - )); - goto error_handler; + return Status; } =20 // Calculate the size of the SRAT table @@ -588,35 +508,15 @@ BuildSratTable ( } =20 // Allocate the Buffer for SRAT table - *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); - if (*Table =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to allocate memory for SRAT Table, Size =3D %d,= " \ - " Status =3D %r\n", - TableSize, - Status - )); - goto error_handler; + Srat =3D AllocateZeroPool (TableSize); + if (Srat =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; } =20 - Srat =3D (EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER*)*Table; - - DEBUG (( - DEBUG_INFO, - "SRAT: Srat =3D 0x%p TableSize =3D 0x%x\n", - Srat, - TableSize - )); + DEBUG ((DEBUG_INFO, "SRAT: Srat =3D 0x%p TableSize =3D 0x%x\n", Srat, Ta= bleSize)); =20 Status =3D AddAcpiHeader (This, &Srat->Header, AcpiTableInfo, TableSize); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to add ACPI header. Status =3D %r\n", - Status - )); goto error_handler; } =20 @@ -625,86 +525,33 @@ BuildSratTable ( Srat->Reserved1 =3D 1; Srat->Reserved2 =3D EFI_ACPI_RESERVED_QWORD; =20 - Status =3D AddGICCAffinity ( - CfgMgrProtocol, - Srat, - GicCAffOffset, - GicCInfo, - GicCCount - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to add GICC Affinity structures. Status =3D %r\= n", - Status - )); - goto error_handler; - } + AddGICCAffinity (Srat, GicCAffOffset); =20 if (GicItsCount !=3D 0) { - Status =3D AddGICItsAffinity ( - CfgMgrProtocol, - Srat, - GicItsAffOffset, - GicItsInfo, - GicItsCount - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to add GIC ITS Affinity structures. Status = =3D %r\n", - Status - )); - goto error_handler; - } + AddGICItsAffinity (Srat, GicItsAffOffset); } =20 if (MemAffCount !=3D 0) { - Status =3D AddMemoryAffinity ( - CfgMgrProtocol, - Srat, - MemAffOffset, - MemAffInfo, - MemAffCount - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to add Memory Affinity structures. Status =3D= %r\n", - Status - )); - goto error_handler; - } + AddMemoryAffinity (Srat, MemAffOffset); } =20 if (GenInitiatorAffCount !=3D 0) { - Status =3D AddGenericInitiatorAffinity ( - CfgMgrProtocol, - Srat, - GenInitiatorAffOffset, - GenInitiatorAffInfo, - GenInitiatorAffCount - ); + Status =3D AddGenericInitiatorAffinity (Srat, GenInitiatorAffOffset); if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: SRAT: Failed to add Generic Initiator Affinity structures." - " Status =3D %r\n", - Status - )); + DEBUG ( + (DEBUG_ERROR, + "ERROR: SRAT: Failed to add Generic Initiator Affinity structures= ." + " Status =3D %r\n", + Status)); goto error_handler; } } =20 + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)Srat; return Status; =20 error_handler: - - if (*Table !=3D NULL) { - FreePool (*Table); - *Table =3D NULL; - } - + FreePool (Srat); return Status; } =20 @@ -728,13 +575,11 @@ FreeSratTableResources ( IN OUT EFI_ACPI_DESCRIPTION_HEADER ** CONST Table ) { - ASSERT ( - (This !=3D NULL) && - (AcpiTableInfo !=3D NULL) && - (CfgMgrProtocol !=3D NULL) && - (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID) && - (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignature) - ); + ASSERT (This !=3D NULL); + ASSERT (AcpiTableInfo !=3D NULL); + ASSERT (CfgMgrProtocol !=3D NULL); + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); + ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignatur= e); =20 if ((Table =3D=3D NULL) || (*Table =3D=3D NULL)) { DEBUG ((DEBUG_ERROR, "ERROR: SRAT: Invalid Table Pointer\n")); --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#63587): https://edk2.groups.io/g/devel/message/63587 Mute This Topic: https://groups.io/mt/75910574/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-