From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.9705.1646307807868454992 for ; Thu, 03 Mar 2022 03:43:28 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Y26CV/Zp; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: jakub.fedorowicz@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646307807; x=1677843807; h=from:to:cc:subject:date:message-id:mime-version; bh=eIrq3upxdb+/ofbCllYMVcX13uJAN8PZ0ZTRCNcdt98=; b=Y26CV/ZprPq3s2Kb1ePhiXdEhdV/itYOZlpgJFMD+EsjzHRYHU/O3iWT CkqvJqUIAgAoV1h4tna8sCyGn8cBoZW1XcHnA1j0zh/kkuFrnkrSdmRNy 96Nb6QrSRbAXBSOjMT27icdLZmNpEy6T0Un6dDihAUEdty1AvY7PR7WMz 63fszvkYIGSoTL9n+MvsqC64J3gPwi7z2ggUHRFbzBNjeklAajLB97jUV 8zMgaOsTwcYc5HkCkr71vq+ZgkatMwkScJI1oj3MXnJ4jS0/RiUie8FSm af4eOOmoDuKhjdsN7PkhsEx2r6hIUyMptDDZRFNka8k3PMFAxqDTdmHQ0 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="251226190" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208,217";a="251226190" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 03:43:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208,217";a="535796303" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga007.jf.intel.com with ESMTP; 03 Mar 2022 03:43:26 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.2308.21; Thu, 3 Mar 2022 03:43:26 -0800 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 3 Mar 2022 03:43:26 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2308.21 via Frontend Transport; Thu, 3 Mar 2022 03:43:26 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) 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.2308.21; Thu, 3 Mar 2022 03:43:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNQzXU/xeJ8KkTKKbkoScF1hO+sASfmD5n39G402x8oKIOD2TGWKrQl0toveu4mKSEfpDXETd2z969j+CKF4QWXi68crJYgdZai9CYN1GnV6D+J+WLo7DFKqN/to2Qp/Yc+M+tcxZt0diL+3HdHuOpW2FZWiaPer9rUz/aVoPhMhvVc3HsF6XmjkMxzgHuvSGBZv/rxjcY8GHSSSitUJsasCOQzqasirNnc8Kdtg3aS6MrVzM4dkYzYeLuSUTGeglPP3s0fDpRrTjciMX4sdfdKSCyi7m632SFuhkwXyIgEy15U3zKAwq4vqpDhTYVCETcOK4ogwUNFVdKDzmlEUSg== 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=dhE+UFoSNwGl8WfgWjmWh1unTqobzro21K7luYaJkCk=; b=XwfWTJclJhBUId4NYRDq3pTkaFLs55KBLzG3BcttalsBfNFZtftRy1nbyaK/CKmuK3T/08m7TwNsi2JZNI4PlIMNmtrawyjhQlYLsZJ1bqBErKOkDGitKzzAPPpS+55I+LSA5biZWPxPR6SMwPLfWCUFbDUJnzudH0vsDrYVIjxZW6fFXiH4fKLXNKPB7ItkVCMIvlnYZtt/aepw2zfaEcHpgrLE+RROOfVbp7HOtiTjByO+jlbVhwlz6820ZwEiL0saVAD5sc6Z8CgavV4WspzSe3NrmapTm4fTp0MJHyhfJV4BBMreGu2MVRPlwz2JMWgHZcz6h/p3v6Zj3Rc8hA== 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 Received: from BYAPR11MB2709.namprd11.prod.outlook.com (2603:10b6:a02:be::10) by BN6PR11MB1844.namprd11.prod.outlook.com (2603:10b6:404:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Thu, 3 Mar 2022 11:43:23 +0000 Received: from BYAPR11MB2709.namprd11.prod.outlook.com ([fe80::d86:3ed1:4acd:8371]) by BYAPR11MB2709.namprd11.prod.outlook.com ([fe80::d86:3ed1:4acd:8371%6]) with mapi id 15.20.5017.026; Thu, 3 Mar 2022 11:43:23 +0000 From: "Fedorowicz, Jakub" To: "devel@edk2.groups.io" CC: "Ni, Ray" , "Chaganty, Rangasai V" Subject: [PATCH v2] IntelSiliconPkg/BaseConfigBlockLib: Add function to iterate over Config Blocks Thread-Topic: [PATCH v2] IntelSiliconPkg/BaseConfigBlockLib: Add function to iterate over Config Blocks Thread-Index: Adgu8pg/S7LubHsLTZWd+bViPBUckg== Date: Thu, 3 Mar 2022 11:43:23 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.401.20 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: 1913e940-d1d4-4eff-00e6-08d9fd0b0615 x-ms-traffictypediagnostic: BN6PR11MB1844:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ow7h18kcEt8mBUInpgBTw3zUwjrk8xYbbJM0oHSLNZC3ZXTOA5Brc/0WZdqKy8quZ1POL5dksEyZtORs5diDB4qjDu8sK4P8Bb5t9bluavwmeKgSd5W0eALfEo96jwfsqpv0dYQ/iyZ6N579Tx0isORMNfHV/TF36Ds8q4mYN4s/0F9q5KT5ri+s3HP1Nyf9hdJq5vrw6xYVlMGqIRPM2PivvcYANfKzZILQAznuLFLByve9C/fslMImVhbwIHyEnIjmz5y4MOeSfux+CCqAHXDj0sIGkA34rwiLAtgGv2q/uV8ETVl8hPs8+xc8PWERSpVpHhPU28mW/bFQZc6IWJP4adRoNtQG7ZgTNlDHsq9HK4aD8NQdMFabCEN8Bj2vNP+jtTjeB/kXvoehHpFfxf9LkOqRGu4kileek9gzkgwZcQX8W2ChzGuayTNzIGGoQ8zL09YAxBC3bf+RW2XX1SwscqvxwZb/+Ut3FABzrA0nPXU+gp3QurLMbQDR2nd5lUNW7xk0847BSL54WIpljW8V23A5oIXpE2DJhdyqFHpTc4JSz563aWwCzy5HxAsNaMIC7o4Q1ZJJ0V9jzvH/+u2BgTPE2VlTeADAWWx+COfEJ7+eyRsF5Y8NFDMAURr+i1T4DiozErZd/ltv6JhyeSD09sLgPgWzsux+RFmEnEz7pycVLMWeV1d9/GRoBNzlrjPYRv+U4Z8/GHoUlFNq2W5KZSWFbWEY5OWeJoHPxXJSLTIzAJlLvi1nOymKalcio5pMeNupE2GHwE/TwfrsQbsi3kNxy/hswOa85+o70so= 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:(13230001)(366004)(107886003)(66446008)(166002)(66476007)(66946007)(66556008)(86362001)(83380400001)(76116006)(64756008)(33656002)(6916009)(54906003)(55016003)(52536014)(186003)(316002)(26005)(4326008)(8676002)(38100700002)(71200400001)(966005)(9686003)(38070700005)(8936002)(5660300002)(6506007)(508600001)(7696005)(2906002)(122000001)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+761k8a5a/Nv/FIhu5KYaX34pTxo8b02IwE5s+1LKYdptSPyhTVfNBMxMhBR?= =?us-ascii?Q?TeNRQ+o56NL9Msxtcm6ISrpfepldokQ4M3XbPE/HMWI52NDhgsjVdUStIRHT?= =?us-ascii?Q?P8C3mcr1uQPd0WoZeiv2NEFT/4tCd9L91GxvjfbAC0R1sFEsBpNQJz9s+eHu?= =?us-ascii?Q?1VeU+p8krbrLuQWZyRrt/u6sBTcbRI/6asf2PkNdisDwWldI+XB2rpzLqhg/?= =?us-ascii?Q?3KDBsOLJWeI9a0ePySVAM2ovjGIVlD+7SY3QdlaGFNv8rr+OV6KXO3qaJtcY?= =?us-ascii?Q?PIH9C/IvA+ktj/ZcLVwzVBVcZ4cPf2jwVgFMoen1VX32aElz+0recSwnImk1?= =?us-ascii?Q?oGfBDzy+ibfRbaFLVQ65e2B57vlEHewyHb94cOkOccWcgthicIkXG69AnOhs?= =?us-ascii?Q?0I5rA7ZH4sXXBpDztz9J1+mrzrAeLU9xCk0dRhbOLkVMZ4PtPf20DYoB89OV?= =?us-ascii?Q?PRUeew/5HKTdujBCEtyx/n7C4M3jaCaXgj3rnUlneAk04oMFk9HIryava7Pq?= =?us-ascii?Q?tRNXlmVRR9thhWGzYsHNCFNrWHqrrG6omAKhMnC5FIlg7RnRPjk1kCbcPiz9?= =?us-ascii?Q?nd3o+bXl2dbsSBoDzDWcBcrPe9RCQMR0kJuSBQktZXhFT2HVLFYLk1xjL1wj?= =?us-ascii?Q?iQN/mkVGi9tme/Q357mkA+WmVRRKOgTBOq5zXl1DjMAwwHcTyJthou9y6ZWC?= =?us-ascii?Q?EyBXfDeZZ6lIcjvSTHPCSSgIxf+BupLeDum1jBZoS2FkIljA8hUJPdgSS1hF?= =?us-ascii?Q?tMnm21R/1sYaAN99YoUHRzrAzlMRR6LcAGkSdVQxJGbV8e1MrSmzqvojTDzN?= =?us-ascii?Q?RJT9jeUTNA7uaC1bQkmRVg+isJHJbwcbPIBFtHj+uYWo0/KE4sc6zyNikrGt?= =?us-ascii?Q?jsY187c7h1LMrI86ERIZxppKEXey0DRafcBC5Cb+0Th86D2ANXeMvb2qr+dz?= =?us-ascii?Q?BYVbzL3hyUcXfINdGfl0IyQ2zTjKYLK0DuhgdDl8cFOoXQtvyXrfAHRUvU+T?= =?us-ascii?Q?DuEZjK7I/rwX8l7Uh6zK8YI5SoSxC5PPZhSpIdFiuv3JkSCounbfIuXA/Zbf?= =?us-ascii?Q?Qf8XZUj0+7lveK5B05r+sJnhU/a04XhGwWwly4V7MYmJeplnRHKzV4BAqQya?= =?us-ascii?Q?lF0xhFqUtZTCR9vC5RhUBsA/il4wo3l5AkXXHEHnmm5iNGln5KrkNQAPbsCs?= =?us-ascii?Q?cSomMSzuBRtKgIOEzdH1StfLxVBHORbXANBpfrq9sbRNoqspTF1Q+jeSaHCU?= =?us-ascii?Q?DdWUkkYhC9M7qeF7gB4ODiYUvnLR0avPRKuX6ZCbiY5iAl+qk8cEWpL/i+44?= =?us-ascii?Q?nFBJP3eQ83JWU2IqVj+to5dki+v0yyVEGOl44iWQfwg9g/+iXhISJJ0J7WEQ?= =?us-ascii?Q?IT3hBstm1j47IVNpNfYb/AhpuF5zDng2AHwL5xO9X8/25AmBFUo3ldP9OovF?= =?us-ascii?Q?cdgQMC8iaR995881YKxDRhcmkljb/aOkX3Rhe/5RT+ONAUzd5GHbv2VsI0Vk?= =?us-ascii?Q?tOe8/IIYv70TBuUxcWiEY5h+iB/3X+8hc18cJNANRIvHtRlL8mLMuToo8o5a?= =?us-ascii?Q?JRTZhKn8RThRsmByluajxMNkApdp/w/wFxEUh86Y2sbjy9lvH6foeXmGkwK/?= =?us-ascii?Q?aHgzA8nupZwSXYcmgLMUVCNH+iD473eSWwXlVkxpt1JmLI2LNekap9vjsEE2?= =?us-ascii?Q?PRWbSw=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: 1913e940-d1d4-4eff-00e6-08d9fd0b0615 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2022 11:43:23.6893 (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: awHvmapeYaYCuib+Acaa/kIVvwjNPOnq/DC0MYhsoKRyuOBigu8dhw3m56L33kDfhwh/TpZcNM+ohHnxCI2T6+3MqnZV3549BvZeP/9duF0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1844 Return-Path: jakub.fedorowicz@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR11MB27093FA566CF61539826C9F484049BYAPR11MB2709namp_" --_000_BYAPR11MB27093FA566CF61539826C9F484049BYAPR11MB2709namp_ 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 GUID. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3700 Cc: Ray Ni ray.ni@intel.com Cc: Rangasai V Chaganty rangasai.v.chaganty@intel.com Signed-off-by: Jakub Fedorowicz jakub.fedorowicz@intel.com --- .../Include/Library/ConfigBlockLib.h | 20 +++++++ .../BaseConfigBlockLib/BaseConfigBlockLib.c | 54 ++++++++++++++++--- 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h= b/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h index 37a396816..64a13bca9 100644 --- a/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h @@ -9,6 +9,8 @@ #ifndef _CONFIG_BLOCK_LIB_H_ #define _CONFIG_BLOCK_LIB_H_ +#include + /** Create config block table. @@ -61,4 +63,22 @@ GetConfigBlock ( OUT VOID **ConfigBlockAddress ); +/** + Search through ConfigBlockTable blocks to find following Config Block of= given GUID. + If there is no such following Config Block found until the end of the ta= ble, return EFI_NOT_FOUND. + + @param[in] ConfigBlockTable A pointer to the beginning of Config Blo= ck Table + @param[in] ConfigBlock A pointer to the Config Block, against w= hich the search begins + @param[in] TargetGuid A pointer to the Guid of Config Block to= find + + @return Pointer to config block, or NULL if conf= ig block of given guid was not found +**/ +CONFIG_BLOCK* +EFIAPI +GetNextConfigBlock ( + IN CONFIG_BLOCK_TABLE_HEADER *ConfigBlockTable, + IN CONFIG_BLOCK *ConfigBlock, + IN EFI_GUID *TargetGuid + ); + #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 c89699ea4..30847d561 100644 --- a/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBl= ockLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBl= ockLib.c @@ -5,7 +5,6 @@ Copyright (c) 2017 - 2019, Intel Corporation. All rights re= served.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#include #include #include #include @@ -14,12 +13,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /** Create config block table. - @param[in] TotalSize - Max size to be allocated f= or the Config Block Table - @param[out] ConfigBlockTableAddress - On return, points to a poi= nter to the beginning of Config Block Table Address + @param[in] TotalSize Max size to be allocated for the= Config Block Table + @param[out] ConfigBlockTableAddress On return, points to a pointer t= o the beginning of Config Block Table Address - @retval EFI_INVALID_PARAMETER - Invalid Parameter - @retval EFI_OUT_OF_RESOURCES - Out of resources - @retval EFI_SUCCESS - Successfully created Config Block Table = at ConfigBlockTableAddress + @retval EFI_INVALID_PARAMETER Invalid Parameter + @retval EFI_OUT_OF_RESOURCES Out of resources + @retval EFI_SUCCESS Successfully created Config Bloc= k Table at ConfigBlockTableAddress **/ EFI_STATUS EFIAPI @@ -137,3 +136,46 @@ GetConfigBlock ( return EFI_NOT_FOUND; } + + +/** + Search through ConfigBlockTable blocks to find following Config Block of= given GUID. + If there is no such following Config Block found until the end of the ta= ble, return EFI_NOT_FOUND. + + @param[in] ConfigBlockTable A pointer to the beginning of Config Blo= ck Table + @param[in] ConfigBlock A pointer to the Config Block, against w= hich the search begins + @param[in] TargetGuid A pointer to the Guid of Config Block to= find + + @return Pointer to config block, or NULL if conf= ig block of given guid was not found +**/ +CONFIG_BLOCK* +EFIAPI +GetNextConfigBlock ( + IN CONFIG_BLOCK_TABLE_HEADER *ConfigBlockTable, + IN CONFIG_BLOCK *ConfigBlock, + IN EFI_GUID *TargetGuid + ) +{ + CONFIG_BLOCK_TABLE_HEADER *ConfigBlkTblHdrPtr; + UINTN ConfigBlkTblEndAddr; + UINTN ConfigBlkOffset; + CONFIG_BLOCK *TempConfigBlk; + + ConfigBlkTblHdrPtr =3D ConfigBlockTable; + ConfigBlkTblEndAddr =3D (UINTN) ConfigBlockTable + (UINTN) ConfigBlkTblH= drPtr->Header.GuidHob.Header.HobLength; + TempConfigBlk =3D (CONFIG_BLOCK *) ConfigBlock; + ConfigBlkOffset =3D (UINTN) ConfigBlock + (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))) { + return TempConfigBlk; + } + ConfigBlkOffset +=3D (UINTN) TempConfigBlk->Header.GuidHob.Header.HobL= ength; + } + + return NULL; +} -- 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_BYAPR11MB27093FA566CF61539826C9F484049BYAPR11MB2709namp_ 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 GUID.

 

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

Cc: Ray Ni ray.n= i@intel.com

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

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

---

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

.../BaseConfigBlockLib/BaseConfigBlockLib.c &nb= sp; | 54 ++++++++++++++++---

2 files changed, 68 insertions(+), 6 deletions(-)

 

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

index 37a396816..64a13bca9 100644

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

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

@@ -9,6 +9,8 @@

#ifndef _CONFIG_BLOCK_LIB_H_

#define _CONFIG_BLOCK_LIB_H_

+#include <ConfigBlock.h>

+

/**

   Create config block table.

@@ -61,4 +63,22 @@ GetConfigBlock (

   OUT    VOID  &= nbsp;   **ConfigBlockAddress

   );

+/**

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

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

+

+  @param[in]    ConfigBlockTabl= e  A pointer to the beginning of Config Block Table

+  @param[in]    ConfigBlock&nbs= p;      A pointer to the Config Block, against whi= ch the search begins

+  @param[in]    TargetGuid = ;       A pointer to the Guid of Config Block= to find

+

+  @return      &= nbsp;           &nbs= p;      Pointer to config block, or NULL if config= block of given guid was not found

+**/

+CONFIG_BLOCK*

+EFIAPI

+GetNextConfigBlock (

+  IN CONFIG_BLOCK_TABLE_HEADER  &nbs= p; *ConfigBlockTable,

+  IN CONFIG_BLOCK     = ;            *Config= Block,

+  IN EFI_GUID     &nb= sp;            =    *TargetGuid

+  );

+

#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 c89699ea4..30847d561 100644

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

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

@@ -5,7 +5,6 @@ Copyright (c) 2017 - 2019, Intel Cor= poration. All rights reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent

 **/

-#include <ConfigBlock.h>

#include <Library/ConfigBlockLib.h>=

#include <Library/BaseMemoryLib.h><= /p>

#include <Library/MemoryAllocationLib.h><= /o:p>

@@ -14,12 +13,12 @@ SPDX-License-Identifier: BSD-2-C= lause-Patent

/**

   Create config block table.

-  @param[in]     TotalSize=             &nb= sp;       - Max size to be allocated for the = Config Block Table

-  @param[out]    ConfigBlockTab= leAddress      - On return, points to a pointer to= the beginning of Config Block Table Address

+  @param[in]     TotalSize=             &n= bsp;  Max size to be allocated for the Config Block Table

+  @param[out]    ConfigBlockTab= leAddress  On return, points to a pointer to the beginning of Config B= lock Table Address

-  @retval EFI_INVALID_PARAMETER - Invalid Para= meter

-  @retval EFI_OUT_OF_RESOURCES  - Out of = resources

-  @retval EFI_SUCCESS    &= nbsp;      - Successfully created Config Block Tab= le at ConfigBlockTableAddress

+  @retval EFI_INVALID_PARAMETER  &nb= sp;        Invalid Parameter<= /p>

+  @retval EFI_OUT_OF_RESOURCES  &nbs= p;         Out of resources

+  @retval EFI_SUCCESS    &= nbsp;           &nbs= p;    Successfully created Config Block Table at ConfigBlock= TableAddress

**/

EFI_STATUS

EFIAPI

@@ -137,3 +136,46 @@ GetConfigBlock (

   return EFI_NOT_FOUND;

}

+

+

+/**

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

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

+

+  @param[in]    ConfigBlockTabl= e  A pointer to the beginning of Config Block Table

+  @param[in]    ConfigBlock&nbs= p;      A pointer to the Config Block, against whi= ch the search begins

+  @param[in]    TargetGuid = ;       A pointer to the Guid of Config Block= to find

+

+  @return      &= nbsp;           &nbs= p;      Pointer to config block, or NULL if config= block of given guid was not found

+**/

+CONFIG_BLOCK*

+EFIAPI

+GetNextConfigBlock (

+  IN CONFIG_BLOCK_TABLE_HEADER  &nbs= p; *ConfigBlockTable,

+  IN CONFIG_BLOCK     = ;            *Config= Block,

+  IN EFI_GUID     &nb= sp;            =    *TargetGuid

+  )

+{

+  CONFIG_BLOCK_TABLE_HEADER    = *ConfigBlkTblHdrPtr;

+  UINTN      &nb= sp;            =       ConfigBlkTblEndAddr;

+  UINTN      &nb= sp;            =       ConfigBlkOffset;

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

+

+  ConfigBlkTblHdrPtr =3D ConfigBlockTable;

+  ConfigBlkTblEndAddr =3D (UINTN) ConfigBlockT= able + (UINTN) ConfigBlkTblHdrPtr->Header.GuidHob.Header.HobLength;=

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

+  ConfigBlkOffset =3D (UINTN) ConfigBlock + (U= INTN) TempConfigBlk->Header.GuidHob.Header.HobLength;

+

+  //

+  // Loop until exceeding ConfigBlockTable ran= ge

+  //

+  while (ConfigBlkOffset < ConfigBlkTblEndA= ddr) {

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

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

+      return TempConfigBlk= ;

+    }

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

+  }

+

+  return NULL;

+}

--

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_BYAPR11MB27093FA566CF61539826C9F484049BYAPR11MB2709namp_--