]> git.proxmox.com Git - mirror_edk2.git/blobdiff - InOsEmuPkg/Unix/Sec/SecMain.c
InOsEmuPkg: Make build dir different for IA-32. Fix PCD XIP issues.
[mirror_edk2.git] / InOsEmuPkg / Unix / Sec / SecMain.c
index 4b6cb98e839cc137fa6234fcb26168529b24f1d6..bf594892fb6c25a90a65d328bf2f46a466dec7c7 100644 (file)
@@ -439,7 +439,7 @@ MapFd0 (
   
   // Map the rest of the FD as read/write
   res2 = mmap (
-          (void *)(FixedPcdGet64 (PcdEmuFlashFvRecoveryBase) + FvSize), 
+          (void *)(UINTN)(FixedPcdGet64 (PcdEmuFlashFvRecoveryBase) + FvSize), 
           FileSize - FvSize, 
           PROT_READ | PROT_WRITE | PROT_EXEC, 
           MAP_SHARED,
@@ -670,19 +670,19 @@ SecPeCoffGetEntryPoint (
   }
 
   if (ImageContext.ImageAddress != (UINTN)Pe32Data) {
-  //
-  // Relocate image to match the address where it resides
-  //
-  ImageContext.ImageAddress = (UINTN)Pe32Data;
-  Status = PeCoffLoaderLoadImage (&ImageContext);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
+    //
+    // Relocate image to match the address where it resides
+    //
+    ImageContext.ImageAddress = (UINTN)Pe32Data;
+    Status = PeCoffLoaderLoadImage (&ImageContext);
+    if (EFI_ERROR (Status)) {
+      return Status;
+    }
 
-  Status = PeCoffLoaderRelocateImage (&ImageContext);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
+    Status = PeCoffLoaderRelocateImage (&ImageContext);
+    if (EFI_ERROR (Status)) {
+      return Status;
+    }
   } else {
     //
     // Or just return image entry point