]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/CommonDataClass/FdfClass.py
Sync tool code to BuildTools project r1739.
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / FdfClass.py
1 ## @file
2 # classes represent data in FDF
3 #
4 # Copyright (c) 2007, Intel Corporation
5 #
6 # All rights reserved. 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
172 ## Compress section data in FDF
173 #
174 #
175 class CompressSectionClassObject (SectionClassObject) :
176 ## The constructor
177 #
178 # @param self The object pointer
179 #
180 def __init__(self):
181 SectionClassObject.__init__(self)
182 self.CompType = None
183 self.SectionList = []
184
185 ## Data section data in FDF
186 #
187 #
188 class DataSectionClassObject (SectionClassObject):
189 ## The constructor
190 #
191 # @param self The object pointer
192 #
193 def __init__(self):
194 SectionClassObject.__init__(self)
195 self.SecType = None
196 self.SectFileName = None
197 self.SectionList = []
198 self.KeepReloc = True
199
200 ## Rule section data in FDF
201 #
202 #
203 class EfiSectionClassObject (SectionClassObject):
204 ## The constructor
205 #
206 # @param self The object pointer
207 #
208 def __init__(self):
209 SectionClassObject.__init__(self)
210 self.SectionType = None
211 self.Optional = False
212 self.FileType = None
213 self.StringData = None
214 self.FileName = None
215 self.FileExtension = None
216 self.BuildNum = None
217 self.KeepReloc = None
218
219 ## FV image section data in FDF
220 #
221 #
222 class FvImageSectionClassObject (SectionClassObject):
223 ## The constructor
224 #
225 # @param self The object pointer
226 #
227 def __init__(self):
228 SectionClassObject.__init__(self)
229 self.Fv = None
230 self.FvName = None
231 self.FvFileType = None
232 self.FvFileName = None
233 self.FvFileExtension = None
234
235 ## GUIDed section data in FDF
236 #
237 #
238 class GuidSectionClassObject (SectionClassObject) :
239 ## The constructor
240 #
241 # @param self The object pointer
242 #
243 def __init__(self):
244 SectionClassObject.__init__(self)
245 self.NameGuid = None
246 self.SectionList = []
247 self.SectionType = None
248 self.ProcessRequired = False
249 self.AuthStatusValid = False
250
251 ## UI section data in FDF
252 #
253 #
254 class UiSectionClassObject (SectionClassObject):
255 ## The constructor
256 #
257 # @param self The object pointer
258 #
259 def __init__(self):
260 SectionClassObject.__init__(self)
261 self.StringData = None
262 self.FileName = None
263
264 ## Version section data in FDF
265 #
266 #
267 class VerSectionClassObject (SectionClassObject):
268 ## The constructor
269 #
270 # @param self The object pointer
271 #
272 def __init__(self):
273 SectionClassObject.__init__(self)
274 self.BuildNum = None
275 self.StringData = None
276 self.FileName = None
277
278 ## Rule data in FDF
279 #
280 #
281 class RuleClassObject :
282 ## The constructor
283 #
284 # @param self The object pointer
285 #
286 def __init__(self):
287 self.Arch = None
288 self.ModuleType = None # For Module Type
289 self.TemplateName = None
290 self.NameGuid = None
291 self.Fixed = False
292 self.Alignment = None
293 self.CheckSum = False
294 self.FvFileType = None # for Ffs File Type
295 self.KeyStringList = []
296 self.KeepReloc = None
297
298 ## Complex rule data in FDF
299 #
300 #
301 class RuleComplexFileClassObject(RuleClassObject) :
302 ## The constructor
303 #
304 # @param self The object pointer
305 #
306 def __init__(self):
307 RuleClassObject.__init__(self)
308 self.SectionList = []
309
310 ## Simple rule data in FDF
311 #
312 #
313 class RuleSimpleFileClassObject(RuleClassObject) :
314 ## The constructor
315 #
316 # @param self The object pointer
317 #
318 def __init__(self):
319 RuleClassObject.__init__(self)
320 self.FileName = None
321 self.SectionType = ''
322 self.FileExtension = None
323
324 ## File extension rule data in FDF
325 #
326 #
327 class RuleFileExtensionClassObject(RuleClassObject):
328 ## The constructor
329 #
330 # @param self The object pointer
331 #
332 def __init__(self):
333 RuleClassObject.__init__(self)
334 self.FileExtension = None
335
336 ## Capsule data in FDF
337 #
338 #
339 class CapsuleClassObject :
340 ## The constructor
341 #
342 # @param self The object pointer
343 #
344 def __init__(self):
345 self.SpecName = None
346 self.UiCapsuleName = None
347 self.CreateFile = None
348 self.GroupIdNumber = None
349 # DefineVarDict[var] = value
350 self.DefineVarDict = {}
351 # SetVarDict[var] = value
352 self.SetVarDict = {}
353 # TokensDict[var] = value
354 self.TokensDict = {}
355 self.CapsuleDataList = []
356
357 ## VTF data in FDF
358 #
359 #
360 class VtfClassObject :
361 ## The constructor
362 #
363 # @param self The object pointer
364 #
365 def __init__(self):
366 self.KeyArch = None
367 self.ArchList = None
368 self.UiName = None
369 self.ResetBin = None
370 self.ComponentStatementList = []
371
372 ## VTF component data in FDF
373 #
374 #
375 class ComponentStatementClassObject :
376 ## The constructor
377 #
378 # @param self The object pointer
379 #
380 def __init__(self):
381 self.CompName = None
382 self.CompLoc = None
383 self.CompType = None
384 self.CompVer = None
385 self.CompCs = None
386 self.CompBin = None
387 self.CompSym = None
388 self.CompSize = None
389 self.FilePos = None
390
391 ## OptionROM data in FDF
392 #
393 #
394 class OptionRomClassObject:
395 ## The constructor
396 #
397 # @param self The object pointer
398 #
399 def __init__(self):
400 self.DriverName = None
401 self.FfsList = []
402