From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.1683.1637243247471099626 for ; Thu, 18 Nov 2021 05:47:28 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Nwo2b6nu; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: jakub.fedorowicz@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="234133168" X-IronPort-AV: E=Sophos;i="5.87,245,1631602800"; d="scan'208,217";a="234133168" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2021 05:47:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,245,1631602800"; d="scan'208,217";a="473153410" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga002.jf.intel.com with ESMTP; 18 Nov 2021 05:47:25 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 18 Nov 2021 05:47:25 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 18 Nov 2021 05:47:21 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 18 Nov 2021 05:47:21 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 18 Nov 2021 05:47:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BhZwbvhWZMFm6cNN7Y2C23Q53lvsObgA2v4oT+gUm9OliahcqHasNsJ8FglDwYaJ7XxcsL6ecXh2yIqtSYYQqwbQXFD4OZRiQ0Fri9P+a2OT2sCnwe3bhM94eD9R9uI474cerXVOfHm23wUYhN3R3Q3BYwuUIFe2LZc/zGt5WPtJWXoL5BezcumXBTsZrKj44r+qbXRZFA/bZ/am6gcBXMOZAppIEOcSTCyfABdB6Q7p5s5E+IpRaf8yw1gurMyoYRmw0HT5HdN1rezZ5Zx+bxMY1W8njMgN7TaAD85WPfHj6AOuy6CxY+JykQmCe6i/2VuEZkNQ9ZWjSzuwcDt22A== 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=OdbfMLL4Snwkoa+jVTviRWgCICjhtkHSVMSGQDJUMDo=; b=ZvuIPm/2cPv/XB7W0gQ6J2bfelp5KXTsVGo8rvcwYNEhvWMDMHcKXA0chZeCiGurWoHMhCaPGZrOvC3ZHeojR0+X8ieKC92QVbjWvu5R5RfeaKNUNxDPQ1Lfuk0FofplZ5OyO9I0B8woVMqyXbhcsdWy9g5f44kFEwPu8QCw+hqlOoTxt48zdzQ1AobTm1J+4f8Fj051aHKL5y4ygNQW/4sVMxXI+Qe4hO72MvfzRA/alwkBTI4KwtUiYyIXC8WhIzMBPQVnqmpovnJzvegw2be/sSQtGfDebYi3ZixBB7ZinSyuVY3upytosohu75nkQKkk6REG290EjAebt1B06Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OdbfMLL4Snwkoa+jVTviRWgCICjhtkHSVMSGQDJUMDo=; b=Nwo2b6nuR6u4vTiF1tlJZKbBmoICroUN2BZ2oRH3DlBJy9IY48pxj/92eFaCx1NnzlHiCVlBIOY1ZGCZq6HOxNsMQZ0/ibE0aiyU/RIExGn0m+Lal7by/Fx6Vv7vXzEZBFBH1oAi2Td2F2MXoP8v2rhKC4Iq4Zxz+Fgmr7Rr3cw= Received: from BYAPR11MB2709.namprd11.prod.outlook.com (2603:10b6:a02:be::10) by SJ0PR11MB5197.namprd11.prod.outlook.com (2603:10b6:a03:2d1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.18; Thu, 18 Nov 2021 13:47:20 +0000 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.4690.027; Thu, 18 Nov 2021 13:47:19 +0000 From: "Fedorowicz, Jakub" To: "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Ni, Ray" Subject: [PATCH v3] IntelSiliconPkg/BaseConfigBlockLib: Add function to iterate over Config Blocks Thread-Topic: [PATCH v3] IntelSiliconPkg/BaseConfigBlockLib: Add function to iterate over Config Blocks Thread-Index: AdfcgkTSi51+UapGSRujf98+wSZDRw== Date: Thu, 18 Nov 2021 13:47:19 +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 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e2a84794-0b00-428f-cf09-08d9aa99f0f5 x-ms-traffictypediagnostic: SJ0PR11MB5197: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 32GdvuFAITKiSDIYtzYpHu5pMEjStw9sGaY5rbxORbxBlbzW/cl76I62ZhMM1KfWAmI1Y/JF4wzbM7UFKFMcmo9E7/mcH5CrRJo1jwnbw8FJnVpUTRXLfpHePOfwKIBvX0ZRaQpythG/AOz2CrqhODINdWybwkhrbQ1zlZpca9U+4GOSsd42obUnIfIKlDWXyCt4cVSCkH+7n0hEem6ny/pQHpjklDm7d5P+XcsO2X41lk9Qfjb+b0tpcEisLWJocxVZHEvPk5fB5Q1f7+9XwaEcFFLaFOVLDHyE1HwBM9XTguwMFdcSw8d6TGdQug3KhG5WnY+cUi9AOFaZmamgHCgPjpJpqvReykf+6uW1lAvOYQfLw0iAuGdbpZAO+P+hiKCbV4k690Ug0VBiAWGbIaYSnBULZGmZSoDkkRoFdqAhKrhJ2mWqJoicR7c+vNfp1EIp5I4urnape3sA9tms6/uNDqwi2kpulFD8iLCnhOykXTD/Viuyvb8B0bQHRhyuxwwHqmHJgtP9Rh6ZHr6I5mrgRvhLTK1OiB5P7y9Y5ZrO0sG2rFLD8HyuJ3sZzy6upFkMRfOZhwKaTPxwp2Q0FynmtxqEFYKeFo8w/utE6u9W8lG7lhNy3QMLXZVPbyPXiz+rXnA3MwhsUR9o/39jS5DJGw2tKtlxUHIuBq+jXP55XJPNZQVaz2JuGMEYAMlUHeVn4F203/ZT9tYYbUyEqx1JiCpnz35oS1RflTyAQyOHjPm4bN5ncX3Il7U4g3+in2tRoXPVl9W0rXYOzftgy2PQHgElntKEAoBjEtIanmY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB2709.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(55016002)(122000001)(186003)(316002)(38070700005)(5660300002)(6506007)(38100700002)(8676002)(8936002)(508600001)(7696005)(26005)(33656002)(966005)(54906003)(86362001)(82960400001)(76116006)(52536014)(6916009)(83380400001)(66556008)(9686003)(64756008)(107886003)(71200400001)(66446008)(4326008)(66946007)(66476007)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bwBLOwRLzUR2Hc0BKs18I2fZ2FS1NhOgKTitYpxXIBoRwlWOfqC+ON1lj1R9?= =?us-ascii?Q?4Izq460Tc7r4l9G/bpMw1aI+laZ95vlqlluKz1mYaHmd8unEUNCcYOZQeV/X?= =?us-ascii?Q?wvasVv3sxgC03XgvmXFgh0e0aEQd2BxwoAk7PBfpjPjioQk+stJwvLGI94w4?= =?us-ascii?Q?yFEK+VkUc9kAhsZOE2OSPY0egxWLanFmC/tGTyEFXPD0+6GllL9F0yk6zBtE?= =?us-ascii?Q?RIZwmwDJsAJFyGE6gMpTl8nSmW406Kh7V/0GAtrdAIwJZhVqX+JOC1/GGVbE?= =?us-ascii?Q?15AGI/JIRB+YwvU8roRikKwfCl5oIzIUaCJqpYrpYJ0+h6Bk4YuKG99srzdS?= =?us-ascii?Q?f6QfQbm3lM8Lc+yDQFvgo1bhsf8aQhnUG0m1f8OTSRn0sHXtyvzdtzJtv41A?= =?us-ascii?Q?hLBaRdq2bPRPDFHGWQlMyGii/dNu51Ifz4ELm5EMouhXjI8vjWsy/mPvBM67?= =?us-ascii?Q?54eSzSIyIAMlzL8XfPy2SURboTGJ2198H87Cd5G0npAE0NyPL/PFlaoUhZJA?= =?us-ascii?Q?6MVgR4h7yO+aJgGnbiA9vZ5peVXMycqQ6BaHXQ5HA/1GX+GN1Zai5R3hiJh7?= =?us-ascii?Q?4hyVuZtVaG3YksGFMXE+/IEgIkx0jinwNyRLP6yNEK12nQYTjhPs2nKSmTsU?= =?us-ascii?Q?ozsd5YsxN3dlj/uvmBSA1CKaISITypoY5pHNwls84uXxm1LgRCxq3egPOke6?= =?us-ascii?Q?qKnK8nAOka2gAWqpw4nM5/NtBt2kDwnZwNX7YCkXPxaIcwbTbUIJ50oeQrmq?= =?us-ascii?Q?SdcLIn/caA6nemt8QXwuTKXktGN2ShWHa4mxD+qnDmDQ27iRnjxGXyyOWqLz?= =?us-ascii?Q?LKGl/IbiuYhE3WBImfkb7VCVPEJ6Ve03H5U9P+VEKauDkR61Yoaxc3sPKQ4y?= =?us-ascii?Q?TK22Vk4yFumZhUlXkpoULFd6JU4B9+s37e8Uoo3MQ5pGV1iXVNAyjpos3ctP?= =?us-ascii?Q?SPd+pgpdem9epdJTIZtdYCY/ypZeDnOYf8cOVB6HA0dw6fY9BDGwpVkJHO/p?= =?us-ascii?Q?3fHq7peL7U7IV0zYOemfmftE5m1yMzbQkD+PqlIKYtM9xdfahoMY7PlSqffN?= =?us-ascii?Q?E3W/csANXRHjp2QJRitasDwOwlRRfmW3NPvVDo8vLXxNnSqHJByZ6TJCSJmJ?= =?us-ascii?Q?CKq5K9azm0zRnN5b24oOcBnd01MHB0SwN4LvyILoTWssY+mxK0PFYMI+uk39?= =?us-ascii?Q?YIlgAwfeRPqDugPw5UnRdv7+s1Il+4DCtIMF4cOsshDdnP5AAwqglgUHIyu6?= =?us-ascii?Q?gV3qqgUcXmcgvE7CuK8SfKiyuQ9mV2Bx9aZtjNe1zkt7lPr53wo+2FeMcV+O?= =?us-ascii?Q?5HY36n32eyaR/1pljJ7KyZrDUAy+0LcK6Ju6I2h57TCnTDrhdDXtlFChotXh?= =?us-ascii?Q?pqvFZNxTtEV1NowpGiES26irwIO+aVFOu7094+NcDzq+3lihNupGl4yzd1QD?= =?us-ascii?Q?835/hnqdyla6nUFsaaAAA/TJt+/V3rtRInmCX8XWjiCXu1bpGjKx9DexXwzN?= =?us-ascii?Q?zQP+mQ3rbUxHtXpEP/S/8BKQj+WkX+vutJVDPzhaSln3WES0tdPWf0ZViN37?= =?us-ascii?Q?nZbxQHWVvYajSZkmaGDvc7ZtPMoq/rKuE6E7MKqon9Mg1DHPweRUslzXHTxh?= =?us-ascii?Q?pbLrBxyx24W9pvfrEDNClCI18RU+ObEa4jJrds0trv5lrLJd6N7yRqt8/+Di?= =?us-ascii?Q?DEMk5w=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: e2a84794-0b00-428f-cf09-08d9aa99f0f5 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2021 13:47:19.7985 (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: NLDYA6ktyLT+kjAGmeU4b9UXFA7kVHaFnUtl0hwrWmXKNU3VUsdj1fat5vBvwPEC4ETzGtjZ8TrfoVhNoPJYcjBrNeYaL18xZ1K3NdYgSvE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5197 Return-Path: jakub.fedorowicz@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR11MB2709C45E6A98A43B768D5C90849B9BYAPR11MB2709namp_" --_000_BYAPR11MB2709C45E6A98A43B768D5C90849B9BYAPR11MB2709namp_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In BaseConfigBlockLib add function to get next config block from config blo= cks 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 mailto:jakub.fedorowicz@intel.com Cc: Ray Ni mailto:ray.ni@intel.com Cc: Rangasai V Chaganty mailto:rangasai.v.chaganty@intel.com --- .../Include/Library/ConfigBlockLib.h | 20 ++++++++ .../BaseConfigBlockLib/BaseConfigBlockLib.c | 50 +++++++++++++++++++ 2 files changed, 70 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, against which the search begins + @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..f026ac0b 100644 --- a/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBl= ockLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfi +++ gBlockLib.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,52 @@ 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, against which the search begins + @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; + + ConfigBlkTblHdrPtr =3D (CONFIG_BLOCK_TABLE_HEADER *) + ConfigBlockTableAddress; ConfigBlkTblEndAddr =3D (UINTN) + ConfigBlockTableAddress + (UINTN) + ConfigBlkTblHdrPtr->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.HobLength; + } + + 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. --_000_BYAPR11MB2709C45E6A98A43B768D5C90849B9BYAPR11MB2709namp_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

In BaseConfigBlockLib add function to get next confi= g block from config blocks table in order to iterate over blocks of the sam= e type.

 

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

 

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

 

Cc: Ray Ni mailto:ray.ni@intel.com

Cc: Rangasai V Chaganty mailto:ran= gasai.v.chaganty@intel.com

---

.../Include/Library/ConfigBlockLib.h  &nbs= p;       | 20 ++++++++

.../BaseConfigBlockLib/BaseConfigBlockLib.c &nb= sp; | 50 +++++++++++++++++++

2 files changed, 70 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, against which the search begins

+  @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..f026ac0b 100644

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

+++ b/Silicon/Intel/IntelSiliconPkg/Library/BaseConf= igBlockLib/BaseConfi

+++ gBlockLib.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,52 @@ 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, against which the search begins

+  @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;

+

+  ConfigBlkTblHdrPtr =3D (CONFIG_BLOCK_TABLE_H= EADER *)

+ ConfigBlockTableAddress;  ConfigBlkTblEndAddr= =3D (UINTN)

+ ConfigBlockTableAddress + (UINTN)

+ ConfigBlkTblHdrPtr->Header.GuidHob.Header.HobLe= ngth;

+

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

+ &(TempConfigBlk->Header.GuidHob.Name);=

+  ConfigBlkOffset =3D (UINTN) ConfigBlockAddre= ss + (UINTN)

+ TempConfigBlk->Header.GuidHob.Header.HobLength;=

+

+  //

+  // Loop until exceeding ConfigBlockTable ran= ge  //  while

+ (ConfigBlkOffset < ConfigBlkTblEndAddr) {<= /o:p>

+    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)

+ TempConfigBlk->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.

--_000_BYAPR11MB2709C45E6A98A43B768D5C90849B9BYAPR11MB2709namp_--