/** @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
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
\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
UINT32 DataVirtualAddress;\r
EFI_PHYSICAL_ADDRESS LinkTimeBaseAddress;\r
\r
- \r
//\r
// Init local variable\r
//\r
//\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
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
}\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
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
WriteMapFile (\r
FvMapFile, \r
PdbPointer, \r
- (EFI_GUID *) FfsFile,\r
+ FfsFile,\r
NewPe32BaseAddress, \r
&OrigImageContext\r
);\r