]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLibInternal.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / GenFvImage / GenFvImageLibInternal.h
diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLibInternal.h b/EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLibInternal.h
new file mode 100644 (file)
index 0000000..505188b
--- /dev/null
@@ -0,0 +1,212 @@
+/*++\r
+\r
+Copyright (c) 2004 - 2007, 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
+\r
+Module Name:\r
+  \r
+  GenFvImageLibInternal.h\r
+\r
+Abstract:\r
+\r
+  This file contains describes the private declarations for the GenFvImage Library.\r
+  The basic purpose of the library is to create Firmware Volume images.\r
+\r
+--*/\r
+\r
+#ifndef _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H\r
+#define _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H\r
+\r
+//\r
+// Include files\r
+//\r
+#include "GenFvImageLib.h"\r
+#include <stdlib.h>\r
+#include "EfiFirmwareVolumeHeader.h"\r
+\r
+//\r
+// Private data declarations\r
+//\r
+//\r
+// The maximum number of block map entries supported by the library\r
+//\r
+#define MAX_NUMBER_OF_FV_BLOCKS 100\r
+\r
+//\r
+// The maximum number of files in the FV supported by the library\r
+//\r
+#define MAX_NUMBER_OF_FILES_IN_FV       1000\r
+#define MAX_NUMBER_OF_COMPONENTS_IN_FV  10\r
+\r
+//\r
+// INF file strings\r
+//\r
+#define OPTIONS_SECTION_STRING            "[options]"\r
+#define ATTRIBUTES_SECTION_STRING         "[attributes]"\r
+#define FILES_SECTION_STRING              "[files]"\r
+#define COMPONENT_SECTION_STRING          "[components]"\r
+\r
+#define EFI_FV_BASE_ADDRESS_STRING        "EFI_BASE_ADDRESS"\r
+#define EFI_FV_FILE_NAME_STRING           "EFI_FILE_NAME"\r
+#define EFI_SYM_FILE_NAME_STRING          "EFI_SYM_FILE_NAME"\r
+#define EFI_NUM_BLOCKS_STRING             "EFI_NUM_BLOCKS"\r
+#define EFI_BLOCK_SIZE_STRING             "EFI_BLOCK_SIZE"\r
+#define EFI_FV_GUID_STRING                "EFI_FV_GUID"\r
+\r
+#define EFI_FVB_READ_DISABLED_CAP_STRING  "EFI_READ_DISABLED_CAP"\r
+#define EFI_FVB_READ_ENABLED_CAP_STRING   "EFI_READ_ENABLED_CAP"\r
+#define EFI_FVB_READ_STATUS_STRING        "EFI_READ_STATUS"\r
+\r
+#define EFI_FVB_WRITE_DISABLED_CAP_STRING "EFI_WRITE_DISABLED_CAP"\r
+#define EFI_FVB_WRITE_ENABLED_CAP_STRING  "EFI_WRITE_ENABLED_CAP"\r
+#define EFI_FVB_WRITE_STATUS_STRING       "EFI_WRITE_STATUS"\r
+\r
+#define EFI_FVB_LOCK_CAP_STRING           "EFI_LOCK_CAP"\r
+#define EFI_FVB_LOCK_STATUS_STRING        "EFI_LOCK_STATUS"\r
+\r
+#define EFI_FVB_STICKY_WRITE_STRING       "EFI_STICKY_WRITE"\r
+#define EFI_FVB_MEMORY_MAPPED_STRING      "EFI_MEMORY_MAPPED"\r
+#define EFI_FVB_ERASE_POLARITY_STRING     "EFI_ERASE_POLARITY"\r
+\r
+#define EFI_FVB_ALIGNMENT_CAP_STRING      "EFI_ALIGNMENT_CAP"\r
+#define EFI_FVB_ALIGNMENT_2_STRING        "EFI_ALIGNMENT_2"\r
+#define EFI_FVB_ALIGNMENT_4_STRING        "EFI_ALIGNMENT_4"\r
+#define EFI_FVB_ALIGNMENT_8_STRING        "EFI_ALIGNMENT_8"\r
+#define EFI_FVB_ALIGNMENT_16_STRING       "EFI_ALIGNMENT_16"\r
+#define EFI_FVB_ALIGNMENT_32_STRING       "EFI_ALIGNMENT_32"\r
+#define EFI_FVB_ALIGNMENT_64_STRING       "EFI_ALIGNMENT_64"\r
+#define EFI_FVB_ALIGNMENT_128_STRING      "EFI_ALIGNMENT_128"\r
+#define EFI_FVB_ALIGNMENT_256_STRING      "EFI_ALIGNMENT_256"\r
+#define EFI_FVB_ALIGNMENT_512_STRING      "EFI_ALIGNMENT_512"\r
+#define EFI_FVB_ALIGNMENT_1K_STRING       "EFI_ALIGNMENT_1K"\r
+#define EFI_FVB_ALIGNMENT_2K_STRING       "EFI_ALIGNMENT_2K"\r
+#define EFI_FVB_ALIGNMENT_4K_STRING       "EFI_ALIGNMENT_4K"\r
+#define EFI_FVB_ALIGNMENT_8K_STRING       "EFI_ALIGNMENT_8K"\r
+#define EFI_FVB_ALIGNMENT_16K_STRING      "EFI_ALIGNMENT_16K"\r
+#define EFI_FVB_ALIGNMENT_32K_STRING      "EFI_ALIGNMENT_32K"\r
+#define EFI_FVB_ALIGNMENT_64K_STRING      "EFI_ALIGNMENT_64K"\r
+\r
+//\r
+// Add these for PI1.0 new Attributes.\r
+//\r
+#define EFI_FVB_READ_LOCK_CAP_STRING            "EFI_READ_LOCK_CAP"\r
+#define EFI_FVB_READ_LOCK_STATUS_STRING         "EFI_READ_LOCK_STATUS"\r
+#define EFI_FVB_WRITE_LOCK_CAP_STRING           "EFI_WRITE_LOCK_CAP"\r
+#define EFI_FVB_WRITE_LOCK_STATUS_STRING        "EFI_WRITE_LOCK_STATUS"\r
+#define EFI_FVB2_ALIGNMENT_STRING               "EFI_FVB2_ALIGNMENT"\r
+\r
+#define EFI_FVB2_ALIGNMENT_1_STRING             "1"\r
+#define EFI_FVB2_ALIGNMENT_2_STRING             "2"\r
+#define EFI_FVB2_ALIGNMENT_4_STRING             "4"\r
+#define EFI_FVB2_ALIGNMENT_8_STRING             "8"\r
+#define EFI_FVB2_ALIGNMENT_16_STRING            "16"\r
+#define EFI_FVB2_ALIGNMENT_32_STRING            "32"\r
+#define EFI_FVB2_ALIGNMENT_64_STRING            "64"\r
+#define EFI_FVB2_ALIGNMENT_128_STRING           "128"\r
+#define EFI_FVB2_ALIGNMENT_256_STRING           "256"\r
+#define EFI_FVB2_ALIGNMENT_512_STRING           "512"\r
+#define EFI_FVB2_ALIGNMENT_1K_STRING            "1K"\r
+#define EFI_FVB2_ALIGNMENT_2K_STRING            "2K"\r
+#define EFI_FVB2_ALIGNMENT_4K_STRING            "4K"\r
+#define EFI_FVB2_ALIGNMENT_8K_STRING            "8K"\r
+#define EFI_FVB2_ALIGNMENT_16K_STRING           "16K"\r
+#define EFI_FVB2_ALIGNMENT_32K_STRING           "32K"\r
+#define EFI_FVB2_ALIGNMENT_64K_STRING           "64K"\r
+#define EFI_FVB2_ALIGNMENT_128K_STRING          "128K"\r
+#define EFI_FVB2_ALIGNMENT_256K_STRING          "256K"\r
+#define EFI_FVB2_ALIGNMENT_512K_STRING          "512K"\r
+#define EFI_FVB2_ALIGNMENT_1M_STRING            "1M"\r
+#define EFI_FVB2_ALIGNMENT_2M_STRING            "2M"\r
+#define EFI_FVB2_ALIGNMENT_4M_STRING            "4M"\r
+#define EFI_FVB2_ALIGNMENT_8M_STRING            "8M"\r
+#define EFI_FVB2_ALIGNMENT_16M_STRING           "16M"\r
+#define EFI_FVB2_ALIGNMENT_32M_STRING           "32M"\r
+#define EFI_FVB2_ALIGNMENT_64M_STRING           "64M"\r
+#define EFI_FVB2_ALIGNMENT_128M_STRING          "128M"\r
+#define EFI_FVB2_ALIGNMENT_256M_STRING          "256M"\r
+#define EFI_FVB2_ALIGNMENT_512M_STRING          "512M"\r
+#define EFI_FVB2_ALIGNMENT_1G_STRING            "1G"\r
+#define EFI_FVB2_ALIGNMENT_2G_STRING            "2G"\r
+\r
+\r
+//\r
+// Component sections\r
+//\r
+#define EFI_NV_VARIABLE_STRING    "EFI_NV_VARIABLE"\r
+#define EFI_NV_EVENT_LOG_STRING   "EFI_NV_EVENT_LOG"\r
+#define EFI_NV_FTW_WORKING_STRING "EFI_NV_FTW_WORKING"\r
+#define EFI_NV_FTW_SPARE_STRING   "EFI_NV_FTW_SPARE"\r
+\r
+#define EFI_FILE_NAME_STRING      "EFI_FILE_NAME"\r
+\r
+#define ONE_STRING                "1"\r
+#define ZERO_STRING               "0"\r
+#define TRUE_STRING               "TRUE"\r
+#define FALSE_STRING              "FALSE"\r
+#define NULL_STRING               "NULL"\r
+\r
+//\r
+// Defines to calculate the offset for PEI CORE entry points\r
+//\r
+#define IA32_PEI_CORE_ENTRY_OFFSET  0x20\r
+\r
+//\r
+// Defines to calculate the FIT table\r
+//\r
+#define IPF_FIT_ADDRESS_OFFSET  0x20\r
+\r
+//\r
+// Defines to calculate the offset for SALE_ENTRY\r
+//\r
+#define IPF_SALE_ENTRY_ADDRESS_OFFSET 0x18\r
+\r
+//\r
+// Symbol file definitions, current max size if 512K\r
+//\r
+#define SYMBOL_FILE_SIZE  0x80000\r
+\r
+#define FV_IMAGES_TOP_ADDRESS             0x100000000\r
+\r
+//\r
+// Private data types\r
+//\r
+//\r
+// Component information\r
+//\r
+typedef struct {\r
+  UINTN Size;\r
+  CHAR8 ComponentName[_MAX_PATH];\r
+} COMPONENT_INFO;\r
+\r
+//\r
+// FV information holder\r
+//\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS    BaseAddress;\r
+  EFI_GUID                FvGuid;\r
+  UINTN                   Size;\r
+  CHAR8                   FvName[_MAX_PATH];\r
+  CHAR8                   SymName[_MAX_PATH];\r
+  EFI_FV_BLOCK_MAP_ENTRY  FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];\r
+  EFI_FVB_ATTRIBUTES      FvAttributes;\r
+  CHAR8                   FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];\r
+  COMPONENT_INFO          FvComponents[MAX_NUMBER_OF_COMPONENTS_IN_FV];\r
+} FV_INFO;\r
+\r
+//\r
+// Private function prototypes\r
+//\r
+EFI_STATUS\r
+ParseFvInf (\r
+  IN MEMORY_FILE  *InfFile,\r
+  IN FV_INFO      *FvInfo\r
+  )\r
+;\r
+\r
+#endif\r