]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Object / POM / ModuleObject.py
1 ## @file
2 # This file is used to define a class object to describe a module
3 #
4 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5 #
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 '''
9 ModuleObject
10 '''
11
12 ##
13 # Import Modules
14 #
15 from Object.POM.CommonObject import CommonPropertiesObject
16 from Object.POM.CommonObject import IdentificationObject
17 from Object.POM.CommonObject import CommonHeaderObject
18 from Object.POM.CommonObject import BinaryHeaderObject
19 from Object.POM.CommonObject import HelpTextListObject
20 from Object.POM.CommonObject import GuidVersionObject
21
22
23 ##
24 # BootModeObject
25 #
26 class BootModeObject(CommonPropertiesObject, HelpTextListObject):
27 def __init__(self):
28 self.SupportedBootModes = ''
29 CommonPropertiesObject.__init__(self)
30 HelpTextListObject.__init__(self)
31
32 def SetSupportedBootModes(self, SupportedBootModes):
33 self.SupportedBootModes = SupportedBootModes
34
35 def GetSupportedBootModes(self):
36 return self.SupportedBootModes
37
38 ##
39 # EventObject
40 #
41 class EventObject(CommonPropertiesObject, HelpTextListObject):
42 def __init__(self):
43 self.EventType = ''
44 CommonPropertiesObject.__init__(self)
45 HelpTextListObject.__init__(self)
46
47 def SetEventType(self, EventType):
48 self.EventType = EventType
49
50 def GetEventType(self):
51 return self.EventType
52
53 ##
54 # HobObject
55 #
56 class HobObject(CommonPropertiesObject, HelpTextListObject):
57 def __init__(self):
58 self.HobType = ''
59 CommonPropertiesObject.__init__(self)
60 HelpTextListObject.__init__(self)
61
62 def SetHobType(self, HobType):
63 self.HobType = HobType
64
65 def GetHobType(self):
66 return self.HobType
67
68 ##
69 # SpecObject
70 #
71 class SpecObject(object):
72 def __init__(self):
73 self.Spec = ''
74 self.Version = ''
75
76 def SetSpec(self, Spec):
77 self.Spec = Spec
78
79 def GetSpec(self):
80 return self.Spec
81
82 def SetVersion(self, Version):
83 self.Version = Version
84
85 def GetVersion(self):
86 return self.Version
87
88 ## ModuleHeaderObject
89 #
90 # This class defined header items used in Module file
91 #
92 class ModuleHeaderObject(IdentificationObject, CommonHeaderObject, BinaryHeaderObject):
93 def __init__(self):
94 self.IsLibrary = False
95 self.IsLibraryModList = []
96 self.ModuleType = ''
97 self.BinaryModule = False
98 self.PcdIsDriver = ''
99 self.PiSpecificationVersion = ''
100 self.UefiSpecificationVersion = ''
101 self.UNIFlag = False
102 self.ModuleUniFile = ''
103 #
104 # SpecObject
105 #
106 self.SpecList = []
107 #
108 # BootModeObject
109 #
110 self.BootModeList = []
111 #
112 # EventObject
113 #
114 self.EventList = []
115 #
116 # HobObject
117 #
118 self.HobList = []
119 #
120 # LibraryClassObject
121 #
122 self.LibraryClassList = []
123 self.SupArchList = []
124 IdentificationObject.__init__(self)
125 CommonHeaderObject.__init__(self)
126 BinaryHeaderObject.__init__(self)
127
128 def SetIsLibrary(self, IsLibrary):
129 self.IsLibrary = IsLibrary
130
131 def GetIsLibrary(self):
132 return self.IsLibrary
133
134 def SetIsLibraryModList(self, IsLibraryModList):
135 self.IsLibraryModList = IsLibraryModList
136
137 def GetIsLibraryModList(self):
138 return self.IsLibraryModList
139
140 def SetModuleType(self, ModuleType):
141 self.ModuleType = ModuleType
142
143 def GetModuleType(self):
144 return self.ModuleType
145
146 def SetBinaryModule(self, BinaryModule):
147 self.BinaryModule = BinaryModule
148
149 def GetBinaryModule(self):
150 return self.BinaryModule
151
152 def SetPcdIsDriver(self, PcdIsDriver):
153 self.PcdIsDriver = PcdIsDriver
154
155 def GetPcdIsDriver(self):
156 return self.PcdIsDriver
157
158 def SetPiSpecificationVersion(self, PiSpecificationVersion):
159 self.PiSpecificationVersion = PiSpecificationVersion
160
161 def GetPiSpecificationVersion(self):
162 return self.PiSpecificationVersion
163
164 def SetUefiSpecificationVersion(self, UefiSpecificationVersion):
165 self.UefiSpecificationVersion = UefiSpecificationVersion
166
167 def GetUefiSpecificationVersion(self):
168 return self.UefiSpecificationVersion
169
170 def SetSpecList(self, SpecList):
171 self.SpecList = SpecList
172
173 def GetSpecList(self):
174 return self.SpecList
175
176 def SetBootModeList(self, BootModeList):
177 self.BootModeList = BootModeList
178
179 def GetBootModeList(self):
180 return self.BootModeList
181
182 def SetEventList(self, EventList):
183 self.EventList = EventList
184
185 def GetEventList(self):
186 return self.EventList
187
188 def SetHobList(self, HobList):
189 self.HobList = HobList
190
191 def GetHobList(self):
192 return self.HobList
193
194 def SetLibraryClassList(self, LibraryClassList):
195 self.LibraryClassList = LibraryClassList
196
197 def GetLibraryClassList(self):
198 return self.LibraryClassList
199
200 def SetSupArchList(self, SupArchList):
201 self.SupArchList = SupArchList
202
203 def GetSupArchList(self):
204 return self.SupArchList
205
206 def SetModuleUniFile(self, ModuleUniFile):
207 self.ModuleUniFile = ModuleUniFile
208
209 def GetModuleUniFile(self):
210 return self.ModuleUniFile
211 ##
212 # SourceFileObject
213 #
214 class SourceFileObject(CommonPropertiesObject):
215 def __init__(self):
216 CommonPropertiesObject.__init__(self)
217 self.SourceFile = ''
218 self.TagName = ''
219 self.ToolCode = ''
220 self.Family = ''
221 self.FileType = ''
222
223 def SetSourceFile(self, SourceFile):
224 self.SourceFile = SourceFile
225
226 def GetSourceFile(self):
227 return self.SourceFile
228
229 def SetTagName(self, TagName):
230 self.TagName = TagName
231
232 def GetTagName(self):
233 return self.TagName
234
235 def SetToolCode(self, ToolCode):
236 self.ToolCode = ToolCode
237
238 def GetToolCode(self):
239 return self.ToolCode
240
241 def SetFamily(self, Family):
242 self.Family = Family
243
244 def GetFamily(self):
245 return self.Family
246
247 def SetFileType(self, FileType):
248 self.FileType = FileType
249
250 def GetFileType(self):
251 return self.FileType
252
253
254 ##
255 # BinaryFileObject
256 #
257 class BinaryFileObject(CommonPropertiesObject):
258 def __init__(self):
259 self.FileNamList = []
260 self.AsBuiltList = []
261 CommonPropertiesObject.__init__(self)
262
263 def SetFileNameList(self, FileNamList):
264 self.FileNamList = FileNamList
265
266 def GetFileNameList(self):
267 return self.FileNamList
268
269 def SetAsBuiltList(self, AsBuiltList):
270 self.AsBuiltList = AsBuiltList
271
272 def GetAsBuiltList(self):
273 return self.AsBuiltList
274
275
276 ##
277 # AsBuildLibraryClassObject
278 #
279 class AsBuildLibraryClassObject(object):
280 def __init__(self):
281 self.LibGuid = ''
282 self.LibVersion = ''
283 self.SupArchList = []
284
285 def SetLibGuid(self, LibGuid):
286 self.LibGuid = LibGuid
287 def GetLibGuid(self):
288 return self.LibGuid
289
290 def SetLibVersion(self, LibVersion):
291 self.LibVersion = LibVersion
292 def GetLibVersion(self):
293 return self.LibVersion
294
295 def SetSupArchList(self, SupArchList):
296 self.SupArchList = SupArchList
297 def GetSupArchList(self):
298 return self.SupArchList
299
300 ##
301 # AsBuiltObject
302 #
303 class AsBuiltObject(object):
304 def __init__(self):
305 #
306 # list of PcdObject
307 #
308 self.PatchPcdList = []
309 #
310 # list of PcdObject
311 #
312 self.PcdExValueList = []
313 #
314 # list of GuidVersionObject
315 #
316 self.LibraryInstancesList = []
317 #
318 # List of BinaryBuildFlag object
319 #
320 self.BinaryBuildFlagList = []
321
322 def SetPatchPcdList(self, PatchPcdList):
323 self.PatchPcdList = PatchPcdList
324
325 def GetPatchPcdList(self):
326 return self.PatchPcdList
327
328 def SetPcdExList(self, PcdExValueList):
329 self.PcdExValueList = PcdExValueList
330
331 def GetPcdExList(self):
332 return self.PcdExValueList
333
334 def SetLibraryInstancesList(self, LibraryInstancesList):
335 self.LibraryInstancesList = LibraryInstancesList
336
337 def GetLibraryInstancesList(self):
338 return self.LibraryInstancesList
339
340 def SetBuildFlagsList(self, BinaryBuildFlagList):
341 self.BinaryBuildFlagList = BinaryBuildFlagList
342
343 def GetBuildFlagsList(self):
344 return self.BinaryBuildFlagList
345
346 ##
347 # BinaryBuildFlag, this object will include those fields that are not
348 # covered by the UPT Spec BinaryFile field
349 #
350 class BinaryBuildFlagObject(object):
351 def __init__(self):
352 self.Target = ''
353 self.TagName = ''
354 self.Family = ''
355 self.AsBuiltOptionFlags = ''
356
357 def SetTarget(self, Target):
358 self.Target = Target
359
360 def GetTarget(self):
361 return self.Target
362
363 def SetTagName(self, TagName):
364 self.TagName = TagName
365
366 def GetTagName(self):
367 return self.TagName
368
369 def SetFamily(self, Family):
370 self.Family = Family
371
372 def GetFamily(self):
373 return self.Family
374
375 def SetAsBuiltOptionFlags(self, AsBuiltOptionFlags):
376 self.AsBuiltOptionFlags = AsBuiltOptionFlags
377 def GetAsBuiltOptionFlags(self):
378 return self.AsBuiltOptionFlags
379
380 ##
381 # ExternObject
382 #
383 class ExternObject(CommonPropertiesObject):
384 def __init__(self):
385 self.EntryPoint = ''
386 self.UnloadImage = ''
387 self.Constructor = ''
388 self.Destructor = ''
389 self.SupModList = []
390 CommonPropertiesObject.__init__(self)
391
392 def SetEntryPoint(self, EntryPoint):
393 self.EntryPoint = EntryPoint
394
395 def GetEntryPoint(self):
396 return self.EntryPoint
397
398 def SetUnloadImage(self, UnloadImage):
399 self.UnloadImage = UnloadImage
400
401 def GetUnloadImage(self):
402 return self.UnloadImage
403
404 def SetConstructor(self, Constructor):
405 self.Constructor = Constructor
406
407 def GetConstructor(self):
408 return self.Constructor
409
410 def SetDestructor(self, Destructor):
411 self.Destructor = Destructor
412
413 def GetDestructor(self):
414 return self.Destructor
415
416 def SetSupModList(self, SupModList):
417 self.SupModList = SupModList
418 def GetSupModList(self):
419 return self.SupModList
420
421 ##
422 # DepexObject
423 #
424 class DepexObject(CommonPropertiesObject):
425 def __init__(self):
426 self.Depex = ''
427 self.ModuelType = ''
428 CommonPropertiesObject.__init__(self)
429
430 def SetDepex(self, Depex):
431 self.Depex = Depex
432
433 def GetDepex(self):
434 return self.Depex
435
436 def SetModuleType(self, ModuleType):
437 self.ModuelType = ModuleType
438
439 def GetModuleType(self):
440 return self.ModuelType
441
442 ##
443 # PackageDependencyObject
444 #
445 class PackageDependencyObject(GuidVersionObject, CommonPropertiesObject):
446 def __init__(self):
447 self.Package = ''
448 self.PackageFilePath = ''
449 GuidVersionObject.__init__(self)
450 CommonPropertiesObject.__init__(self)
451
452 def SetPackageFilePath(self, PackageFilePath):
453 self.PackageFilePath = PackageFilePath
454
455 def GetPackageFilePath(self):
456 return self.PackageFilePath
457
458 def SetPackage(self, Package):
459 self.Package = Package
460
461 def GetPackage(self):
462 return self.Package
463
464 ##
465 # BuildOptionObject
466 #
467 class BuildOptionObject(CommonPropertiesObject):
468 def __init__(self):
469 CommonPropertiesObject.__init__(self)
470 self.BuildOption = ''
471
472 def SetBuildOption(self, BuildOption):
473 self.BuildOption = BuildOption
474
475 def GetBuildOption(self):
476 return self.BuildOption
477
478 ##
479 # ModuleObject
480 #
481 class ModuleObject(ModuleHeaderObject):
482 def __init__(self):
483 #
484 # {Arch : ModuleHeaderObject}
485 #
486 self.HeaderDict = {}
487 #
488 # LibraryClassObject
489 #
490 self.LibraryClassList = []
491 #
492 # SourceFileObject
493 #
494 self.SourceFileList = []
495 #
496 # BinaryFileObject
497 #
498 self.BinaryFileList = []
499 #
500 # PackageDependencyObject
501 #
502 self.PackageDependencyList = []
503 #
504 # DepexObject
505 #
506 self.PeiDepex = []
507 #
508 # DepexObject
509 #
510 self.DxeDepex = []
511 #
512 # DepexObject
513 #
514 self.SmmDepex = []
515 #
516 # ProtocolObject
517 #
518 self.ProtocolList = []
519 #
520 # PpiObject
521 #
522 self.PpiList = []
523 #
524 # GuidObject
525 #
526 self.GuidList = []
527 #
528 # PcdObject
529 #
530 self.PcdList = []
531 #
532 # ExternObject
533 #
534 self.ExternList = []
535 #
536 # BuildOptionObject
537 #
538 self.BuildOptionList = []
539 #
540 # UserExtensionObject
541 #
542 self.UserExtensionList = []
543 #
544 # MiscFileObject
545 #
546 self.MiscFileList = []
547 #
548 # ClonedFromObject
549 #
550 self.ClonedFrom = None
551
552 ModuleHeaderObject.__init__(self)
553
554 def SetHeaderDict(self, HeaderDict):
555 self.HeaderDict = HeaderDict
556
557 def GetHeaderDict(self):
558 return self.HeaderDict
559
560 def SetLibraryClassList(self, LibraryClassList):
561 self.LibraryClassList = LibraryClassList
562
563 def GetLibraryClassList(self):
564 return self.LibraryClassList
565
566 def SetSourceFileList(self, SourceFileList):
567 self.SourceFileList = SourceFileList
568
569 def GetSourceFileList(self):
570 return self.SourceFileList
571
572 def SetBinaryFileList(self, BinaryFileList):
573 self.BinaryFileList = BinaryFileList
574
575 def GetBinaryFileList(self):
576 return self.BinaryFileList
577
578 def SetPackageDependencyList(self, PackageDependencyList):
579 self.PackageDependencyList = PackageDependencyList
580
581 def GetPackageDependencyList(self):
582 return self.PackageDependencyList
583
584 def SetPeiDepex(self, PeiDepex):
585 self.PeiDepex = PeiDepex
586
587 def GetPeiDepex(self):
588 return self.PeiDepex
589
590 def SetDxeDepex(self, DxeDepex):
591 self.DxeDepex = DxeDepex
592
593 def GetDxeDepex(self):
594 return self.DxeDepex
595
596 def SetSmmDepex(self, SmmDepex):
597 self.SmmDepex = SmmDepex
598
599 def GetSmmDepex(self):
600 return self.SmmDepex
601
602 def SetPpiList(self, PpiList):
603 self.PpiList = PpiList
604
605 def GetPpiList(self):
606 return self.PpiList
607
608 def SetProtocolList(self, ProtocolList):
609 self.ProtocolList = ProtocolList
610
611 def GetProtocolList(self):
612 return self.ProtocolList
613
614 def SetPcdList(self, PcdList):
615 self.PcdList = PcdList
616
617 def GetPcdList(self):
618 return self.PcdList
619
620 def SetGuidList(self, GuidList):
621 self.GuidList = GuidList
622
623 def GetGuidList(self):
624 return self.GuidList
625
626 def SetExternList(self, ExternList):
627 self.ExternList = ExternList
628
629 def GetExternList(self):
630 return self.ExternList
631
632 def SetBuildOptionList(self, BuildOptionList):
633 self.BuildOptionList = BuildOptionList
634
635 def GetBuildOptionList(self):
636 return self.BuildOptionList
637
638 def SetUserExtensionList(self, UserExtensionList):
639 self.UserExtensionList = UserExtensionList
640
641 def GetUserExtensionList(self):
642 return self.UserExtensionList
643
644 def SetMiscFileList(self, MiscFileList):
645 self.MiscFileList = MiscFileList
646
647 def GetMiscFileList(self):
648 return self.MiscFileList
649
650 def SetClonedFrom(self, ClonedFrom):
651 self.ClonedFrom = ClonedFrom
652
653 def GetClonedFrom(self):
654 return self.ClonedFrom