From nobody Thu May 2 00:52:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+83404+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+83404+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=intel.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1636127640866395.6512660887515; Fri, 5 Nov 2021 08:54:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id OIn8YY1788612xgjuZlMTVFy; Fri, 05 Nov 2021 08:54:00 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web08.5822.1636120066879111575 for ; Fri, 05 Nov 2021 06:47:47 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10158"; a="219096802" X-IronPort-AV: E=Sophos;i="5.87,211,1631602800"; d="scan'208,217";a="219096802" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2021 06:47:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,211,1631602800"; d="scan'208,217";a="600617596" X-Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga004.jf.intel.com with ESMTP; 05 Nov 2021 06:47:45 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 5 Nov 2021 06:47:45 -0700 X-Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 5 Nov 2021 06:47:44 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 5 Nov 2021 06:47:44 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 5 Nov 2021 06:47:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YWIZgzvEDJgy4AhSQyZqkhHpYwdeAFk6A6nZMKiHQgBtRDcVoKkGfab57uCBFB5FL7zvAtg0cNfW3VH+FsPnJJ+ZhrU2WNu0H7cF0qSmCl/1huJqCgXVOXpSmHPNIbleZJR1YfU/TnAtnO97q4UAGUmmnshxGVRI04bixN8y4WviA8TP9OPCGUhBnNjjsx9Sk+kE0XgybM7+FStT/TYGjd+NKK1TpeCgWuZ8TblozLUzAfSYuj+2HisjoekaOG5lXqYW+LaFl4F2NEjiLtyOJaKPgrOXpj7ZWcp0r8CI/TXzczQ4HY5L7874XA1MiX/weiBcNcEvkzM4kbftnNC8lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7VKnrh/oZSJubbThANwZOFQwAkf4dJL2eawkb70vPfE=; b=E2w4XGsZFSO3TGxn1+tRXbdpL0RBrStvOgZQrLyECxLVNTRZiAIC4qq4Ghw9DS89BajrrmVWsBidr7S46hZsMXBPPplLE4KQrzKaNKa/uxGhAv6NQZ+GKVp25y/BYSxFMw7zFgxahCRf2Zhog0vIHFlZAY/nJM0A1L/j3jqGNcINZYZ8svwH5VOZZLhSzo/2Q1VFOdFyS9FbiMYWv0P4OKqJ7Q7pTJfTwK+Tz6V/LSpaO6GNqS6jECJ4Ol9ihXNdHLvj14WtcEGMFfyAVwqJUHZccsxwyztCu7vo9eEOMrZN9K4xqIGq0pl0NvF/lud3cBR4ekvXnIEmoJJvbVev1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from BYAPR11MB2709.namprd11.prod.outlook.com (2603:10b6:a02:be::10) by BY5PR11MB4372.namprd11.prod.outlook.com (2603:10b6:a03:1bb::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Fri, 5 Nov 2021 13:47:41 +0000 X-Received: from BYAPR11MB2709.namprd11.prod.outlook.com ([fe80::f492:735:caf8:1a67]) by BYAPR11MB2709.namprd11.prod.outlook.com ([fe80::f492:735:caf8:1a67%6]) with mapi id 15.20.4669.013; Fri, 5 Nov 2021 13:47:41 +0000 From: "Fedorowicz, Jakub" To: "devel@edk2.groups.io" CC: "Ni, Ray" , "Chaganty, Rangasai V" Subject: [edk2-devel] [PATCH] IntelSiliconPkg/BaseConfigBlockLib: Add function to iterate over Config Blocks Thread-Topic: [PATCH] IntelSiliconPkg/BaseConfigBlockLib: Add function to iterate over Config Blocks Thread-Index: AdfSSyiHxUipyhWlTDiblvN9aCx6aA== Date: Fri, 5 Nov 2021 13:47:41 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e738e106-940d-4b61-8411-08d9a062d689 x-ms-traffictypediagnostic: BY5PR11MB4372: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: Y1SFvSI8BVOU1jbCjDXOGwAdP9yVc8TLDMw/6qjN9Gu3HypWuI6FszEKuXTbJ4z+9DcF3j8IHagDCo15ylf9NJ9ejry6yoKQyDm6YnzcFrU7W6QHD7FdxDnxvzlwY9R+baf0wDzg5DctXyRMcXfesa7S/W3FPqEvaWnOymDz95bUgQmL9r9FVHZfwdw2zF/R4lm4QAtyB46kTeF4jzmCHGolr4Jqml6KocLp7nb2lAGYHl8+Tda2NcOZUsapvRQ0aZAXGYgu9wOCHuGHQ2P63GxrQ4vnRzWNkGa425khKRZ2685+z0ZhUtxjy6BdYx1j+tHbTy8V49liSvUxscx4b8wPjWA2te79bhU6cMaXXAOelbDcpg5EqJ9WPmzTRub0oui7IOVOtOR3KhjxIxOqymEWVk5DkY0PD5IpueyzGGQ1ZmSanntn/EsBtGH5tzLeFitsJYxQr6SP0b8i0vvxBoq32jPAlOJDB72lKWGRjG85dhj+4OsBS4+OB9tdhL1JZrKtYnA1dOPmVwUi6QPUtzNpjHSFAkCZL1Ci9N2OQfpzyBUStt1dkUwaFKMOWumvRUClN+XKozC8gzeJlEfSVyxFBb6Vw81EB3dlyOv1UaKXGVutKsFxTnyV+PrQ/ZWlk4me3fDKCG0LPJlyjYTv9zQOntoLX6Q6Qso7UEd222iUr83/aI9k5rDWDS6LNLi7oJAgbEK+hrDFKFw132nZI7pROSUJ5MAf31gNkcPdRnTc8+SLvucBaG/n8qlkQK2CiJVbxU8Gj8T2QBjWGzKEUuX+qNAT4TKRaghMAe3vXYA= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wo7D3FaXt8GB3zlLNJCzk7ND1lVfJa52KXAGfzR9sxalWGjfjrreTE3ubjeO?= =?us-ascii?Q?9o8Wychoktt+bn/sh5Iw5eyDWjag23b8UYEytTCYhB+1Keqk5o3BrJV3Dyo4?= =?us-ascii?Q?s5FyaHzw+PQPykNKAm7pHzMZCEN/NGEAWNzE8c1mHw31zlVtiKZZrddpQsMb?= =?us-ascii?Q?hxurN1O0mySNkaDtcOqmIX0yP41WnZhi20BL8LtLHXQJWg3EuJEq0Gviw8Fv?= =?us-ascii?Q?0CZnxiRE5IHz6uUf904/PMMTxM+QzDGN4r0ZrqiRh4AAJehoppjJsZCf2Ovi?= =?us-ascii?Q?x3tm4OE15ZVB+weiyT/6kx6GbdLtiWx3ytPKj/0K6uuIs5+I0T/okJMjKvU6?= =?us-ascii?Q?LitEkoZMOm8eTC77J3BRxQVuFz+DlBZRFVwxb+7kFZsiViokgeuKq4nNRL7o?= =?us-ascii?Q?OavDuAq/yjO6gn7kd4M4QE/FlskrlJv+1bZEBqvzUIq6f6GfZ8uymI1yEja4?= =?us-ascii?Q?03rdp4sLirndk3r9AWFABQtgGOaUaP5vxOAuuKH0b4WtXMOlz3umVJpAw26U?= =?us-ascii?Q?wo8+GptlHvMH5KczhbWc7exhTsT+WyX/SEoWf1N3witGFcYja3EygnOuCjBT?= =?us-ascii?Q?ow+wetEl3sauKVrP0RhoRbWzT74SPjFJg0S/adiQ+OqzUhYohhSVEoFYTvFq?= =?us-ascii?Q?CfvKxDJ3fKtkVHWw88Whcazb6gEbzuSBEjWEQIyHEwSxQF05QnRsiXWk1qug?= =?us-ascii?Q?G89s8E7HLK/7G3LhKkNgRRK3WASTLqfV9Gkckewrb+6SXgD/gz5IB28yxTs2?= =?us-ascii?Q?2vDwuc6unFZpv8qM0x1nhRmbL+jvZ4Y0jC2d/7OnmwxofQsxP/fZ4eAQToh7?= =?us-ascii?Q?CAijK68TSCoDVWZO0a18UP5k7NUXzUR8kI/e/Qj6lWFTSke+7/3BNhlgTBFh?= =?us-ascii?Q?THI7npCfKrxAsntGY0ta/CnylX13zxN71dgSViAr3zZ6XrZJPd1uUIvURh/A?= =?us-ascii?Q?nCVHlOHrkLD6IpRamNRoTJl1ho0ERPsETONEpwfG8wReMZiOg7/6liPUNH9H?= =?us-ascii?Q?NibPorpsiZluPrfEbkrK/ItGVjiVTV+WDzlmQ2W+m/rqOmYTCLD/hl/Sigro?= =?us-ascii?Q?e5yf1DzhRX2EgMLa/OThk8ZKzWeMlEgab8ow7j+j9hxLYNcyk+1OeWHYD8cl?= =?us-ascii?Q?waEN7WcpIfASFNoOEMvxrZNnZoXyG/TUfytRdqeW1AZuj4tSXHbiWrLY0LnM?= =?us-ascii?Q?OCF6MAW4o23h2nLPf5Ws6H/crvNDiql6wKrMt0Nz9cGVCwDzkSZoVZjAMSbf?= =?us-ascii?Q?2BBnB/6lLmPk1HXW3rS4YDGr9lif5M2ucc/Vs5vqojatogqZzBDfBPXdETSd?= =?us-ascii?Q?DRsZ4hIOQ9gSFC5p1skN54JgA5nkMkVwGBRNt4YvsBLA3RkyOcgWWpwxQyeu?= =?us-ascii?Q?X3kVbjVqkQdYGhVM0UIW3UixBDtCc58lJgtaf96UAidJDA0BuCk7+fNHF9V0?= =?us-ascii?Q?Are1PNxFfGQ2O7Yr5ulPlU2K+0wIj4V8DtpwBTNfoaepiWbLMiz0kh8BW7yk?= =?us-ascii?Q?ZSNcggEznpJWjGajJDeH+bJKiwRoKJoAjW9wnGwKYwkPRJRrXZ5KecX+OqsD?= =?us-ascii?Q?2iDh5Wy/o2Vl0W+HR/UZpxf5N9pVh8iVM4cBTRJocZ+E5Wj5/iOuvX0zg6lr?= =?us-ascii?Q?w1tFYw92dlQRl9XvXxjl9CReHHSZ5wO1Jvorh/iKfyx+JM7DYAe80+mnIdnM?= =?us-ascii?Q?ACnSuA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2709.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e738e106-940d-4b61-8411-08d9a062d689 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2021 13:47:41.5192 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: R1p1lXGjCmNAWkQXpp69kz3HeA2lquBrE5/T4+9CJ4+h4c6FwAlsEFPccftM5Vr8P60q4EfAb2jxBTQSy5ilj32EsvpEIMueo1GzoZvTuOE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4372 X-OriginatorOrg: intel.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,jakub.fedorowicz@intel.com X-Gm-Message-State: mc1J9Gu6cz5OJOUkg24m7J64x1787277AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR11MB27095E086D87B4128257172F848E9BYAPR11MB2709namp_" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636127640; bh=NZo1+d9PndPrvdCzCaTBbxLzIYWAZ8l/SW//fo0/wOY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=upKslWlXwrQd9/0NdyV0Cdqf8m6oW3G5CiMMJL2MShhnNaGuYJXVMZqEfMU8C7j4SBG fzlb0If7V7z6eupFcETmu8B5MJvTMrOkXKgYHxfueyrxVySzvUyo09AChVMUbm13gp8L8 VCvbY0vei1ITWfKySkZYCZAnHhDzbJKtnf8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636127642374100002 --_000_BYAPR11MB27095E086D87B4128257172F848E9BYAPR11MB2709namp_ MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In BaseConfigBlockLib add function to get next config block from config bl= ocks table in order to iterate over blocks of the same type. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3700 Signed-off-by: Jakub Fedorowicz jakub.fedorowicz@intel.com Cc: Ray Ni ray.ni@intel.com Cc: Rangasai V Chaganty rangasai.v.chaganty@intel.com --- Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h = | 20 ++++++++++++++++++++ Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib= .c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h= b/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h index 37a39681..77eff21b 100644 --- a/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h @@ -45,6 +45,7 @@ AddConfigBlock ( /** Retrieve a specific Config Block data by GUID. + If there is more than one Config Block with given GUID, return the first= found with given GUID. @param[in] ConfigBlockTableAddress - A pointer to the beginnin= g of Config Block Table Address @param[in] ConfigBlockGuid - A pointer to the GUID use= s to search specific Config Block @@ -61,4 +62,23 @@ GetConfigBlock ( OUT VOID **ConfigBlockAddress ); +/** + Search through ConfigBlockTable blocks to find following Config Block of= the same GUID. + If there is no following Config Block found until the end of the table, = return EFI_NOT_FOUND. + + @param[in] ConfigBlockTableAddress - A pointer to the beginning o= f Config Block Table + @param[in] ConfigBlockAddress - A pointer to the Config Bloc= k, in relation to which we start the search + @param[out] NextConfigBlockAddress - On return, points to a point= er to the found Config Block + + @retval EFI_NOT_FOUND - Could not find the following Config Block + @retval EFI_SUCCESS - Config Block found and return +**/ +EFI_STATUS +EFIAPI +GetNextConfigBlock ( + IN VOID *ConfigBlockTableAddress, + IN VOID *ConfigBlockAddress, + OUT VOID **NextConfigBlockAddress + ); + #endif // _CONFIG_BLOCK_LIB_H_ diff --git a/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseC= onfigBlockLib.c b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/= BaseConfigBlockLib.c index c89699ea..04dc7d0b 100644 --- a/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBl= ockLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBl= ockLib.c @@ -95,6 +95,7 @@ AddConfigBlock ( /** Retrieve a specific Config Block data by GUID. + If there is more than one Config Block with given GUID, return the first= found with given GUID. @param[in] ConfigBlockTableAddress - A pointer to the beginnin= g of Config Block Table Address @param[in] ConfigBlockGuid - A pointer to the GUID use= s to search specific Config Block @@ -137,3 +138,53 @@ GetConfigBlock ( return EFI_NOT_FOUND; } + +/** + Search through ConfigBlockTable blocks to find following Config Block of= the same GUID. + If there is no following Config Block found until the end of the table, = return EFI_NOT_FOUND. + + @param[in] ConfigBlockTableAddress - A pointer to the beginning o= f Config Block Table + @param[in] ConfigBlockAddress - A pointer to the Config Bloc= k, in relation to which we start the search + @param[out] NextConfigBlockAddress - On return, points to a point= er to the found Config Block + + @retval EFI_NOT_FOUND - Could not find the following Config Block + @retval EFI_SUCCESS - Config Block found and return +**/ +EFI_STATUS +EFIAPI +GetNextConfigBlock ( + IN VOID *ConfigBlockTableAddress, + IN VOID *ConfigBlockAddress, + OUT VOID **NextConfigBlockAddress + ) +{ + CONFIG_BLOCK_TABLE_HEADER *ConfigBlkTblHdrPtr; + UINTN ConfigBlkTblEndAddr; + UINTN ConfigBlkOffset; + CONFIG_BLOCK *TempConfigBlk; + EFI_GUID *TargetGuid; + lmao; + + ConfigBlkTblHdrPtr =3D (CONFIG_BLOCK_TABLE_HEADER *) ConfigBlockTableAdd= ress; + ConfigBlkTblEndAddr =3D (UINTN) ConfigBlockTableAddress + (UINTN) Config= BlkTblHdrPtr->Header.GuidHob.Header.HobLength; + + TempConfigBlk =3D (CONFIG_BLOCK *) ConfigBlockAddress; + TargetGuid =3D &(TempConfigBlk->Header.GuidHob.Name); + ConfigBlkOffset =3D (UINTN) ConfigBlockAddress + (UINTN) TempConfigBlk->= Header.GuidHob.Header.HobLength; + + // + // Loop until exceeding ConfigBlockTable range + // + while (ConfigBlkOffset < ConfigBlkTblEndAddr) { + TempConfigBlk =3D (CONFIG_BLOCK *) ConfigBlkOffset; + + if (CompareGuid (TargetGuid, &(TempConfigBlk->Header.GuidHob.Name))) { + *NextConfigBlockAddress =3D (VOID *) TempConfigBlk; + return EFI_SUCCESS; + } + + ConfigBlkOffset +=3D (UINTN) TempConfigBlk->Header.GuidHob.Header.HobL= ength; + } + + return EFI_NOT_FOUND; +} -- 2.30.0.windows.2 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. -=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 (#83404): https://edk2.groups.io/g/devel/message/83404 Mute This Topic: https://groups.io/mt/86844054/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- --_000_BYAPR11MB27095E086D87B4128257172F848E9BYAPR11MB2709namp_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

In BaseConfigBlockLib add function to get next co= nfig block from config  blocks table in order to iterate over blocks o= f the same type.

 

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

 

Signed-off-by: Jakub Fedorowicz jakub.fedorowicz@intel.com

 

Cc: Ray Ni ray.ni@intel.com

Cc: Rangasai V Chaganty rangasai.v.chaganty@intel.com

---

Silicon/Intel/IntelSiliconPkg/Include/Library/Config= BlockLib.h           = ;     | 20 ++++++++++++++++++++

Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBloc= kLib/BaseConfigBlockLib.c | 51 ++++++++++++++++++++++++++++++++++++++++++++= +++++++

2 files changed, 71 insertions(+)

 

diff --git a/Silicon/Intel/IntelSiliconPkg/Include/L= ibrary/ConfigBlockLib.h b/Silicon/Intel/IntelSiliconPkg/Include/Library/Con= figBlockLib.h

index 37a39681..77eff21b 100644

--- a/Silicon/Intel/IntelSiliconPkg/Include/Library/= ConfigBlockLib.h

+++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/= ConfigBlockLib.h

@@ -45,6 +45,7 @@ AddConfigBlock (

 /**

   Retrieve a specific Config Block data b= y GUID.

+  If there is more than one Config Block with = given GUID, return the first found with given GUID.

   @param[in]    =   ConfigBlockTableAddress      - A pointer to= the beginning of Config Block Table Address

   @param[in]     = ; ConfigBlockGuid         &nbs= p;    - A pointer to the GUID uses to search specific Config= Block

@@ -61,4 +62,23 @@ GetConfigBlock (

   OUT    VOID  &= nbsp;   **ConfigBlockAddress

   );

+/**

+  Search through ConfigBlockTable blocks to fi= nd following Config Block of the same GUID.

+  If there is no following Config Block found = until the end of the table, return EFI_NOT_FOUND.

+

+  @param[in]      Con= figBlockTableAddress   - A pointer to the beginning of Config Blo= ck Table

+  @param[in]      Con= figBlockAddress        - A pointer to th= e Config Block, in relation to which we start the search

+  @param[out]     NextConf= igBlockAddress    - On return, points to a pointer to the fo= und Config Block

+

+  @retval EFI_NOT_FOUND    = ;     - Could not find the following Config Block<= /o:p>

+  @retval EFI_SUCCESS    &= nbsp;      - Config Block found and return

+**/

+EFI_STATUS

+EFIAPI

+GetNextConfigBlock (

+  IN     VOID  &= nbsp;   *ConfigBlockTableAddress,

+  IN     VOID  &= nbsp;   *ConfigBlockAddress,

+  OUT    VOID   =    **NextConfigBlockAddress

+  );

+

#endif // _CONFIG_BLOCK_LIB_H_

diff --git a/Silicon/Intel/IntelSiliconPkg/Library/B= aseConfigBlockLib/BaseConfigBlockLib.c b/Silicon/Intel/IntelSiliconPkg/Libr= ary/BaseConfigBlockLib/BaseConfigBlockLib.c

index c89699ea..04dc7d0b 100644

--- a/Silicon/Intel/IntelSiliconPkg/Library/BaseConf= igBlockLib/BaseConfigBlockLib.c

+++ b/Silicon/Intel/IntelSiliconPkg/Library/BaseConf= igBlockLib/BaseConfigBlockLib.c

@@ -95,6 +95,7 @@ AddConfigBlock (

 /**

   Retrieve a specific Config Block data b= y GUID.

+  If there is more than one Config Block with = given GUID, return the first found with given GUID.

   @param[in]    =   ConfigBlockTableAddress      - A pointer to= the beginning of Config Block Table Address

   @param[in]     = ; ConfigBlockGuid         &nbs= p;    - A pointer to the GUID uses to search specific Config= Block

@@ -137,3 +138,53 @@ GetConfigBlock (

   return EFI_NOT_FOUND;

}

+

+/**

+  Search through ConfigBlockTable blocks to fi= nd following Config Block of the same GUID.

+  If there is no following Config Block found = until the end of the table, return EFI_NOT_FOUND.

+

+  @param[in]      Con= figBlockTableAddress   - A pointer to the beginning of Config Blo= ck Table

+  @param[in]      Con= figBlockAddress        - A pointer to th= e Config Block, in relation to which we start the search

+  @param[out]     NextConf= igBlockAddress    - On return, points to a pointer to the fo= und Config Block

+

+  @retval EFI_NOT_FOUND    = ;     - Could not find the following Config Block<= /o:p>

+  @retval EFI_SUCCESS    &= nbsp;      - Config Block found and return

+**/

+EFI_STATUS

+EFIAPI

+GetNextConfigBlock (

+  IN     VOID  &= nbsp;   *ConfigBlockTableAddress,

+  IN     VOID  &= nbsp;   *ConfigBlockAddress,

+  OUT    VOID   =    **NextConfigBlockAddress

+  )

+{

+  CONFIG_BLOCK_TABLE_HEADER    = *ConfigBlkTblHdrPtr;

+  UINTN      &nb= sp;            =       ConfigBlkTblEndAddr;

+  UINTN      &nb= sp;            =       ConfigBlkOffset;

+  CONFIG_BLOCK     &n= bsp;           *TempConfi= gBlk;

+  EFI_GUID      =             &nb= sp;  *TargetGuid;

+  lmao;

+

+  ConfigBlkTblHdrPtr =3D (CONFIG_BLOCK_TABLE_H= EADER *) ConfigBlockTableAddress;

+  ConfigBlkTblEndAddr =3D (UINTN) ConfigBlockT= ableAddress + (UINTN) ConfigBlkTblHdrPtr->Header.GuidHob.Header.HobLengt= h;

+

+  TempConfigBlk =3D (CONFIG_BLOCK *) ConfigBlo= ckAddress;

+  TargetGuid =3D &(TempConfigBlk->Heade= r.GuidHob.Name);

+  ConfigBlkOffset =3D (UINTN) ConfigBlockAddre= ss + (UINTN) TempConfigBlk->Header.GuidHob.Header.HobLength;<= /p>

+

+  //

+  // Loop until exceeding ConfigBlockTable ran= ge

+  //

+  while (ConfigBlkOffset < ConfigBlkTblEndA= ddr) {

+    TempConfigBlk =3D (CONFIG_BLOCK = *) ConfigBlkOffset;

+

+    if (CompareGuid (TargetGuid, &am= p;(TempConfigBlk->Header.GuidHob.Name))) {

+      *NextConfigBlockAddr= ess =3D (VOID *) TempConfigBlk;

+      return EFI_SUCCESS;<= o:p>

+    }

+

+    ConfigBlkOffset +=3D (UINTN) Tem= pConfigBlk->Header.GuidHob.Header.HobLength;

+  }

+

+  return EFI_NOT_FOUND;

+}

--

2.30.0.windows.2


Intel = Technology Poland sp. z o.o.
ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy G= dańsk Północ | VII Wydział Gospodarczy Krajowego Rejest= ru Sądowego - KRS 101882 | NIP 957-07-52-316 | Kapitał zakła= dowy 200.000 PLN.

Ta wiadomość wraz z załącznikami jest przeznacz= ona dla określonego adresata i może zawierać informacje pouf= ne. W razie przypadkowego otrzymania tej wiadomości, prosimy o powiado= mienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przegl= 1;danie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material f= or the sole use of the intended recipient(s). If you are not the intended r= ecipient, please contact the sender and delete all copies; any review or di= stribution by others is strictly prohibited.

_._,_._,_

G= roups.io Links:

You receive all messages sent to this group.

Vi= ew/Reply Online (#83404) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [importer@patchew.org]
_._,_._,_=20 --_000_BYAPR11MB27095E086D87B4128257172F848E9BYAPR11MB2709namp_--