]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3e99020d | 3 | Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r |
4b1e1121 | 4 | This program and the accompanying materials \r |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | GenFvImageLibInternal.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | This file contains describes the private declarations for the GenFvImage Library.\r | |
19 | The basic purpose of the library is to create Firmware Volume images.\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
23 | #ifndef _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H\r | |
24 | #define _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H\r | |
25 | \r | |
26 | //\r | |
27 | // Include files\r | |
28 | //\r | |
29 | #include "GenFvImageLib.h"\r | |
30 | #include <stdlib.h>\r | |
31 | #include "EfiFirmwareVolumeHeader.h"\r | |
32 | \r | |
33 | //\r | |
34 | // Private data declarations\r | |
35 | //\r | |
36 | //\r | |
37 | // The maximum number of block map entries supported by the library\r | |
38 | //\r | |
39 | #define MAX_NUMBER_OF_FV_BLOCKS 100\r | |
40 | \r | |
41 | //\r | |
42 | // The maximum number of files in the FV supported by the library\r | |
43 | //\r | |
44 | #define MAX_NUMBER_OF_FILES_IN_FV 1000\r | |
45 | #define MAX_NUMBER_OF_COMPONENTS_IN_FV 10\r | |
46 | \r | |
3e99020d LG |
47 | #define FV_CAPACITY_INCREASE_UNIT 0x100000\r |
48 | \r | |
3eb9473e | 49 | //\r |
50 | // INF file strings\r | |
51 | //\r | |
52 | #define OPTIONS_SECTION_STRING "[options]"\r | |
53 | #define ATTRIBUTES_SECTION_STRING "[attributes]"\r | |
54 | #define FILES_SECTION_STRING "[files]"\r | |
55 | #define COMPONENT_SECTION_STRING "[components]"\r | |
56 | \r | |
57 | #define EFI_FV_BASE_ADDRESS_STRING "EFI_BASE_ADDRESS"\r | |
58 | #define EFI_FV_FILE_NAME_STRING "EFI_FILE_NAME"\r | |
59 | #define EFI_SYM_FILE_NAME_STRING "EFI_SYM_FILE_NAME"\r | |
60 | #define EFI_NUM_BLOCKS_STRING "EFI_NUM_BLOCKS"\r | |
61 | #define EFI_BLOCK_SIZE_STRING "EFI_BLOCK_SIZE"\r | |
62 | #define EFI_FV_GUID_STRING "EFI_FV_GUID"\r | |
63 | \r | |
64 | #define EFI_FVB_READ_DISABLED_CAP_STRING "EFI_READ_DISABLED_CAP"\r | |
65 | #define EFI_FVB_READ_ENABLED_CAP_STRING "EFI_READ_ENABLED_CAP"\r | |
66 | #define EFI_FVB_READ_STATUS_STRING "EFI_READ_STATUS"\r | |
67 | \r | |
68 | #define EFI_FVB_WRITE_DISABLED_CAP_STRING "EFI_WRITE_DISABLED_CAP"\r | |
69 | #define EFI_FVB_WRITE_ENABLED_CAP_STRING "EFI_WRITE_ENABLED_CAP"\r | |
70 | #define EFI_FVB_WRITE_STATUS_STRING "EFI_WRITE_STATUS"\r | |
71 | \r | |
72 | #define EFI_FVB_LOCK_CAP_STRING "EFI_LOCK_CAP"\r | |
73 | #define EFI_FVB_LOCK_STATUS_STRING "EFI_LOCK_STATUS"\r | |
74 | \r | |
75 | #define EFI_FVB_STICKY_WRITE_STRING "EFI_STICKY_WRITE"\r | |
76 | #define EFI_FVB_MEMORY_MAPPED_STRING "EFI_MEMORY_MAPPED"\r | |
77 | #define EFI_FVB_ERASE_POLARITY_STRING "EFI_ERASE_POLARITY"\r | |
78 | \r | |
79 | #define EFI_FVB_ALIGNMENT_CAP_STRING "EFI_ALIGNMENT_CAP"\r | |
80 | #define EFI_FVB_ALIGNMENT_2_STRING "EFI_ALIGNMENT_2"\r | |
81 | #define EFI_FVB_ALIGNMENT_4_STRING "EFI_ALIGNMENT_4"\r | |
82 | #define EFI_FVB_ALIGNMENT_8_STRING "EFI_ALIGNMENT_8"\r | |
83 | #define EFI_FVB_ALIGNMENT_16_STRING "EFI_ALIGNMENT_16"\r | |
84 | #define EFI_FVB_ALIGNMENT_32_STRING "EFI_ALIGNMENT_32"\r | |
85 | #define EFI_FVB_ALIGNMENT_64_STRING "EFI_ALIGNMENT_64"\r | |
86 | #define EFI_FVB_ALIGNMENT_128_STRING "EFI_ALIGNMENT_128"\r | |
87 | #define EFI_FVB_ALIGNMENT_256_STRING "EFI_ALIGNMENT_256"\r | |
88 | #define EFI_FVB_ALIGNMENT_512_STRING "EFI_ALIGNMENT_512"\r | |
89 | #define EFI_FVB_ALIGNMENT_1K_STRING "EFI_ALIGNMENT_1K"\r | |
90 | #define EFI_FVB_ALIGNMENT_2K_STRING "EFI_ALIGNMENT_2K"\r | |
91 | #define EFI_FVB_ALIGNMENT_4K_STRING "EFI_ALIGNMENT_4K"\r | |
92 | #define EFI_FVB_ALIGNMENT_8K_STRING "EFI_ALIGNMENT_8K"\r | |
93 | #define EFI_FVB_ALIGNMENT_16K_STRING "EFI_ALIGNMENT_16K"\r | |
94 | #define EFI_FVB_ALIGNMENT_32K_STRING "EFI_ALIGNMENT_32K"\r | |
95 | #define EFI_FVB_ALIGNMENT_64K_STRING "EFI_ALIGNMENT_64K"\r | |
96 | \r | |
97 | //\r | |
98 | // Add these for PI1.0 new Attributes.\r | |
99 | //\r | |
100 | #define EFI_FVB_READ_LOCK_CAP_STRING "EFI_READ_LOCK_CAP"\r | |
101 | #define EFI_FVB_READ_LOCK_STATUS_STRING "EFI_READ_LOCK_STATUS"\r | |
102 | #define EFI_FVB_WRITE_LOCK_CAP_STRING "EFI_WRITE_LOCK_CAP"\r | |
103 | #define EFI_FVB_WRITE_LOCK_STATUS_STRING "EFI_WRITE_LOCK_STATUS"\r | |
104 | #define EFI_FVB2_ALIGNMENT_STRING "EFI_FVB2_ALIGNMENT"\r | |
105 | \r | |
106 | #define EFI_FVB2_ALIGNMENT_1_STRING "1"\r | |
107 | #define EFI_FVB2_ALIGNMENT_2_STRING "2"\r | |
108 | #define EFI_FVB2_ALIGNMENT_4_STRING "4"\r | |
109 | #define EFI_FVB2_ALIGNMENT_8_STRING "8"\r | |
110 | #define EFI_FVB2_ALIGNMENT_16_STRING "16"\r | |
111 | #define EFI_FVB2_ALIGNMENT_32_STRING "32"\r | |
112 | #define EFI_FVB2_ALIGNMENT_64_STRING "64"\r | |
113 | #define EFI_FVB2_ALIGNMENT_128_STRING "128"\r | |
114 | #define EFI_FVB2_ALIGNMENT_256_STRING "256"\r | |
115 | #define EFI_FVB2_ALIGNMENT_512_STRING "512"\r | |
116 | #define EFI_FVB2_ALIGNMENT_1K_STRING "1K"\r | |
117 | #define EFI_FVB2_ALIGNMENT_2K_STRING "2K"\r | |
118 | #define EFI_FVB2_ALIGNMENT_4K_STRING "4K"\r | |
119 | #define EFI_FVB2_ALIGNMENT_8K_STRING "8K"\r | |
120 | #define EFI_FVB2_ALIGNMENT_16K_STRING "16K"\r | |
121 | #define EFI_FVB2_ALIGNMENT_32K_STRING "32K"\r | |
122 | #define EFI_FVB2_ALIGNMENT_64K_STRING "64K"\r | |
123 | #define EFI_FVB2_ALIGNMENT_128K_STRING "128K"\r | |
124 | #define EFI_FVB2_ALIGNMENT_256K_STRING "256K"\r | |
125 | #define EFI_FVB2_ALIGNMENT_512K_STRING "512K"\r | |
126 | #define EFI_FVB2_ALIGNMENT_1M_STRING "1M"\r | |
127 | #define EFI_FVB2_ALIGNMENT_2M_STRING "2M"\r | |
128 | #define EFI_FVB2_ALIGNMENT_4M_STRING "4M"\r | |
129 | #define EFI_FVB2_ALIGNMENT_8M_STRING "8M"\r | |
130 | #define EFI_FVB2_ALIGNMENT_16M_STRING "16M"\r | |
131 | #define EFI_FVB2_ALIGNMENT_32M_STRING "32M"\r | |
132 | #define EFI_FVB2_ALIGNMENT_64M_STRING "64M"\r | |
133 | #define EFI_FVB2_ALIGNMENT_128M_STRING "128M"\r | |
134 | #define EFI_FVB2_ALIGNMENT_256M_STRING "256M"\r | |
135 | #define EFI_FVB2_ALIGNMENT_512M_STRING "512M"\r | |
136 | #define EFI_FVB2_ALIGNMENT_1G_STRING "1G"\r | |
137 | #define EFI_FVB2_ALIGNMENT_2G_STRING "2G"\r | |
138 | \r | |
139 | \r | |
140 | //\r | |
141 | // Component sections\r | |
142 | //\r | |
143 | #define EFI_NV_VARIABLE_STRING "EFI_NV_VARIABLE"\r | |
144 | #define EFI_NV_EVENT_LOG_STRING "EFI_NV_EVENT_LOG"\r | |
145 | #define EFI_NV_FTW_WORKING_STRING "EFI_NV_FTW_WORKING"\r | |
146 | #define EFI_NV_FTW_SPARE_STRING "EFI_NV_FTW_SPARE"\r | |
147 | \r | |
148 | #define EFI_FILE_NAME_STRING "EFI_FILE_NAME"\r | |
149 | \r | |
150 | #define ONE_STRING "1"\r | |
151 | #define ZERO_STRING "0"\r | |
152 | #define TRUE_STRING "TRUE"\r | |
153 | #define FALSE_STRING "FALSE"\r | |
154 | #define NULL_STRING "NULL"\r | |
3e99020d | 155 | #define AUTO_STRING "AUTO"\r |
3eb9473e | 156 | \r |
157 | //\r | |
158 | // Defines to calculate the offset for PEI CORE entry points\r | |
159 | //\r | |
160 | #define IA32_PEI_CORE_ENTRY_OFFSET 0x20\r | |
161 | \r | |
162 | //\r | |
163 | // Defines to calculate the FIT table\r | |
164 | //\r | |
165 | #define IPF_FIT_ADDRESS_OFFSET 0x20\r | |
166 | \r | |
167 | //\r | |
168 | // Defines to calculate the offset for SALE_ENTRY\r | |
169 | //\r | |
170 | #define IPF_SALE_ENTRY_ADDRESS_OFFSET 0x18\r | |
171 | \r | |
172 | //\r | |
173 | // Symbol file definitions, current max size if 512K\r | |
174 | //\r | |
175 | #define SYMBOL_FILE_SIZE 0x80000\r | |
176 | \r | |
177 | #define FV_IMAGES_TOP_ADDRESS 0x100000000\r | |
178 | \r | |
179 | //\r | |
180 | // Private data types\r | |
181 | //\r | |
182 | //\r | |
183 | // Component information\r | |
184 | //\r | |
185 | typedef struct {\r | |
186 | UINTN Size;\r | |
187 | CHAR8 ComponentName[_MAX_PATH];\r | |
188 | } COMPONENT_INFO;\r | |
189 | \r | |
190 | //\r | |
191 | // FV information holder\r | |
192 | //\r | |
193 | typedef struct {\r | |
194 | EFI_PHYSICAL_ADDRESS BaseAddress;\r | |
195 | EFI_GUID FvGuid;\r | |
196 | UINTN Size;\r | |
197 | CHAR8 FvName[_MAX_PATH];\r | |
198 | CHAR8 SymName[_MAX_PATH];\r | |
199 | EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];\r | |
200 | EFI_FVB_ATTRIBUTES FvAttributes;\r | |
201 | CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];\r | |
202 | COMPONENT_INFO FvComponents[MAX_NUMBER_OF_COMPONENTS_IN_FV];\r | |
203 | } FV_INFO;\r | |
204 | \r | |
205 | //\r | |
206 | // Private function prototypes\r | |
207 | //\r | |
208 | EFI_STATUS\r | |
209 | ParseFvInf (\r | |
210 | IN MEMORY_FILE *InfFile,\r | |
211 | IN FV_INFO *FvInfo\r | |
3e99020d LG |
212 | )\r |
213 | ;\r | |
3eb9473e | 214 | \r |
215 | #endif\r |