X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FGenDepex.py;h=7aa22bd944a0037b0bca9f0a07385cd984829398;hb=02f6fd1d5f2e21dafc080721e7258bc2a2dc603c;hp=f80824b744fbdd8a70dad48c0b03fd3ad3c0c3d1;hpb=14c48571ae607277d11132c5e085d3ec1f12d236;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py index f80824b744..7aa22bd944 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -1,7 +1,7 @@ ## @file # This file is used to generate DEPEX file for module's dependency expression # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -13,17 +13,17 @@ ## Import Modules # import sys -import os +import Common.LongFilePathOs as os import re import traceback - +from Common.LongFilePathSupport import OpenLongFilePath as open from StringIO import StringIO from struct import pack from Common.BuildToolError import * from Common.Misc import SaveFileOnChange from Common.Misc import GuidStructureStringToGuidString from Common import EdkLogger as EdkLogger - +from Common.BuildVersion import gBUILD_VERSION ## Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END" gStartClosePattern = re.compile(".*DEPENDENCY_START(.+)DEPENDENCY_END.*", re.S) @@ -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 } } @@ -286,10 +301,10 @@ class DependencyExpression: # don't generate depex if only TRUE operand left if self.ModuleType == 'PEIM' and len(NewOperand) == 1 and NewOperand[0] == 'TRUE': self.PostfixNotation = [] - return + 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 = [] @@ -354,7 +369,7 @@ class DependencyExpression: Buffer.close() return FileChangeFlag -versionNumber = "0.04" +versionNumber = ("0.04" + " " + gBUILD_VERSION) __version__ = "%prog Version " + versionNumber __copyright__ = "Copyright (c) 2007-2010, Intel Corporation All rights reserved." __usage__ = "%prog [options] [dependency_expression_file]" @@ -424,7 +439,7 @@ def Main(): Dpx = DependencyExpression(DxsString, Option.ModuleType, Option.Optimize) if Option.OutputFile != None: FileChangeFlag = Dpx.Generate(Option.OutputFile) - if not FileChangeFlag and DxsFile: + if not FileChangeFlag and DxsFile: # # Touch the output file if its time stamp is older than the original # DXS file to avoid re-invoke this tool for the dependency check in build rule.