#include <Library/UefiLib.h>\r
#include <Library/FspApiLib.h>\r
\r
+/**\r
+ Relocate this image under 4G memory.\r
+\r
+ @param ImageHandle Handle of driver image.\r
+ @param SystemTable Pointer to system table.\r
+\r
+ @retval EFI_SUCCESS Image successfully relocated.\r
+ @retval EFI_ABORTED Failed to relocate image.\r
+\r
+**/\r
+EFI_STATUS\r
+RelocateImageUnder4GIfNeeded (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
FSP_INFO_HEADER *mFspHeader = NULL;\r
\r
/**\r
VOID *Registration;\r
EFI_EVENT ProtocolNotifyEvent;\r
\r
+ //\r
+ // Load this driver's image to memory\r
+ //\r
+ Status = RelocateImageUnder4GIfNeeded (ImageHandle, SystemTable);\r
+ if (EFI_ERROR (Status)) {\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
if (PcdGet32 (PcdFlashFvSecondFspBase) == 0) {\r
mFspHeader = FspFindFspHeader (PcdGet32 (PcdFlashFvFspBase));\r
} else {\r