]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspWrapperPkg/FspNotifyDxe/FspNotifyDxe.c
FspNotifyDxe need handle >4G memory.
[mirror_edk2.git] / IntelFspWrapperPkg / FspNotifyDxe / FspNotifyDxe.c
index f8e8e826f135a3491b087cb7e97d53ba6b4a094a..1a1e4e625890e809fcde69a699a5f44532d7af32 100644 (file)
 #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
@@ -120,6 +136,14 @@ FspDxeEntryPoint (
   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