X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFspWrapperPkg%2FFspNotifyDxe%2FFspNotifyDxe.c;h=1a1e4e625890e809fcde69a699a5f44532d7af32;hp=f8e8e826f135a3491b087cb7e97d53ba6b4a094a;hb=00899456b809b7a0809e92d3e020435eece0effd;hpb=5c7c41f81d4b89a90dadc01b3c3f4481251852a2;ds=sidebyside diff --git a/IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c b/IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c index f8e8e826f1..1a1e4e6258 100644 --- a/IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c +++ b/IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c @@ -23,6 +23,22 @@ #include #include +/** + Relocate this image under 4G memory. + + @param ImageHandle Handle of driver image. + @param SystemTable Pointer to system table. + + @retval EFI_SUCCESS Image successfully relocated. + @retval EFI_ABORTED Failed to relocate image. + +**/ +EFI_STATUS +RelocateImageUnder4GIfNeeded ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + FSP_INFO_HEADER *mFspHeader = NULL; /** @@ -120,6 +136,14 @@ FspDxeEntryPoint ( VOID *Registration; EFI_EVENT ProtocolNotifyEvent; + // + // Load this driver's image to memory + // + Status = RelocateImageUnder4GIfNeeded (ImageHandle, SystemTable); + if (EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + if (PcdGet32 (PcdFlashFvSecondFspBase) == 0) { mFspHeader = FspFindFspHeader (PcdGet32 (PcdFlashFvFspBase)); } else {