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 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 + @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 + @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) { + 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.