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