summaryrefslogtreecommitdiffstats
path: root/IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c
diff options
context:
space:
mode:
authorYao, Jiewen <Jiewen.Yao@intel.com>2015-07-28 07:26:57 +0000
committerjyao1 <jyao1@Edk2>2015-07-28 07:26:57 +0000
commit00899456b809b7a0809e92d3e020435eece0effd (patch)
treef94621310e7cc08b550e906e64aa35fc5ce1e616 /IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c
parent71a6022f690da06e7453489c2b9158f18b7163f3 (diff)
downloadedk2-00899456b809b7a0809e92d3e020435eece0effd.tar.gz
edk2-00899456b809b7a0809e92d3e020435eece0effd.tar.bz2
edk2-00899456b809b7a0809e92d3e020435eece0effd.zip
FspNotifyDxe need handle >4G memory.
The FSP API is always 32bit, but FspNotifyDxe might load to >4G memory. In order to make thunk work, we need reload FspNotifyDxe to <4G memory. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com> Reviewed-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18094 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c')
-rw-r--r--IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c24
1 files changed, 24 insertions, 0 deletions
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 <Library/UefiLib.h>
#include <Library/FspApiLib.h>
+/**
+ 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 {