summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-11 07:36:24 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-11 07:36:24 +0000
commitb2821d6b646488e49d7a741891a38c2985e0a1ec (patch)
tree7c97a071977d0c632c5d3d0e5a2c372968ff4893 /MdeModulePkg
parenta2ddd00bfec1fa0f16da093e72a5277641e39470 (diff)
downloadedk2-platforms-b2821d6b646488e49d7a741891a38c2985e0a1ec.tar.xz
Only build FvHob for the extracted FvImage those parent Fv image has FvHob.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5625 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index a4ed45af52..9c1aab916f 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -814,7 +814,7 @@ ProcessFvFile (
EFI_FV_INFO FvImageInfo;
UINT32 FvAlignment;
VOID *FvBuffer;
- EFI_PEI_HOB_POINTERS HobFv2;
+ EFI_PEI_HOB_POINTERS HobPtr;
FvBuffer = NULL;
*AuthenticationState = 0;
@@ -823,15 +823,15 @@ ProcessFvFile (
// Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has already
// been extracted.
//
- HobFv2.Raw = GetHobList ();
- while ((HobFv2.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobFv2.Raw)) != NULL) {
- if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobFv2.FirmwareVolume2->FileName)) {
+ HobPtr.Raw = GetHobList ();
+ while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobPtr.Raw)) != NULL) {
+ if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobPtr.FirmwareVolume2->FileName)) {
//
// this FILE has been dispatched, it will not be dispatched again.
//
return EFI_SUCCESS;
}
- HobFv2.Raw = GET_NEXT_HOB (HobFv2);
+ HobPtr.Raw = GET_NEXT_HOB (HobPtr);
}
//
@@ -886,12 +886,24 @@ ProcessFvFile (
);
//
- // Inform HOB consumer phase, i.e. DXE core, the existance of this FV
+ // Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase
+ // based on its parent Fvimage is informed or not.
+ // If FvHob of its parent fvimage is built, the extracted FvImage will be built also.
+ // Or, the extracted FvImage will not be built.
//
- BuildFvHob (
- (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
- FvImageInfo.FvSize
- );
+ HobPtr.Raw = GetHobList ();
+ while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV, HobPtr.Raw)) != NULL) {
+ if (((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle > HobPtr.FirmwareVolume->BaseAddress) &&
+ ((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle < HobPtr.FirmwareVolume->BaseAddress + HobPtr.FirmwareVolume->Length)) {
+ BuildFvHob (
+ (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
+ FvImageInfo.FvSize
+ );
+ break;
+ }
+ HobPtr.Raw = GET_NEXT_HOB (HobPtr);
+ }
+
//
// Makes the encapsulated volume show up in DXE phase to skip processing of
// encapsulated file again.