]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFv/GenFvInternalLib.c
Clean up MdeModuleHii.h to remove HII_VENDOR_DEVICE_PATH and remove DevicePath.h...
[mirror_edk2.git] / BaseTools / Source / C / GenFv / GenFvInternalLib.c
index 00d008573a3c65f0a0772d7ea068a3e47edce612..189dc431ebda71baf86514f0b87541003f00822b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -677,7 +677,7 @@ EFI_STATUS
 WriteMapFile (\r
   IN OUT FILE                  *FvMapFile,\r
   IN     CHAR8                 *FileName,\r
-  IN     EFI_GUID              *FileGuidPtr\r
+  IN     EFI_FFS_FILE_HEADER   *FfsFile\r
   IN     EFI_PHYSICAL_ADDRESS  ImageBaseAddress,\r
   IN     PE_COFF_LOADER_IMAGE_CONTEXT *pImageContext\r
   )\r
@@ -692,7 +692,7 @@ Arguments:
 \r
   FvMapFile             A pointer to FvMap File\r
   FileName              Ffs File PathName\r
-  FileGuidPtr           Guid Value of Ffs file\r
+  FfsFile               A pointer to Ffs file image.\r
   ImageBaseAddress      PeImage Base Address.\r
   pImageContext         Image Context Information.\r
 \r
@@ -723,7 +723,6 @@ Returns:
   UINT32                              DataVirtualAddress;\r
   EFI_PHYSICAL_ADDRESS                LinkTimeBaseAddress;\r
 \r
-  \r
   //\r
   // Init local variable\r
   //\r
@@ -731,7 +730,7 @@ Returns:
   //\r
   // Print FileGuid to string buffer. \r
   //\r
-  PrintGuidToBuffer (FileGuidPtr, (UINT8 *)FileGuidName, MAX_LINE_LEN, TRUE);\r
+  PrintGuidToBuffer (&FfsFile->Name, (UINT8 *)FileGuidName, MAX_LINE_LEN, TRUE);\r
   \r
   //\r
   // Construct Map file Name \r
@@ -808,7 +807,16 @@ Returns:
     fprintf (FvMapFile, "%s (Fixed Flash Address, ", KeyWord);\r
     fprintf (FvMapFile, "BaseAddress=0x%010llx, ", (unsigned long long) (ImageBaseAddress + Offset));\r
   }\r
-  fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint));\r
+\r
+  if (FfsFile->Type != EFI_FV_FILETYPE_SECURITY_CORE && pImageContext->Machine == EFI_IMAGE_MACHINE_IA64) {\r
+    //\r
+    // Process IPF PLABEL to get the real address after the image has been rebased. \r
+    // PLABEL structure is got by AddressOfEntryPoint offset to ImageBuffer stored in pImageContext->Handle.\r
+    //\r
+    fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (*(UINT64 *)((UINTN) pImageContext->Handle + (UINTN) AddressOfEntryPoint)));\r
+  } else {\r
+    fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint));\r
+  }\r
   fprintf (FvMapFile, ")\n"); \r
   \r
   fprintf (FvMapFile, "(GUID=%s", FileGuidName);\r
@@ -1815,7 +1823,7 @@ Returns:
   }\r
   \r
   // Add opcode for an uncondional branch with no link. AKA B SecEntryPoint\r
-  ResetVector[0] |= 0xEA000000;\r
+  ResetVector[0] |= 0xEB000000;\r
   \r
   \r
   // Address of PEI Core, if we have one\r
@@ -3094,7 +3102,7 @@ Returns:
       PdbPointer = FileName;\r
     }\r
 \r
-    WriteMapFile (FvMapFile, PdbPointer, (EFI_GUID *) FfsFile, NewPe32BaseAddress, &OrigImageContext);\r
+    WriteMapFile (FvMapFile, PdbPointer, FfsFile, NewPe32BaseAddress, &OrigImageContext);\r
   }\r
 \r
   if (FfsFile->Type != EFI_FV_FILETYPE_SECURITY_CORE &&\r
@@ -3320,7 +3328,7 @@ Returns:
     WriteMapFile (\r
       FvMapFile, \r
       PdbPointer, \r
-      (EFI_GUID *) FfsFile,\r
+      FfsFile,\r
       NewPe32BaseAddress, \r
       &OrigImageContext\r
       );\r