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
This commit is contained in:
Yao, Jiewen
2015-07-28 07:26:57 +00:00
committed by jyao1
parent 71a6022f69
commit 00899456b8
4 changed files with 182 additions and 0 deletions

View File

@@ -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 {