]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/TianoTools/GenFvImage/GenFvImageLibInternal.h
f38fe1151a8fffe0fc664bd9ec5ff6fb710ef02f
[mirror_edk2.git] / Tools / Source / TianoTools / GenFvImage / GenFvImageLibInternal.h
1 /*++
2
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 GenFvImageLibInternal.h
15
16 Abstract:
17
18 This file contains describes the private declarations for the GenFvImage Library.
19 The basic purpose of the library is to create Firmware Volume images.
20
21 --*/
22
23 #ifndef _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H
24 #define _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H
25
26 //
27 // Include files
28 //
29 #include "GenFvImageLib.h"
30 #include <stdlib.h>
31 #include <CommonLib.h>
32 #include "FirmwareVolumeHeader.h"
33
34 //
35 // Private data declarations
36 //
37 //
38 // The maximum number of block map entries supported by the library
39 //
40 #define MAX_NUMBER_OF_FV_BLOCKS 100
41
42 //
43 // The maximum number of files in the FV supported by the library
44 //
45 #define MAX_NUMBER_OF_FILES_IN_FV 1000
46 #define MAX_NUMBER_OF_COMPONENTS_IN_FV 10
47
48 //
49 // INF file strings
50 //
51 #define OPTIONS_SECTION_STRING "[options]"
52 #define ATTRIBUTES_SECTION_STRING "[attributes]"
53 #define FILES_SECTION_STRING "[files]"
54 #define COMPONENT_SECTION_STRING "[components]"
55
56 #define EFI_FV_BASE_ADDRESS_STRING "EFI_BASE_ADDRESS"
57 #define EFI_FV_FILE_NAME_STRING "EFI_FILE_NAME"
58 #define EFI_SYM_FILE_NAME_STRING "EFI_SYM_FILE_NAME"
59 #define EFI_NUM_BLOCKS_STRING "EFI_NUM_BLOCKS"
60 #define EFI_BLOCK_SIZE_STRING "EFI_BLOCK_SIZE"
61 #define EFI_FV_GUID_STRING "EFI_FV_GUID"
62
63 #define EFI_FVB_READ_DISABLED_CAP_STRING "EFI_READ_DISABLED_CAP"
64 #define EFI_FVB_READ_ENABLED_CAP_STRING "EFI_READ_ENABLED_CAP"
65 #define EFI_FVB_READ_STATUS_STRING "EFI_READ_STATUS"
66
67 #define EFI_FVB_WRITE_DISABLED_CAP_STRING "EFI_WRITE_DISABLED_CAP"
68 #define EFI_FVB_WRITE_ENABLED_CAP_STRING "EFI_WRITE_ENABLED_CAP"
69 #define EFI_FVB_WRITE_STATUS_STRING "EFI_WRITE_STATUS"
70
71 #define EFI_FVB_LOCK_CAP_STRING "EFI_LOCK_CAP"
72 #define EFI_FVB_LOCK_STATUS_STRING "EFI_LOCK_STATUS"
73
74 #define EFI_FVB_STICKY_WRITE_STRING "EFI_STICKY_WRITE"
75 #define EFI_FVB_MEMORY_MAPPED_STRING "EFI_MEMORY_MAPPED"
76 #define EFI_FVB_ERASE_POLARITY_STRING "EFI_ERASE_POLARITY"
77
78 #define EFI_FVB_ALIGNMENT_CAP_STRING "EFI_ALIGNMENT_CAP"
79 #define EFI_FVB_ALIGNMENT_2_STRING "EFI_ALIGNMENT_2"
80 #define EFI_FVB_ALIGNMENT_4_STRING "EFI_ALIGNMENT_4"
81 #define EFI_FVB_ALIGNMENT_8_STRING "EFI_ALIGNMENT_8"
82 #define EFI_FVB_ALIGNMENT_16_STRING "EFI_ALIGNMENT_16"
83 #define EFI_FVB_ALIGNMENT_32_STRING "EFI_ALIGNMENT_32"
84 #define EFI_FVB_ALIGNMENT_64_STRING "EFI_ALIGNMENT_64"
85 #define EFI_FVB_ALIGNMENT_128_STRING "EFI_ALIGNMENT_128"
86 #define EFI_FVB_ALIGNMENT_256_STRING "EFI_ALIGNMENT_256"
87 #define EFI_FVB_ALIGNMENT_512_STRING "EFI_ALIGNMENT_512"
88 #define EFI_FVB_ALIGNMENT_1K_STRING "EFI_ALIGNMENT_1K"
89 #define EFI_FVB_ALIGNMENT_2K_STRING "EFI_ALIGNMENT_2K"
90 #define EFI_FVB_ALIGNMENT_4K_STRING "EFI_ALIGNMENT_4K"
91 #define EFI_FVB_ALIGNMENT_8K_STRING "EFI_ALIGNMENT_8K"
92 #define EFI_FVB_ALIGNMENT_16K_STRING "EFI_ALIGNMENT_16K"
93 #define EFI_FVB_ALIGNMENT_32K_STRING "EFI_ALIGNMENT_32K"
94 #define EFI_FVB_ALIGNMENT_64K_STRING "EFI_ALIGNMENT_64K"
95
96 //
97 // Component sections
98 //
99 #define EFI_NV_VARIABLE_STRING "EFI_NV_VARIABLE"
100 #define EFI_NV_EVENT_LOG_STRING "EFI_NV_EVENT_LOG"
101 #define EFI_NV_FTW_WORKING_STRING "EFI_NV_FTW_WORKING"
102 #define EFI_NV_FTW_SPARE_STRING "EFI_NV_FTW_SPARE"
103
104 #define EFI_FILE_NAME_STRING "EFI_FILE_NAME"
105
106 #define ONE_STRING "1"
107 #define ZERO_STRING "0"
108 #define TRUE_STRING "TRUE"
109 #define FALSE_STRING "FALSE"
110 #define NULL_STRING "NULL"
111
112 //
113 // Defines to calculate the offset for PEI CORE entry points
114 //
115 #define IA32_PEI_CORE_ENTRY_OFFSET 0x20
116
117 //
118 // Defines to calculate the FIT table
119 //
120 #define IPF_FIT_ADDRESS_OFFSET 0x20
121
122 //
123 // Defines to calculate the offset for SALE_ENTRY
124 //
125 #define IPF_SALE_ENTRY_ADDRESS_OFFSET 0x18
126
127 //
128 // Symbol file definitions, current max size if 512K
129 //
130 #define SYMBOL_FILE_SIZE 0x80000
131
132 #define FV_IMAGES_TOP_ADDRESS 0x100000000ULL
133
134 //
135 // Private data types
136 //
137 //
138 // Component information
139 //
140 typedef struct {
141 UINTN Size;
142 CHAR8 ComponentName[_MAX_PATH];
143 } COMPONENT_INFO;
144
145 //
146 // FV information holder
147 //
148 typedef struct {
149 EFI_PHYSICAL_ADDRESS BaseAddress;
150 EFI_GUID FvGuid;
151 UINTN Size;
152 CHAR8 FvName[_MAX_PATH];
153 CHAR8 SymName[_MAX_PATH];
154 EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
155 EFI_FVB_ATTRIBUTES FvAttributes;
156 CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
157 COMPONENT_INFO FvComponents[MAX_NUMBER_OF_COMPONENTS_IN_FV];
158 } FV_INFO;
159
160 //
161 // Private function prototypes
162 //
163 EFI_STATUS
164 ParseFvInf (
165 IN MEMORY_FILE *InfFile,
166 IN FV_INFO *FvInfo
167 )
168 ;
169
170 #endif