summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-23 06:26:50 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-23 06:26:50 +0000
commitbbc0f1bb24d1685a72f99a98ec1ae86e95891bb0 (patch)
treef54ca352462e6fa2af00b9a669d420f889dd5d31 /MdeModulePkg
parent07ad9b81e3746c67d10696b0574c8010e11a5762 (diff)
downloadedk2-platforms-bbc0f1bb24d1685a72f99a98ec1ae86e95891bb0.tar.xz
Allow DXE dispatcher to ignore EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE type FFS file found in EFI_HOB_FIRMWARE_VOLUME2 HOB.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3694 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
index 9792a16485..d3d50ec7c2 100644
--- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
@@ -786,6 +786,59 @@ Returns:
return EFI_SUCCESS;
}
+STATIC
+BOOLEAN
+FvFoundInHobFv2 (
+ IN EFI_HANDLE FvHandle,
+ IN CONST EFI_GUID *DriverName
+ )
+/*++
+
+Routine Description:
+
+ Check if a FV Image type file (EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) is
+ described by a EFI_HOB_FIRMWARE_VOLUME2 Hob.
+
+Arguments:
+
+ FvHandle - The handle which FVB protocol installed on.
+ DriverName - The driver guid specified.
+
+Returns:
+
+ TRUE - This file is found in a EFI_HOB_FIRMWARE_VOLUME2 Hob.
+
+ FALSE - Not found.
+
+
+--*/
+{
+ EFI_PEI_HOB_POINTERS HobFv2;
+ EFI_STATUS Status;
+ EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
+ EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
+ EFI_PHYSICAL_ADDRESS FvHeaderAddr;
+
+ HobFv2.Raw = GetHobList ();
+
+ while ((HobFv2.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobFv2.Raw)) != NULL) {
+ if (CompareGuid (DriverName, &HobFv2.FirmwareVolume2->FileName)) {
+ Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolumeBlockProtocolGuid, &Fvb);
+ if (!EFI_ERROR (Status)) {
+ Status = Fvb->GetPhysicalAddress (Fvb, &FvHeaderAddr);
+ if (!EFI_ERROR (Status)) {
+ FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) FvHeaderAddr;
+ if (CompareGuid (&FvHeader->FileSystemGuid, &HobFv2.FirmwareVolume2->FvName)) {
+ return TRUE;
+ }
+ }
+ }
+ }
+ HobFv2.Raw = GET_NEXT_HOB (HobFv2);
+ }
+
+ return FALSE;
+}
EFI_STATUS
@@ -1039,6 +1092,14 @@ Returns:
}
} else if (Type == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) {
//
+ // Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has already
+ // been extracted.
+ //
+ if (FvFoundInHobFv2 (FvHandle, &NameGuid)) {
+ continue;
+ }
+
+ //
// Found a firmware volume image. Produce a firmware volume block
// protocol for it so it gets dispatched from. This is usually a
// capsule.