From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 98114D811B1 for ; Thu, 21 Mar 2024 15:54:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cni5slxwVEx8l2TjcPQucE5SpS2KEKjhhS6xkaUVRDI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1711036453; v=1; b=DDb8dXsEYsnI1jQlxJTSsmapfWM6Us1Cw83ZZYQMEnbYLtm6w+lAF4M3OTm/j9t3RCHeYk8r nm06RXQLVGxDCPWMFuRE9P8L1X//TGgO2knqjvRU4aaUcSfk9lvg8UOC95WEYG089KD5Va1r2V3 BP9UUGstJAaZrspq2Ns7ss7xF+2EJXA6CcxIx7Fqr8y708gVW6wG3PdMEWDsGdk7BkV76CSPNUK mmi6wR9KwmMeTUbdIfoPT0il8zBv31lRpjYsvICDCK2DETK6ll38WwMU3JGHqYanWtzQAI8A4is snhbf1+qKrlzwrZiDupfVGSjQ4yBQHJ0uPxslZJP6lHWQ== X-Received: by 127.0.0.2 with SMTP id ZSywYY7687511xgN1x3GkfdO; Thu, 21 Mar 2024 08:54:13 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.383.1711036452630194537 for ; Thu, 21 Mar 2024 08:54:12 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 931C31063; Thu, 21 Mar 2024 08:54:46 -0700 (PDT) X-Received: from e126645.nice.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EED2F3F67D; Thu, 21 Mar 2024 08:54:09 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Pierre Gondois , Sami Mujawar , Pierre Gondois , Yeo Reum Yun , Sunil V L , AbdulLateef Attar , Jeshua Smith , Jeff Brasen , Girish Mahadevan , Leif Lindholm , Meenakshi Aggarwal Subject: [edk2-devel] [PATCH 07/16] DynamicTablesPkg: Update DynamicPlatRepo for Arch Common namespace Date: Thu, 21 Mar 2024 16:53:10 +0100 Message-Id: <20240321155319.701355-8-pierre.gondois@arm.com> In-Reply-To: <20240321155319.701355-1-pierre.gondois@arm.com> References: <20240321155319.701355-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 21 Mar 2024 08:54:12 -0700 Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: SQ2iGSP67uHC4ZZ6vOep3xaAx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=DDb8dXsE; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) From: Sami Mujawar Update DynamicPlatRepo to reflect the introduction of the Arch Common namespace. Also, update the TokenFixer map to reflect the current state of the ArmNamespace Objects and add a note in the documentation header for the EARM_OBJECT_ID enum, that the Token fixer map needs updating whenever the ArmObjectId space is updated. Cc: Pierre Gondois Cc: Yeo Reum Yun Cc: AbdulLateef Attar Cc: Jeshua Smith Cc: Jeff Brasen Cc: Girish Mahadevan Cc: Leif Lindholm Cc: Meenakshi Aggarwal Signed-off-by: Sami Mujawar Signed-off-by: Pierre Gondois --- .../Include/ArmNameSpaceObjects.h | 6 + .../DynamicPlatRepoLib/CmObjectTokenFixer.c | 11 + .../DynamicPlatRepoLib/DynamicPlatRepo.c | 287 +++++++++++++----- .../DynamicPlatRepoInternal.h | 11 +- 4 files changed, 240 insertions(+), 75 deletions(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index 4a419a8fcd95..853d722b8c79 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -20,6 +20,12 @@ =0D /** The EARM_OBJECT_ID enum describes the Object IDs=0D in the ARM Namespace=0D +=0D + Note: Whenever an entry in this enum is updated,=0D + the following data structures must also be=0D + updated:=0D + - CM_OBJECT_TOKEN_FIXER TokenFixer[] in=0D + Library\Common\DynamicPlatRepoLib\CmObjectTokenFixer.c=0D */=0D typedef enum ArmObjectID {=0D EArmObjReserved, ///< 0 - R= eserved=0D diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTok= enFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectToke= nFixer.c index bbbb81ea31b0..df9452efe5bb 100644 --- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer= .c +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer= .c @@ -183,6 +183,17 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] =3D { NULL, ///< 37 - Lpi Info=0D NULL, ///< 38 - Pci Address Map Info=0D NULL, ///< 39 - Pci Interrupt Map Info=0D + NULL, ///< 40 - Reserved Memory Range Node=0D + NULL, ///< 41 - Memory Range Descriptor=0D + NULL, ///< 42 - Continuous Performance Contr= ol Info=0D + NULL, ///< 43 - Pcc Subspace Type 0 Info=0D + NULL, ///< 44 - Pcc Subspace Type 2 Info=0D + NULL, ///< 45 - Pcc Subspace Type 2 Info=0D + NULL, ///< 46 - Pcc Subspace Type 3 Info=0D + NULL, ///< 47 - Pcc Subspace Type 4 Info=0D + NULL, ///< 48 - Pcc Subspace Type 5 Info=0D + NULL, ///< 49 - Embedded Trace Extension/Mod= ule Info=0D + NULL ///< 50 - P-State Dependency (PSD) Inf= o=0D };=0D =0D /** CmObj token fixer.=0D diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlat= Repo.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo= .c index bdeb5c78aeb3..e4fa1233708e 100644 --- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo.c +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo.c @@ -127,10 +127,12 @@ DynPlatRepoAddObject ( OUT CM_OBJECT_TOKEN *Token OPTIONAL=0D )=0D {=0D - EFI_STATUS Status;=0D - CM_OBJ_NODE *ObjNode;=0D - CM_OBJECT_ID ArmNamespaceObjId;=0D - CM_OBJECT_TOKEN NewToken;=0D + EFI_STATUS Status;=0D + CM_OBJ_NODE *ObjNode;=0D + CM_OBJECT_ID ObjId;=0D + CM_OBJECT_TOKEN NewToken;=0D + LIST_ENTRY *ObjList;=0D + EOBJECT_NAMESPACE_ID NamespaceId;=0D =0D // The dynamic repository must be able to receive objects.=0D if ((This =3D=3D NULL) ||=0D @@ -142,15 +144,33 @@ DynPlatRepoAddObject ( }=0D =0D // Check the CmObjDesc:=0D - // - only Arm objects are supported for now.=0D + // - only Arm objects and Arch Common objects are supported for now.=0D // - only EArmObjCmRef objects can be added as arrays.=0D - ArmNamespaceObjId =3D GET_CM_OBJECT_ID (CmObjDesc->ObjectId);=0D - if ((CmObjDesc->Size =3D=3D 0) ||=0D - (CmObjDesc->Count =3D=3D 0) ||=0D - (ArmNamespaceObjId >=3D EArmObjMax) ||=0D - ((CmObjDesc->Count > 1) && (ArmNamespaceObjId !=3D EArmObjCmRef)) = ||=0D - (GET_CM_NAMESPACE_ID (CmObjDesc->ObjectId) !=3D EObjNameSpaceArm))=0D - {=0D + if ((CmObjDesc->Size =3D=3D 0) || (CmObjDesc->Count =3D=3D 0)) {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + ObjId =3D GET_CM_OBJECT_ID (CmObjDesc->ObjectId);=0D + NamespaceId =3D GET_CM_NAMESPACE_ID (CmObjDesc->ObjectId);=0D +=0D + if (EObjNameSpaceArm =3D=3D NamespaceId) {=0D + if ((ObjId >=3D EArmObjMax) ||=0D + ((CmObjDesc->Count > 1) && (ObjId !=3D EArmObjCmRef)))=0D + {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + ObjList =3D &This->ArmCmObjList[ObjId];=0D + } else if (EObjNameSpaceArchCommon =3D=3D NamespaceId) {=0D + if (ObjId >=3D EArchCommonObjMax) {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + ObjList =3D &This->ArchCommonCmObjList[ObjId];=0D + } else {=0D ASSERT (0);=0D return EFI_INVALID_PARAMETER;=0D }=0D @@ -166,15 +186,17 @@ DynPlatRepoAddObject ( }=0D =0D // Fixup self-token if necessary.=0D - Status =3D FixupCmObjectSelfToken (&ObjNode->CmObjDesc, NewToken);=0D - if (EFI_ERROR (Status)) {=0D - FreeCmObjNode (ObjNode);=0D - ASSERT (0);=0D - return Status;=0D + if (EObjNameSpaceArm =3D=3D NamespaceId) {=0D + Status =3D FixupCmObjectSelfToken (&ObjNode->CmObjDesc, NewToken);=0D + if (EFI_ERROR (Status)) {=0D + FreeCmObjNode (ObjNode);=0D + ASSERT (0);=0D + return Status;=0D + }=0D }=0D =0D // Add to link list.=0D - InsertTailList (&This->ArmCmObjList[ArmNamespaceObjId], &ObjNode->Link);= =0D + InsertTailList (ObjList, &ObjNode->Link);=0D This->ObjectCount +=3D 1;=0D =0D if (Token !=3D NULL) {=0D @@ -184,11 +206,14 @@ DynPlatRepoAddObject ( return EFI_SUCCESS;=0D }=0D =0D -/** Group lists of CmObjNode from the ArmNameSpace to one array.=0D +/** Group lists of CmObjNode from the Arm Namespace or ArchCommon namespac= e=0D + to one array.=0D =0D @param [in] This This dynamic platform repository.=0D - @param [in] ArmObjIndex Index in EARM_OBJECT_ID=0D - (must be < EArmObjMax).=0D + @param [in] NamespaceId The namespace ID which can be EObjNameSpaceArm= or=0D + EObjNameSpaceArchCommon.=0D + @param [in] ObjIndex Index in EARM_OBJECT_ID (must be < EArmObjMax)= or=0D + EARCH_COMMON_OBJECT_ID (must be =3D EArmObjMax))=0D - {=0D + if (This =3D=3D NULL) {=0D ASSERT (0);=0D return EFI_INVALID_PARAMETER;=0D }=0D =0D - Count =3D 0;=0D - Size =3D 0;=0D - CmObjId =3D CREATE_CM_ARM_OBJECT_ID (ArmObjIndex);=0D - ListHead =3D &This->ArmCmObjList[ArmObjIndex];=0D - Link =3D GetFirstNode (ListHead);=0D + if (NamespaceId =3D=3D EObjNameSpaceArm) {=0D + if (ObjIndex >=3D EArmObjMax) {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + ListHead =3D &This->ArmCmObjList[ObjIndex];=0D + ObjArray =3D &This->ArmCmObjArray[ObjIndex];=0D + } else if (NamespaceId =3D=3D EObjNameSpaceArchCommon) {=0D + if (ObjIndex >=3D EArchCommonObjMax) {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + ListHead =3D &This->ArchCommonCmObjList[ObjIndex];=0D + ObjArray =3D &This->ArchCommonCmObjArray[ObjIndex];=0D + } else {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Count =3D 0;=0D + Size =3D 0;=0D + CmObjId =3D CREATE_CM_OBJECT_ID (NamespaceId, ObjIndex);=0D + Link =3D GetFirstNode (ListHead);=0D =0D // Compute the total count and size of the CmObj in the list.=0D while (Link !=3D ListHead) {=0D @@ -235,7 +280,10 @@ GroupCmObjNodes ( return EFI_INVALID_PARAMETER;=0D }=0D =0D - if ((CmObjDesc->Count !=3D 1) && (ArmObjIndex !=3D EArmObjCmRef)) {=0D + if ((CmObjDesc->Count !=3D 1) &&=0D + ((NamespaceId !=3D EObjNameSpaceArm) ||=0D + (ObjIndex !=3D EArmObjCmRef)))=0D + {=0D // We expect each descriptor to contain an individual object.=0D // EArmObjCmRef objects are counted as groups, so +1 as well.=0D ASSERT (0);=0D @@ -286,7 +334,7 @@ GroupCmObjNodes ( Link =3D GetNextNode (ListHead, Link);=0D } // while=0D =0D - CmObjDesc =3D &This->ArmCmObjArray[ArmObjIndex];=0D + CmObjDesc =3D ObjArray;=0D CmObjDesc->ObjectId =3D CmObjId;=0D CmObjDesc->Size =3D (UINT32)Size;=0D CmObjDesc->Count =3D (UINT32)Count;=0D @@ -317,7 +365,7 @@ DynamicPlatRepoFinalise ( )=0D {=0D EFI_STATUS Status;=0D - UINTN ArmObjIndex;=0D + UINTN ObjIndex;=0D =0D if ((This =3D=3D NULL) ||=0D (This->RepoState !=3D DynRepoTransient))=0D @@ -340,18 +388,29 @@ DynamicPlatRepoFinalise ( // - Convert the list of nodes to an array=0D // (the array is wrapped in a CmObjDesc).=0D // - Add the Token/CmObj binding to the token mapper.=0D - for (ArmObjIndex =3D 0; ArmObjIndex < EArmObjMax; ArmObjIndex++) {=0D - Status =3D GroupCmObjNodes (This, (UINT32)ArmObjIndex);=0D + for (ObjIndex =3D 0; ObjIndex < EArmObjMax; ObjIndex++) {=0D + Status =3D GroupCmObjNodes (This, EObjNameSpaceArm, (UINT32)ObjIndex);= =0D if (EFI_ERROR (Status)) {=0D ASSERT (0);=0D - // Free the TokenMapper.=0D - // Ignore the returned Status since we already failed.=0D - TokenMapperShutdown (&This->TokenMapper);=0D - return Status;=0D + goto error_handler;=0D + }=0D + } // for=0D +=0D + for (ObjIndex =3D 0; ObjIndex < EArchCommonObjMax; ObjIndex++) {=0D + Status =3D GroupCmObjNodes (This, EObjNameSpaceArchCommon, (UINT32)Obj= Index);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + goto error_handler;=0D }=0D } // for=0D =0D return EFI_SUCCESS;=0D +=0D +error_handler:=0D + // Free the TokenMapper.=0D + // Ignore the returned Status since we already failed.=0D + TokenMapperShutdown (&This->TokenMapper);=0D + return Status;=0D }=0D =0D /** Get a CmObj from the dynamic repository.=0D @@ -376,9 +435,10 @@ DynamicPlatRepoGetObject ( IN OUT CM_OBJ_DESCRIPTOR *CmObjDesc=0D )=0D {=0D - EFI_STATUS Status;=0D - CM_OBJ_DESCRIPTOR *Desc;=0D - CM_OBJECT_ID ArmNamespaceObjId;=0D + EFI_STATUS Status;=0D + CM_OBJ_DESCRIPTOR *Desc;=0D + CM_OBJECT_ID ObjId;=0D + EOBJECT_NAMESPACE_ID NamespaceId;=0D =0D if ((This =3D=3D NULL) ||=0D (CmObjDesc =3D=3D NULL) ||=0D @@ -388,8 +448,28 @@ DynamicPlatRepoGetObject ( return EFI_INVALID_PARAMETER;=0D }=0D =0D - ArmNamespaceObjId =3D GET_CM_OBJECT_ID (CmObjectId);=0D - if (ArmNamespaceObjId >=3D EArmObjMax) {=0D + NamespaceId =3D GET_CM_NAMESPACE_ID (CmObjectId);=0D + ObjId =3D GET_CM_OBJECT_ID (CmObjectId);=0D +=0D + if (NamespaceId =3D=3D EObjNameSpaceArm) {=0D + if ((ObjId >=3D EArmObjMax) ||=0D + ((ObjId =3D=3D EArmObjCmRef) &&=0D + (Token =3D=3D CM_NULL_TOKEN)))=0D + {=0D + // EArmObjCmRef object must be requested using a valid token.=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Desc =3D &This->ArmCmObjArray[ObjId];=0D + } else if (NamespaceId =3D=3D EObjNameSpaceArchCommon) {=0D + if (ObjId >=3D EArchCommonObjMax) {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Desc =3D &This->ArchCommonCmObjArray[ObjId];=0D + } else {=0D ASSERT (0);=0D return EFI_INVALID_PARAMETER;=0D }=0D @@ -406,14 +486,6 @@ DynamicPlatRepoGetObject ( return Status;=0D }=0D =0D - if (ArmNamespaceObjId =3D=3D EArmObjCmRef) {=0D - // EArmObjCmRef object must be requested using a valid token.=0D - ASSERT (0);=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - Desc =3D &This->ArmCmObjArray[ArmNamespaceObjId];=0D -=0D // Nothing here.=0D if (Desc->Count =3D=3D 0) {=0D return EFI_NOT_FOUND;=0D @@ -462,6 +534,10 @@ DynamicPlatRepoInit ( InitializeListHead (&Repo->ArmCmObjList[Index]);=0D }=0D =0D + for (Index =3D 0; Index < EArchCommonObjMax; Index++) {=0D + InitializeListHead (&Repo->ArchCommonCmObjList[Index]);=0D + }=0D +=0D Repo->ObjectCount =3D 0;=0D Repo->RepoState =3D DynRepoTransient;=0D =0D @@ -470,6 +546,88 @@ DynamicPlatRepoInit ( return EFI_SUCCESS;=0D }=0D =0D +/** Free Arm Namespace objects.=0D +=0D + Free all the memory allocated for the Arm namespace objects in the=0D + dynamic platform repository.=0D +=0D + @param [in] DynPlatRepo The dynamic platform repository.=0D +=0D +**/=0D +STATIC=0D +VOID=0D +EFIAPI=0D +DynamicPlatRepoFreeArmObjects (=0D + IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo=0D + )=0D +{=0D + UINT32 Index;=0D + LIST_ENTRY *ListHead;=0D + CM_OBJ_DESCRIPTOR *CmObjDesc;=0D + VOID *Data;=0D +=0D + ASSERT (DynPlatRepo !=3D NULL);=0D +=0D + // Free the list of objects.=0D + for (Index =3D 0; Index < EArmObjMax; Index++) {=0D + // Free all the nodes with this object Id.=0D + ListHead =3D &DynPlatRepo->ArmCmObjList[Index];=0D + while (!IsListEmpty (ListHead)) {=0D + FreeCmObjNode ((CM_OBJ_NODE *)GetFirstNode (ListHead));=0D + } // while=0D + } // for=0D +=0D + // Free the arrays.=0D + CmObjDesc =3D DynPlatRepo->ArmCmObjArray;=0D + for (Index =3D 0; Index < EArmObjMax; Index++) {=0D + Data =3D CmObjDesc[Index].Data;=0D + if (Data !=3D NULL) {=0D + FreePool (Data);=0D + }=0D + } // for=0D +}=0D +=0D +/** Free Arch Common Namespace objects.=0D +=0D + Free all the memory allocated for the Arch Common namespace objects in t= he=0D + dynamic platform repository.=0D +=0D + @param [in] DynPlatRepo The dynamic platform repository.=0D +=0D +**/=0D +STATIC=0D +VOID=0D +EFIAPI=0D +DynamicPlatRepoFreeArchCommonObjects (=0D + IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo=0D + )=0D +{=0D + UINT32 Index;=0D + LIST_ENTRY *ListHead;=0D + CM_OBJ_DESCRIPTOR *CmObjDesc;=0D + VOID *Data;=0D +=0D + ASSERT (DynPlatRepo !=3D NULL);=0D +=0D + // Free the list of objects.=0D + for (Index =3D 0; Index < EArchCommonObjMax; Index++) {=0D + // Free all the nodes with this object Id.=0D + ListHead =3D &DynPlatRepo->ArchCommonCmObjList[Index];=0D + while (!IsListEmpty (ListHead)) {=0D + FreeCmObjNode ((CM_OBJ_NODE *)GetFirstNode (ListHead));=0D + } // while=0D + } // for=0D +=0D + // Free the arrays.=0D + CmObjDesc =3D DynPlatRepo->ArchCommonCmObjArray;=0D + for (Index =3D 0; Index < EArchCommonObjMax; Index++) {=0D + Data =3D CmObjDesc[Index].Data;=0D + if (Data !=3D NULL) {=0D + FreePool (Data);=0D + }=0D + } // for=0D +}=0D +=0D /** Shutdown the dynamic platform repository.=0D =0D Free all the memory allocated for the dynamic platform repository.=0D @@ -485,34 +643,15 @@ DynamicPlatRepoShutdown ( IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo=0D )=0D {=0D - EFI_STATUS Status;=0D - UINT32 Index;=0D - LIST_ENTRY *ListHead;=0D - CM_OBJ_DESCRIPTOR *CmObjDesc;=0D - VOID *Data;=0D + EFI_STATUS Status;=0D =0D if (DynPlatRepo =3D=3D NULL) {=0D ASSERT (0);=0D return EFI_INVALID_PARAMETER;=0D }=0D =0D - // Free the list of objects.=0D - for (Index =3D 0; Index < EArmObjMax; Index++) {=0D - // Free all the nodes with this object Id.=0D - ListHead =3D &DynPlatRepo->ArmCmObjList[Index];=0D - while (!IsListEmpty (ListHead)) {=0D - FreeCmObjNode ((CM_OBJ_NODE *)GetFirstNode (ListHead));=0D - } // while=0D - } // for=0D -=0D - // Free the arrays.=0D - CmObjDesc =3D DynPlatRepo->ArmCmObjArray;=0D - for (Index =3D 0; Index < EArmObjMax; Index++) {=0D - Data =3D CmObjDesc[Index].Data;=0D - if (Data !=3D NULL) {=0D - FreePool (Data);=0D - }=0D - } // for=0D + DynamicPlatRepoFreeArmObjects (DynPlatRepo);=0D + DynamicPlatRepoFreeArchCommonObjects (DynPlatRepo);=0D =0D // Free the TokenMapper=0D Status =3D TokenMapperShutdown (&DynPlatRepo->TokenMapper);=0D diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlat= RepoInternal.h b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/Dynamic= PlatRepoInternal.h index eaee5d4ce9d9..0c842bc2d535 100644 --- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInt= ernal.h +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInt= ernal.h @@ -67,7 +67,16 @@ typedef struct DynamicPlatformRepositoryInfo { /// This array is populated when the Repo is finalized.=0D CM_OBJ_DESCRIPTOR ArmCmObjArray[EArmObjMax];=0D =0D - /// A token mapper for the objects in the ArmNamespaceObjectArray=0D + /// Link lists of CmObj from the ArchCommon Namespace=0D + /// that are added in the Transient state.=0D + LIST_ENTRY ArchCommonCmObjList[EArchCommonObjMax];=0D +=0D + /// Structure Members used in Finalized state.=0D + /// An array of CmObj Descriptors from the ArchCommon Namespace=0D + /// This array is populated when the Repo is finalized.=0D + CM_OBJ_DESCRIPTOR ArchCommonCmObjArray[EArchCommonObjMax];=0D +=0D + /// A token mapper for the objects in the CmObjArray=0D /// The Token mapper is populated when the Repo is finalized in=0D /// a call to DynamicPlatRepoFinalise ().=0D TOKEN_MAPPER TokenMapper;=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116968): https://edk2.groups.io/g/devel/message/116968 Mute This Topic: https://groups.io/mt/105067975/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-