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