]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/CommonDataClass/FdfClass.py
Sync EDKII BaseTools to BaseTools project r2065.
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / FdfClass.py
1 ## @file
2 # classes represent data in FDF
3 #
4 # Copyright (c) 2007 - 2010, 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 = '1'
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 ## FV data in FDF
41 #
42 #
43 class FvClassObject:
44 ## The constructor
45 #
46 # @param self The object pointer
47 #
48 def __init__(self):
49 self.UiFvName = None
50 self.CreateFileName = None
51 # 3-tuple list (blockSize, numBlocks, pcd)
52 self.BlockSizeList = []
53 # DefineVarDict[var] = value
54 self.DefineVarDict = {}
55 # SetVarDict[var] = value
56 self.SetVarDict = {}
57 self.FvAlignment = None
58 # FvAttributeDict[attribute] = TRUE/FALSE (1/0)
59 self.FvAttributeDict = {}
60 self.FvNameGuid = None
61 self.AprioriSectionList = []
62 self.FfsList = []
63 self.BsBaseAddress = None
64 self.RtBaseAddress = None
65
66 ## Region data in FDF
67 #
68 #
69 class RegionClassObject:
70 ## The constructor
71 #
72 # @param self The object pointer
73 #
74 def __init__(self):
75 self.Offset = None # The begin position of the Region
76 self.Size = None # The Size of the Region
77 self.PcdOffset = None
78 self.PcdSize = None
79 self.SetVarDict = {}
80 self.RegionType = None
81 self.RegionDataList = []
82
83 ## FFS data in FDF
84 #
85 #
86 class FfsClassObject:
87 ## The constructor
88 #
89 # @param self The object pointer
90 #
91 def __init__(self):
92 self.NameGuid = None
93 self.Fixed = False
94 self.CheckSum = False
95 self.Alignment = None
96 self.SectionList = []
97
98 ## FILE statement data in FDF
99 #
100 #
101 class FileStatementClassObject (FfsClassObject) :
102 ## The constructor
103 #
104 # @param self The object pointer
105 #
106 def __init__(self):
107 FfsClassObject.__init__(self)
108 self.FvFileType = None
109 self.FileName = None
110 self.KeyStringList = []
111 self.FvName = None
112 self.FdName = None
113 self.DefineVarDict = {}
114 self.AprioriSection = None
115 self.KeepReloc = None
116
117 ## INF statement data in FDF
118 #
119 #
120 class FfsInfStatementClassObject(FfsClassObject):
121 ## The constructor
122 #
123 # @param self The object pointer
124 #
125 def __init__(self):
126 FfsClassObject.__init__(self)
127 self.Rule = None
128 self.Version = None
129 self.Ui = None
130 self.InfFileName = None
131 self.BuildNum = ''
132 self.KeyStringList = []
133 self.KeepReloc = None
134 self.UseArch = None
135
136 ## APRIORI section data in FDF
137 #
138 #
139 class AprioriSectionClassObject:
140 ## The constructor
141 #
142 # @param self The object pointer
143 #
144 def __init__(self):
145 # DefineVarDict[var] = value
146 self.DefineVarDict = {}
147 self.FfsList = []
148
149 ## section data in FDF
150 #
151 #
152 class SectionClassObject:
153 ## The constructor
154 #
155 # @param self The object pointer
156 #
157 def __init__(self):
158 self.Alignment = None
159
160 ## Depex expression section in FDF
161 #
162 #
163 class DepexSectionClassObject (SectionClassObject):
164 ## The constructor
165 #
166 # @param self The object pointer
167 #
168 def __init__(self):
169 self.DepexType = None
170 self.Expression = None
171 self.ExpressionProcessed = False
172
173 ## Compress section data in FDF
174 #
175 #
176 class CompressSectionClassObject (SectionClassObject) :
177 ## The constructor
178 #
179 # @param self The object pointer
180 #
181 def __init__(self):
182 SectionClassObject.__init__(self)
183 self.CompType = None
184 self.SectionList = []
185
186 ## Data section data in FDF
187 #
188 #
189 class DataSectionClassObject (SectionClassObject):
190 ## The constructor
191 #
192 # @param self The object pointer
193 #
194 def __init__(self):
195 SectionClassObject.__init__(self)
196 self.SecType = None
197 self.SectFileName = None
198 self.SectionList = []
199 self.KeepReloc = True
200
201 ## Rule section data in FDF
202 #
203 #
204 class EfiSectionClassObject (SectionClassObject):
205 ## The constructor
206 #
207 # @param self The object pointer
208 #
209 def __init__(self):
210 SectionClassObject.__init__(self)
211 self.SectionType = None
212 self.Optional = False
213 self.FileType = None
214 self.StringData = None
215 self.FileName = None
216 self.FileExtension = None
217 self.BuildNum = None
218 self.KeepReloc = None
219
220 ## FV image section data in FDF
221 #
222 #
223 class FvImageSectionClassObject (SectionClassObject):
224 ## The constructor
225 #
226 # @param self The object pointer
227 #
228 def __init__(self):
229 SectionClassObject.__init__(self)
230 self.Fv = None
231 self.FvName = None
232 self.FvFileType = None
233 self.FvFileName = None
234 self.FvFileExtension = None
235 self.FvAddr = None
236
237 ## GUIDed section data in FDF
238 #
239 #
240 class GuidSectionClassObject (SectionClassObject) :
241 ## The constructor
242 #
243 # @param self The object pointer
244 #
245 def __init__(self):
246 SectionClassObject.__init__(self)
247 self.NameGuid = None
248 self.SectionList = []
249 self.SectionType = None
250 self.ProcessRequired = False
251 self.AuthStatusValid = False
252 self.FvAddr = []
253 self.FvParentAddr = None
254 self.IncludeFvSection = False
255
256 ## UI section data in FDF
257 #
258 #
259 class UiSectionClassObject (SectionClassObject):
260 ## The constructor
261 #
262 # @param self The object pointer
263 #
264 def __init__(self):
265 SectionClassObject.__init__(self)
266 self.StringData = None
267 self.FileName = None
268
269 ## Version section data in FDF
270 #
271 #
272 class VerSectionClassObject (SectionClassObject):
273 ## The constructor
274 #
275 # @param self The object pointer
276 #
277 def __init__(self):
278 SectionClassObject.__init__(self)
279 self.BuildNum = None
280 self.StringData = None
281 self.FileName = None
282
283 ## Rule data in FDF
284 #
285 #
286 class RuleClassObject :
287 ## The constructor
288 #
289 # @param self The object pointer
290 #
291 def __init__(self):
292 self.Arch = None
293 self.ModuleType = None # For Module Type
294 self.TemplateName = None
295 self.NameGuid = None
296 self.Fixed = False
297 self.Alignment = None
298 self.SectAlignment = None
299 self.CheckSum = False
300 self.FvFileType = None # for Ffs File Type
301 self.KeyStringList = []
302 self.KeepReloc = None
303
304 ## Complex rule data in FDF
305 #
306 #
307 class RuleComplexFileClassObject(RuleClassObject) :
308 ## The constructor
309 #
310 # @param self The object pointer
311 #
312 def __init__(self):
313 RuleClassObject.__init__(self)
314 self.SectionList = []
315
316 ## Simple rule data in FDF
317 #
318 #
319 class RuleSimpleFileClassObject(RuleClassObject) :
320 ## The constructor
321 #
322 # @param self The object pointer
323 #
324 def __init__(self):
325 RuleClassObject.__init__(self)
326 self.FileName = None
327 self.SectionType = ''
328 self.FileExtension = None
329
330 ## File extension rule data in FDF
331 #
332 #
333 class RuleFileExtensionClassObject(RuleClassObject):
334 ## The constructor
335 #
336 # @param self The object pointer
337 #
338 def __init__(self):
339 RuleClassObject.__init__(self)
340 self.FileExtension = None
341
342 ## Capsule data in FDF
343 #
344 #
345 class CapsuleClassObject :
346 ## The constructor
347 #
348 # @param self The object pointer
349 #
350 def __init__(self):
351 self.SpecName = None
352 self.UiCapsuleName = None
353 self.CreateFile = None
354 self.GroupIdNumber = None
355 # DefineVarDict[var] = value
356 self.DefineVarDict = {}
357 # SetVarDict[var] = value
358 self.SetVarDict = {}
359 # TokensDict[var] = value
360 self.TokensDict = {}
361 self.CapsuleDataList = []
362
363 ## VTF data in FDF
364 #
365 #
366 class VtfClassObject :
367 ## The constructor
368 #
369 # @param self The object pointer
370 #
371 def __init__(self):
372 self.KeyArch = None
373 self.ArchList = None
374 self.UiName = None
375 self.ResetBin = None
376 self.ComponentStatementList = []
377
378 ## VTF component data in FDF
379 #
380 #
381 class ComponentStatementClassObject :
382 ## The constructor
383 #
384 # @param self The object pointer
385 #
386 def __init__(self):
387 self.CompName = None
388 self.CompLoc = None
389 self.CompType = None
390 self.CompVer = None
391 self.CompCs = None
392 self.CompBin = None
393 self.CompSym = None
394 self.CompSize = None
395 self.FilePos = None
396
397 ## OptionROM data in FDF
398 #
399 #
400 class OptionRomClassObject:
401 ## The constructor
402 #
403 # @param self The object pointer
404 #
405 def __init__(self):
406 self.DriverName = None
407 self.FfsList = []
408