/** @file\r
+This file contains describes the public interfaces to the GenFvImage Library.\r
+The basic purpose of the library is to create Firmware Volume images.\r
\r
-Copyright (c) 2004 - 2008, Intel Corporation \r
-All rights reserved. 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
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2004 - 2018, 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
\r
-Module Name:\r
- \r
- GenFvInternalLib.h\r
-\r
-Abstract:\r
-\r
- This file contains describes the public interfaces to the GenFvImage Library.\r
- The basic purpose of the library is to create Firmware Volume images.\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
#define OPTIONS_SECTION_STRING "[options]"\r
#define ATTRIBUTES_SECTION_STRING "[attributes]"\r
#define FILES_SECTION_STRING "[files]"\r
+#define FV_BASE_ADDRESS_STRING "[FV_BASE_ADDRESS]"\r
\r
//\r
// Options section\r
#define EFI_BLOCK_SIZE_STRING "EFI_BLOCK_SIZE"\r
#define EFI_GUID_STRING "EFI_GUID"\r
#define EFI_FV_FILESYSTEMGUID_STRING "EFI_FV_GUID"\r
-#define EFI_FV_NAMEGUID_STRING "EFI_FVNAME_GUID" \r
+#define EFI_FV_NAMEGUID_STRING "EFI_FVNAME_GUID"\r
#define EFI_CAPSULE_GUID_STRING "EFI_CAPSULE_GUID"\r
#define EFI_CAPSULE_HEADER_SIZE_STRING "EFI_CAPSULE_HEADER_SIZE"\r
#define EFI_CAPSULE_FLAGS_STRING "EFI_CAPSULE_FLAGS"\r
+#define EFI_OEM_CAPSULE_FLAGS_STRING "EFI_OEM_CAPSULE_FLAGS"\r
#define EFI_CAPSULE_VERSION_STRING "EFI_CAPSULE_VERSION"\r
-#define EFI_FV_BOOT_DRIVER_BASE_ADDRESS_STRING "EFI_BOOT_DRIVER_BASE_ADDRESS"\r
-#define EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING "EFI_RUNTIME_DRIVER_BASE_ADDRESS"\r
\r
#define EFI_FV_TOTAL_SIZE_STRING "EFI_FV_TOTAL_SIZE"\r
#define EFI_FV_TAKEN_SIZE_STRING "EFI_FV_TAKEN_SIZE"\r
#define EFI_FVB2_WRITE_LOCK_CAP_STRING "EFI_WRITE_LOCK_CAP"\r
#define EFI_FVB2_WRITE_LOCK_STATUS_STRING "EFI_WRITE_LOCK_STATUS"\r
\r
-#define EFI_FVB2_ALIGNMENT_1_STRING "EFI_FVB2_ALIGNMENT_1" \r
-#define EFI_FVB2_ALIGNMENT_2_STRING "EFI_FVB2_ALIGNMENT_2" \r
-#define EFI_FVB2_ALIGNMENT_4_STRING "EFI_FVB2_ALIGNMENT_4" \r
-#define EFI_FVB2_ALIGNMENT_8_STRING "EFI_FVB2_ALIGNMENT_8" \r
-#define EFI_FVB2_ALIGNMENT_16_STRING "EFI_FVB2_ALIGNMENT_16" \r
-#define EFI_FVB2_ALIGNMENT_32_STRING "EFI_FVB2_ALIGNMENT_32" \r
-#define EFI_FVB2_ALIGNMENT_64_STRING "EFI_FVB2_ALIGNMENT_64" \r
-#define EFI_FVB2_ALIGNMENT_128_STRING "EFI_FVB2_ALIGNMENT_128" \r
-#define EFI_FVB2_ALIGNMENT_256_STRING "EFI_FVB2_ALIGNMENT_256" \r
-#define EFI_FVB2_ALIGNMENT_512_STRING "EFI_FVB2_ALIGNMENT_512" \r
-#define EFI_FVB2_ALIGNMENT_1K_STRING "EFI_FVB2_ALIGNMENT_1K" \r
-#define EFI_FVB2_ALIGNMENT_2K_STRING "EFI_FVB2_ALIGNMENT_2K" \r
-#define EFI_FVB2_ALIGNMENT_4K_STRING "EFI_FVB2_ALIGNMENT_4K" \r
-#define EFI_FVB2_ALIGNMENT_8K_STRING "EFI_FVB2_ALIGNMENT_8K" \r
-#define EFI_FVB2_ALIGNMENT_16K_STRING "EFI_FVB2_ALIGNMENT_16K" \r
-#define EFI_FVB2_ALIGNMENT_32K_STRING "EFI_FVB2_ALIGNMENT_32K" \r
-#define EFI_FVB2_ALIGNMENT_64K_STRING "EFI_FVB2_ALIGNMENT_64K" \r
+#define EFI_FVB2_ALIGNMENT_1_STRING "EFI_FVB2_ALIGNMENT_1"\r
+#define EFI_FVB2_ALIGNMENT_2_STRING "EFI_FVB2_ALIGNMENT_2"\r
+#define EFI_FVB2_ALIGNMENT_4_STRING "EFI_FVB2_ALIGNMENT_4"\r
+#define EFI_FVB2_ALIGNMENT_8_STRING "EFI_FVB2_ALIGNMENT_8"\r
+#define EFI_FVB2_ALIGNMENT_16_STRING "EFI_FVB2_ALIGNMENT_16"\r
+#define EFI_FVB2_ALIGNMENT_32_STRING "EFI_FVB2_ALIGNMENT_32"\r
+#define EFI_FVB2_ALIGNMENT_64_STRING "EFI_FVB2_ALIGNMENT_64"\r
+#define EFI_FVB2_ALIGNMENT_128_STRING "EFI_FVB2_ALIGNMENT_128"\r
+#define EFI_FVB2_ALIGNMENT_256_STRING "EFI_FVB2_ALIGNMENT_256"\r
+#define EFI_FVB2_ALIGNMENT_512_STRING "EFI_FVB2_ALIGNMENT_512"\r
+#define EFI_FVB2_ALIGNMENT_1K_STRING "EFI_FVB2_ALIGNMENT_1K"\r
+#define EFI_FVB2_ALIGNMENT_2K_STRING "EFI_FVB2_ALIGNMENT_2K"\r
+#define EFI_FVB2_ALIGNMENT_4K_STRING "EFI_FVB2_ALIGNMENT_4K"\r
+#define EFI_FVB2_ALIGNMENT_8K_STRING "EFI_FVB2_ALIGNMENT_8K"\r
+#define EFI_FVB2_ALIGNMENT_16K_STRING "EFI_FVB2_ALIGNMENT_16K"\r
+#define EFI_FVB2_ALIGNMENT_32K_STRING "EFI_FVB2_ALIGNMENT_32K"\r
+#define EFI_FVB2_ALIGNMENT_64K_STRING "EFI_FVB2_ALIGNMENT_64K"\r
#define EFI_FVB2_ALIGNMENT_128K_STRING "EFI_FVB2_ALIGNMENT_128K"\r
#define EFI_FVB2_ALIGNMENT_256K_STRING "EFI_FVB2_ALIGNMENT_256K"\r
-#define EFI_FVB2_ALIGNMNET_512K_STRING "EFI_FVB2_ALIGNMENT_512K"\r
-#define EFI_FVB2_ALIGNMENT_1M_STRING "EFI_FVB2_ALIGNMENT_1M" \r
-#define EFI_FVB2_ALIGNMENT_2M_STRING "EFI_FVB2_ALIGNMENT_2M" \r
-#define EFI_FVB2_ALIGNMENT_4M_STRING "EFI_FVB2_ALIGNMENT_4M" \r
-#define EFI_FVB2_ALIGNMENT_8M_STRING "EFI_FVB2_ALIGNMENT_8M" \r
-#define EFI_FVB2_ALIGNMENT_16M_STRING "EFI_FVB2_ALIGNMENT_16M" \r
-#define EFI_FVB2_ALIGNMENT_32M_STRING "EFI_FVB2_ALIGNMENT_32M" \r
-#define EFI_FVB2_ALIGNMENT_64M_STRING "EFI_FVB2_ALIGNMENT_64M" \r
+#define EFI_FVB2_ALIGNMENT_512K_STRING "EFI_FVB2_ALIGNMENT_512K"\r
+#define EFI_FVB2_ALIGNMENT_1M_STRING "EFI_FVB2_ALIGNMENT_1M"\r
+#define EFI_FVB2_ALIGNMENT_2M_STRING "EFI_FVB2_ALIGNMENT_2M"\r
+#define EFI_FVB2_ALIGNMENT_4M_STRING "EFI_FVB2_ALIGNMENT_4M"\r
+#define EFI_FVB2_ALIGNMENT_8M_STRING "EFI_FVB2_ALIGNMENT_8M"\r
+#define EFI_FVB2_ALIGNMENT_16M_STRING "EFI_FVB2_ALIGNMENT_16M"\r
+#define EFI_FVB2_ALIGNMENT_32M_STRING "EFI_FVB2_ALIGNMENT_32M"\r
+#define EFI_FVB2_ALIGNMENT_64M_STRING "EFI_FVB2_ALIGNMENT_64M"\r
#define EFI_FVB2_ALIGNMENT_128M_STRING "EFI_FVB2_ALIGNMENT_128M"\r
#define EFI_FVB2_ALIGNMENT_256M_STRING "EFI_FVB2_ALIGNMENT_256M"\r
#define EFI_FVB2_ALIGNMENT_512M_STRING "EFI_FVB2_ALIGNMENT_512M"\r
-#define EFI_FVB2_ALIGNMENT_1G_STRING "EFI_FVB2_ALIGNMENT_1G" \r
-#define EFI_FVB2_ALIGNMENT_2G_STRING "EFI_FVB2_ALIGNMENT_2G" \r
+#define EFI_FVB2_ALIGNMENT_1G_STRING "EFI_FVB2_ALIGNMENT_1G"\r
+#define EFI_FVB2_ALIGNMENT_2G_STRING "EFI_FVB2_ALIGNMENT_2G"\r
+\r
+#define EFI_FV_WEAK_ALIGNMENT_STRING "EFI_WEAK_ALIGNMENT"\r
\r
//\r
// File sections\r
// VTF (Firmware Volume Top File) signatures\r
//\r
#define IA32_X64_VTF_SIGNATURE_OFFSET 0x14\r
-#define IA32_X64_VTF0_SIGNATURE EFI_SIGNATURE_32('V','T','F',0)\r
+#define IA32_X64_VTF0_SIGNATURE SIGNATURE_32('V','T','F',0)\r
\r
//\r
// Defines to calculate the offset for PEI CORE entry points\r
#define FIT_TYPE_MASK 0x7F\r
#define CHECKSUM_BIT_MASK 0x80\r
\r
-//\r
-// Rebase File type\r
-//\r
-#define REBASE_XIP_FILE 0x1\r
-#define REBASE_BOOTTIME_FILE 0x2\r
-#define REBASE_RUNTIME_FILE 0x4\r
-\r
//\r
// Private data types\r
//\r
//\r
typedef struct {\r
UINTN Size;\r
- CHAR8 ComponentName[_MAX_PATH];\r
+ CHAR8 ComponentName[MAX_LONG_FILE_PATH];\r
} COMPONENT_INFO;\r
\r
//\r
typedef struct {\r
BOOLEAN BaseAddressSet;\r
EFI_PHYSICAL_ADDRESS BaseAddress;\r
- EFI_PHYSICAL_ADDRESS BootBaseAddress;\r
- EFI_PHYSICAL_ADDRESS RuntimeBaseAddress; \r
EFI_GUID FvFileSystemGuid;\r
BOOLEAN FvFileSystemGuidSet;\r
EFI_GUID FvNameGuid;\r
BOOLEAN FvNameGuidSet;\r
- CHAR8 FvExtHeaderFile[_MAX_PATH];\r
+ CHAR8 FvExtHeaderFile[MAX_LONG_FILE_PATH];\r
UINTN Size;\r
- EFI_FVB_ATTRIBUTES FvAttributes;\r
- CHAR8 FvName[_MAX_PATH];\r
+ EFI_FVB_ATTRIBUTES_2 FvAttributes;\r
+ CHAR8 FvName[MAX_LONG_FILE_PATH];\r
EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];\r
- CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];\r
+ CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][MAX_LONG_FILE_PATH];\r
UINT32 SizeofFvFiles[MAX_NUMBER_OF_FILES_IN_FV];\r
BOOLEAN IsPiFvImage;\r
+ INT8 ForceRebase;\r
} FV_INFO;\r
\r
typedef struct {\r
EFI_GUID CapGuid;\r
UINT32 HeaderSize;\r
UINT32 Flags;\r
- CHAR8 CapName[_MAX_PATH];\r
- CHAR8 CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][_MAX_PATH];\r
+ CHAR8 CapName[MAX_LONG_FILE_PATH];\r
+ CHAR8 CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][MAX_LONG_FILE_PATH];\r
} CAP_INFO;\r
\r
#pragma pack(1)\r
extern FV_INFO mFvDataInfo;\r
extern CAP_INFO mCapDataInfo;\r
extern EFI_GUID mEfiFirmwareFileSystem2Guid;\r
+extern EFI_GUID mEfiFirmwareFileSystem3Guid;\r
extern UINT32 mFvTotalSize;\r
extern UINT32 mFvTakenSize;\r
+\r
+extern EFI_PHYSICAL_ADDRESS mFvBaseAddress[];\r
+extern UINT32 mFvBaseAddressNumber;\r
//\r
// Local function prototypes\r
//\r
FindApResetVectorPosition (\r
IN MEMORY_FILE *FvImage,\r
OUT UINT8 **Pointer\r
- ); \r
+ );\r
\r
EFI_STATUS\r
CalculateFvSize (\r
);\r
\r
EFI_STATUS\r
-FfsRebase ( \r
- IN OUT FV_INFO *FvInfo, \r
- IN CHAR8 *FileName, \r
+FfsRebase (\r
+ IN OUT FV_INFO *FvInfo,\r
+ IN CHAR8 *FileName,\r
IN OUT EFI_FFS_FILE_HEADER *FfsFile,\r
IN UINTN XipOffset,\r
IN FILE *FvMapFile\r
\r
Routine Description:\r
\r
- This is the main function which will be called from application to \r
+ This is the main function which will be called from application to\r
generate UEFI Capsule image.\r
\r
Arguments:\r
GenerateFvImage (\r
IN CHAR8 *InfFileImage,\r
IN UINTN InfFileSize,\r
- IN CHAR8 *FvFileName, \r
+ IN CHAR8 *FvFileName,\r
IN CHAR8 *MapFileName\r
)\r
/*++\r
\r
Routine Description:\r
\r
- This is the main function which will be called from application to \r
+ This is the main function which will be called from application to\r
generate Firmware Image conforms to PI spec.\r
\r
Arguments:\r
InfFileSize Size of the contents of the InfFileImage buffer.\r
FvFileName Requested name for the FV file.\r
MapFileName Fv map file to log fv driver information.\r
- \r
+\r
Returns:\r
- \r
+\r
EFI_SUCCESS Function completed successfully.\r
EFI_OUT_OF_RESOURCES Could not allocate required resources.\r
EFI_ABORTED Error encountered.\r