]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/CommonDataClass/FdfClass.py
BaseTools/GenFds: cleanup GenFds
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / FdfClass.py
1 ## @file
2 # classes represent data in FDF
3 #
4 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #
14
15 ## FD data in FDF
16 #
17 #
18 class FDClassObject:
19 ## The constructor
20 #
21 # @param self The object pointer
22 #
23 def __init__(self):
24 self.FdUiName = ''
25 self.CreateFileName = None
26 self.BaseAddress = None
27 self.BaseAddressPcd = None
28 self.Size = None
29 self.SizePcd = None
30 self.ErasePolarity = None
31 # 3-tuple list (blockSize, numBlocks, pcd)
32 self.BlockSizeList = []
33 # DefineVarDict[var] = value
34 self.DefineVarDict = {}
35 # SetVarDict[var] = value
36 self.SetVarDict = {}
37 self.RegionList = []
38 self.vtfRawDict = {}
39
40 ## FFS data in FDF
41 #
42 #
43 class FfsClassObject:
44 ## The constructor
45 #
46 # @param self The object pointer
47 #
48 def __init__(self):
49 self.NameGuid = None
50 self.Fixed = False
51 self.CheckSum = False
52 self.Alignment = None
53 self.SectionList = []
54
55 ## FILE statement data in FDF
56 #
57 #
58 class FileStatementClassObject (FfsClassObject) :
59 ## The constructor
60 #
61 # @param self The object pointer
62 #
63 def __init__(self):
64 FfsClassObject.__init__(self)
65 self.FvFileType = None
66 self.FileName = None
67 self.KeyStringList = []
68 self.FvName = None
69 self.FdName = None
70 self.DefineVarDict = {}
71 self.KeepReloc = None
72
73 ## INF statement data in FDF
74 #
75 #
76 class FfsInfStatementClassObject(FfsClassObject):
77 ## The constructor
78 #
79 # @param self The object pointer
80 #
81 def __init__(self):
82 FfsClassObject.__init__(self)
83 self.Rule = None
84 self.Version = None
85 self.Ui = None
86 self.InfFileName = None
87 self.BuildNum = ''
88 self.KeyStringList = []
89 self.KeepReloc = None
90 self.UseArch = None
91
92 ## section data in FDF
93 #
94 #
95 class SectionClassObject:
96 ## The constructor
97 #
98 # @param self The object pointer
99 #
100 def __init__(self):
101 self.Alignment = None
102
103 ## Depex expression section in FDF
104 #
105 #
106 class DepexSectionClassObject (SectionClassObject):
107 ## The constructor
108 #
109 # @param self The object pointer
110 #
111 def __init__(self):
112 self.DepexType = None
113 self.Expression = None
114 self.ExpressionProcessed = False
115
116 ## Compress section data in FDF
117 #
118 #
119 class CompressSectionClassObject (SectionClassObject) :
120 ## The constructor
121 #
122 # @param self The object pointer
123 #
124 def __init__(self):
125 SectionClassObject.__init__(self)
126 self.CompType = None
127 self.SectionList = []
128
129 ## Data section data in FDF
130 #
131 #
132 class DataSectionClassObject (SectionClassObject):
133 ## The constructor
134 #
135 # @param self The object pointer
136 #
137 def __init__(self):
138 SectionClassObject.__init__(self)
139 self.SecType = None
140 self.SectFileName = None
141 self.SectionList = []
142 self.KeepReloc = True
143
144 ## Rule section data in FDF
145 #
146 #
147 class EfiSectionClassObject (SectionClassObject):
148 ## The constructor
149 #
150 # @param self The object pointer
151 #
152 def __init__(self):
153 SectionClassObject.__init__(self)
154 self.SectionType = None
155 self.Optional = False
156 self.FileType = None
157 self.StringData = None
158 self.FileName = None
159 self.FileExtension = None
160 self.BuildNum = None
161 self.KeepReloc = None
162
163 ## FV image section data in FDF
164 #
165 #
166 class FvImageSectionClassObject (SectionClassObject):
167 ## The constructor
168 #
169 # @param self The object pointer
170 #
171 def __init__(self):
172 SectionClassObject.__init__(self)
173 self.Fv = None
174 self.FvName = None
175 self.FvFileType = None
176 self.FvFileName = None
177 self.FvFileExtension = None
178 self.FvAddr = None
179
180 ## GUIDed section data in FDF
181 #
182 #
183 class GuidSectionClassObject (SectionClassObject) :
184 ## The constructor
185 #
186 # @param self The object pointer
187 #
188 def __init__(self):
189 SectionClassObject.__init__(self)
190 self.NameGuid = None
191 self.SectionList = []
192 self.SectionType = None
193 self.ProcessRequired = False
194 self.AuthStatusValid = False
195 self.ExtraHeaderSize = -1
196 self.FvAddr = []
197 self.FvParentAddr = None
198 self.IncludeFvSection = False
199
200 ## UI section data in FDF
201 #
202 #
203 class UiSectionClassObject (SectionClassObject):
204 ## The constructor
205 #
206 # @param self The object pointer
207 #
208 def __init__(self):
209 SectionClassObject.__init__(self)
210 self.StringData = None
211 self.FileName = None
212
213 ## Version section data in FDF
214 #
215 #
216 class VerSectionClassObject (SectionClassObject):
217 ## The constructor
218 #
219 # @param self The object pointer
220 #
221 def __init__(self):
222 SectionClassObject.__init__(self)
223 self.BuildNum = None
224 self.StringData = None
225 self.FileName = None
226
227 ## Rule data in FDF
228 #
229 #
230 class RuleClassObject :
231 ## The constructor
232 #
233 # @param self The object pointer
234 #
235 def __init__(self):
236 self.Arch = None
237 self.ModuleType = None # For Module Type
238 self.TemplateName = None
239 self.NameGuid = None
240 self.Fixed = False
241 self.Alignment = None
242 self.SectAlignment = None
243 self.CheckSum = False
244 self.FvFileType = None # for Ffs File Type
245 self.KeyStringList = []
246 self.KeepReloc = None
247
248 ## Complex rule data in FDF
249 #
250 #
251 class RuleComplexFileClassObject(RuleClassObject) :
252 ## The constructor
253 #
254 # @param self The object pointer
255 #
256 def __init__(self):
257 RuleClassObject.__init__(self)
258 self.SectionList = []
259
260 ## Simple rule data in FDF
261 #
262 #
263 class RuleSimpleFileClassObject(RuleClassObject) :
264 ## The constructor
265 #
266 # @param self The object pointer
267 #
268 def __init__(self):
269 RuleClassObject.__init__(self)
270 self.FileName = None
271 self.SectionType = ''
272 self.FileExtension = None
273
274 ## File extension rule data in FDF
275 #
276 #
277 class RuleFileExtensionClassObject(RuleClassObject):
278 ## The constructor
279 #
280 # @param self The object pointer
281 #
282 def __init__(self):
283 RuleClassObject.__init__(self)
284 self.FileExtension = None
285
286 ## Capsule data in FDF
287 #
288 #
289 class CapsuleClassObject :
290 ## The constructor
291 #
292 # @param self The object pointer
293 #
294 def __init__(self):
295 self.SpecName = None
296 self.UiCapsuleName = None
297 self.CreateFile = None
298 self.GroupIdNumber = None
299 # DefineVarDict[var] = value
300 self.DefineVarDict = {}
301 # SetVarDict[var] = value
302 self.SetVarDict = {}
303 # TokensDict[var] = value
304 self.TokensDict = {}
305 self.CapsuleDataList = []
306 self.FmpPayloadList = []
307
308 ## VTF component data in FDF
309 #
310 #
311 class ComponentStatementClassObject :
312 ## The constructor
313 #
314 # @param self The object pointer
315 #
316 def __init__(self):
317 self.CompName = None
318 self.CompLoc = None
319 self.CompType = None
320 self.CompVer = None
321 self.CompCs = None
322 self.CompBin = None
323 self.CompSym = None
324 self.CompSize = None
325 self.FilePos = None
326
327 ## OptionROM data in FDF
328 #
329 #
330 class OptionRomClassObject:
331 ## The constructor
332 #
333 # @param self The object pointer
334 #
335 def __init__(self):
336 self.DriverName = None
337 self.FfsList = []
338