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 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> #include <Library/MemoryAllocationLib.h> @@ -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 + @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
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-#include
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.