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.web11.450.1645551266848873140 for ; Tue, 22 Feb 2022 09:34:27 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=A2Lp3OoO; spf=pass (domain: intel.com, ip: 134.134.136.65, 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=1645551266; x=1677087266; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=Sjqn8RTJrkRScbY/seqCryUCPn2Kub+iEsWHYrooW3s=; b=A2Lp3OoOeSblPbKknLZ+OgeZCIrnbYPgeIKrm+LbGYWT3nsMPr4zV8EO VTyePVFWFae7nu+3d3zAY2N6T4lpcNgFGRbvYZzru1m6+dneQD6j4Zr2S gQad2qIMrcOhuTtY7dzmTgCqFvkO84Stk+2TY5un3ExYFjWF6MUV4iaHG ak/tQwqnwat4febvivTyKkZ/ZynkR36I+6aRa8U1wQPwR2yLwWegR3yL4 Tee24kYHC+mYjhtWPjOTz98w1R2J6yx/s0FQCRLfGGCkpEQSi4pEhh+Gm R505kMqV1sWKSFfWNqqcCKI9N7h/ayWMautRDgGL3aOdJFOXUCp1ol7lY w==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="251685273" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="251685273" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 09:34:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="573515067" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga001.jf.intel.com with ESMTP; 22 Feb 2022 09:34:25 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 22 Feb 2022 09:34:25 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 22 Feb 2022 09:34:25 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.49) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 22 Feb 2022 09:34:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hhSb2J2XvGQHss2zZYnjnitzIex2a1TJ2EoIzqRpLRnAvsTAK2mBPmbb/O0e279z27yyoepm7eudqRMuRGmEs5ST6e3YTR9PmYhalmMpJGx2yGRso27bmICijOHQKzOqKeIN9ggZj2DQpiVCRSFYAzYMj8EmMB/g1OcXQXX3d1pv8ikg3bMNGCkzz5+ARSZ8Lbrmn2idRijWX2K+mSeI7FOktVA95Fyd+qvPqJk2/ruLcOxLcFugtnvC/DjAygLBKDnvNts58+IG/nCBA80a8LubSx2VvhS+tcJa4/ctIxs7CeRpj1EcQtEyAHQ57ZX6dtK0v0lgTsz9/tosIeJmZA== 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=9FxN2Jne32UXl1qHweN1fyxWhT/I01obwj29ENyiCbs=; b=iV5kFIFf/pYkOw8cyC43SBzB3EydmJO2n8ngZ1McykAAvMyjGjh3J+bLSrintwm/iT2YEX3I49GV0EuJetJ3YtFnWcyw5XK/fo965Y3z3YTzgNJw8XgTNzAnICm88MU3C0wn8qb6I4HjKVK0I0PcfzpQTPZdK6IhEcmjIQetCIImQnqmLmbM8cBP1khRU9SqCJu8CpSBT6oaWKbns+fPoBuqxg7nEwpg1/5LzFslBK+rjJxgbjIunItePb9U4g2Ruy6AIVS2UjdVYdvq9/zP46BS2HySArx8Xqu/Yte6T9QVEMnlETqedPXxcJykZeTa/H/eMR16E5FqAPMCYRmVzA== 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 DM6PR11MB2762.namprd11.prod.outlook.com (2603:10b6:5:c8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Tue, 22 Feb 2022 17:34:23 +0000 Received: from BYAPR11MB2709.namprd11.prod.outlook.com ([fe80::6d80:7596:aa86:73e8]) by BYAPR11MB2709.namprd11.prod.outlook.com ([fe80::6d80:7596:aa86:73e8%4]) with mapi id 15.20.4995.027; Tue, 22 Feb 2022 17:34:22 +0000 From: "Fedorowicz, Jakub" To: "devel@edk2.groups.io" 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: AdgoEkT5CBDM8s6TSU2oC7D0d663MQ== Date: Tue, 22 Feb 2022 17:34:22 +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: 9f5e791d-b38e-4073-475f-08d9f6299092 x-ms-traffictypediagnostic: DM6PR11MB2762: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: 3gpqCT/AgxZSMVYBEG5FIFz+VymOl0XgqjR5TnZc4iFfn6PYnn+2tLH+3qlK9PCVa7pbjv/CBRYXeTksDWYQ3E3FY0l0jTGYmf9+MtiiCAH8SxrRG/Aug7wOp9LgjzVwB8aBG88s/uqk50DowFwgYSgLCAK/vXPWkz3PUKpeqT9rwPsrjx+KP+lm1076Fmw5HzXUTemKIjCac0sngMw0+UPG/xdc6sY8qE0A7MTxf28Mr8TeT7T+hJlRyftmNxElPgj6oGsuut6vEEPsE6EaG4mb2IbLfLqjisGJf+L6nk5ihP+7xIEaLSrF6memBU16zsywCd31ZTFaNDEwKYfcevLUGQE2p3058V/egzK6hLCfzK3IkmG1hO5doXKKCSw8U0oY1LjVwBItuHwKB1+kAmo0nB8lQ5OmJ9IagDWU9SxDKscYvMYbsR+0a1AxFtJIGgZDRSegJdm9lxkhly9kSr0c8Ad1duOiXV47VS8Ogw2KZ+4dWBtn/5Ely6iQu6i4tlK7qU1lNanCAPWtZMSDo2UdZi8YPnKToYHSYvM7GG2zos+u5eJ7csUJHeYBRlbwJB8xXnu3YQObdvsMyR0g3E6B8o9DCx+KFjRj32Q6QfolrRuMAwRSbpwzcP9Q1M+UOx4rGe665jpbwXy2QIR3Idk8Elzb4f+2+YvSwag9GqXR2HtEKcPL3j+TyvKYPiHB0FMlpYSWx1XYk640/jGyUQsHzJ2OqnqoDQRvp4gd1vGGNBpYfrooFRr0pKH4cIwPwcBu8zJg8UoWUzjr+Y8aBSEqJradQb3mLJ4W3jK2yFU= 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)(26005)(186003)(8936002)(83380400001)(66556008)(38100700002)(76116006)(8676002)(316002)(86362001)(52536014)(2906002)(66946007)(6916009)(64756008)(66446008)(66476007)(122000001)(55016003)(33656002)(5660300002)(38070700005)(7696005)(6506007)(9686003)(508600001)(966005)(82960400001)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?urEPEsj1ppgmIChy3Ebo+cKmRn5DHFqmsqmUsehnZWxbWOXF+1BYo91CSAMa?= =?us-ascii?Q?AzX5PwY0DRuJsZxuiEbz+WhnePCB2RqNbqObn9iJz7LxV0fhKP+X6pOqf5TV?= =?us-ascii?Q?pZTVYo7XRA2CNMSlAKSod+jkX1fvnvwPBbTVj7+dspRnEStPaly8qVvbCVwY?= =?us-ascii?Q?c7+8xMknhGMuBEnRwLw3BUTQFV5Mgc1SkoWxwttnE5+Y16xg8a1Q2DrA1YAO?= =?us-ascii?Q?kjiTGTgYRJvytQlg8Pxhs3Kgt0qwmlhC886kMnT3dg9Nl6d8SGa8/GczenYU?= =?us-ascii?Q?kVwXjxBBWRJFlVbuueP6dvB9cFDJGrDHG1hBvlXJEjItC/Si5OodvPWgeuWe?= =?us-ascii?Q?eFZNtwvvzDwliafhxxLxLPz9mhDHgPa/Yi5WcLalbtKDWmbhL3WA9H3K3uph?= =?us-ascii?Q?G4DVZChdfAbPIshEYvm7YVlfbjy7qL+08wfEX9Ll5sgAC53BSV3VEjlficbF?= =?us-ascii?Q?1q+5iaUqCIzw6663zsfR+4dm9ky4WqcnelM1BDxOPvT0oGPriVf/F017Srr3?= =?us-ascii?Q?uOsMmyFk9nT28L0kkJr+UclWcz1JOWuqCHpFEk3BkE7yFM7LPfw4pVtafezk?= =?us-ascii?Q?acD6T6BwzSAzhVFAsCGuDeIwlV3S71KOxRlpdQjX4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ox4821eibKkhABfHwDhEWdmvs+sC/Yh17nSCpvWqc8Wuaz/lYy5DWAxWzGCr?= =?us-ascii?Q?tG7xMV3FTfj5iPEms5WH3wt/OBiktLevS8pcYAztOkEjSTGb3Pzv5XDV3foH?= =?us-ascii?Q?/n8A92IsvRc2el+j5X6IrnlldbXK4eg4oQDtwtgUVSds67qAy3NaSvUVw11H?= =?us-ascii?Q?psRsmg=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: 9f5e791d-b38e-4073-475f-08d9f6299092 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2022 17:34:22.8452 (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: RrFydUX1D3i3ZBP7AMUs7ao+1iNZZjId7lS3ieuCok4XzdYSiSWsHR9t2rcEpwDWwcHgGOgSq+NUY+jdwc2VabdNoM99MH9Wpjr+dKfAQM8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2762 Return-Path: jakub.fedorowicz@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" 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 Cc: Rangasai V Chaganty Signed-off-by: Jakub Fedorowicz --- .../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/BaseConfi +++ gBlockLib.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) = + ConfigBlkTblHdrPtr->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.HobLength; + } + + 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.