X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FGenDepex.py;h=9acea8f6bfed17d02246f5179f07c1419acd52c1;hp=5923a75ab7fb8ec3c0aafe420bd18d0376c6c423;hb=4231a8193ec0d52df7e0a101d96c51b1a2b7a996;hpb=47fea6afd74af76c7e2a2b03d319b7ac035ac26a diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py index 5923a75ab7..9acea8f6bf 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -42,6 +42,8 @@ gType2Phase = { "UEFI_DRIVER" : "DXE", "UEFI_APPLICATION" : "DXE", "SMM_CORE" : "DXE", + "MM_STANDALONE" : "MM", + "MM_CORE_STANDALONE" : "MM", } ## Convert dependency expression string into EFI internal representation @@ -98,6 +100,19 @@ class DependencyExpression: "FALSE" : 0x07, "END" : 0x08, "SOR" : 0x09 + }, + + "MM" : { + "BEFORE": 0x00, + "AFTER" : 0x01, + "PUSH" : 0x02, + "AND" : 0x03, + "OR" : 0x04, + "NOT" : 0x05, + "TRUE" : 0x06, + "FALSE" : 0x07, + "END" : 0x08, + "SOR" : 0x09 } } @@ -289,7 +304,7 @@ class DependencyExpression: return # don't generate depex if all operands are architecture protocols - if self.ModuleType in ['UEFI_DRIVER', 'DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'DXE_SMM_DRIVER'] and \ + if self.ModuleType in ['UEFI_DRIVER', 'DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'DXE_SMM_DRIVER', 'MM_STANDALONE'] and \ Op == 'AND' and \ self.ArchProtocols == set([GuidStructureStringToGuidString(Guid) for Guid in AllOperand]): self.PostfixNotation = [] @@ -345,7 +360,7 @@ class DependencyExpression: FilePath = "" FileChangeFlag = True - if File == None: + if File is None: sys.stdout.write(Buffer.getvalue()) FilePath = "STDOUT" else: @@ -399,13 +414,13 @@ def Main(): EdkLogger.SetLevel(EdkLogger.QUIET) elif Option.verbose: EdkLogger.SetLevel(EdkLogger.VERBOSE) - elif Option.debug != None: + elif Option.debug is not None: EdkLogger.SetLevel(Option.debug + 1) else: EdkLogger.SetLevel(EdkLogger.INFO) try: - if Option.ModuleType == None or Option.ModuleType not in gType2Phase: + if Option.ModuleType is None or Option.ModuleType not in gType2Phase: EdkLogger.error("GenDepex", OPTION_MISSING, "Module type is not specified or supported") DxsFile = '' @@ -422,7 +437,7 @@ def Main(): EdkLogger.error("GenDepex", OPTION_MISSING, "No expression string or file given") Dpx = DependencyExpression(DxsString, Option.ModuleType, Option.Optimize) - if Option.OutputFile != None: + if Option.OutputFile is not None: FileChangeFlag = Dpx.Generate(Option.OutputFile) if not FileChangeFlag and DxsFile: # @@ -435,7 +450,7 @@ def Main(): Dpx.Generate() except BaseException, X: EdkLogger.quiet("") - if Option != None and Option.debug != None: + if Option is not None and Option.debug is not None: EdkLogger.quiet(traceback.format_exc()) else: EdkLogger.quiet(str(X))