Sync BaseTools Branch (version r2321) to EDKII main trunk.
Signed-off-by: lgao4 Reviewed-by: gikidy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12372 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -357,8 +357,8 @@ class WorkspaceAutoGen(AutoGen):
|
||||
# @return None
|
||||
#
|
||||
def _CheckAllPcdsTokenValueConflict(self):
|
||||
if len(self.BuildDatabase.WorkspaceDb.PackageList) >= 1:
|
||||
for Package in self.BuildDatabase.WorkspaceDb.PackageList:
|
||||
for Pa in self.AutoGenObjectList:
|
||||
for Package in Pa.PackageList:
|
||||
PcdList = Package.Pcds.values()
|
||||
PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue))
|
||||
Count = 0
|
||||
@@ -1152,7 +1152,7 @@ class PlatformAutoGen(AutoGen):
|
||||
if LibraryClass.startswith("NULL"):
|
||||
Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
|
||||
|
||||
# R9 module
|
||||
# EdkII module
|
||||
LibraryConsumerList = [Module]
|
||||
Constructor = []
|
||||
ConsumedByList = sdict()
|
||||
@@ -1401,7 +1401,7 @@ class PlatformAutoGen(AutoGen):
|
||||
|
||||
## Resolve library names to library modules
|
||||
#
|
||||
# (for R8.x modules)
|
||||
# (for Edk.x modules)
|
||||
#
|
||||
# @param Module The module from which the library names will be resolved
|
||||
#
|
||||
@@ -1412,7 +1412,7 @@ class PlatformAutoGen(AutoGen):
|
||||
EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), self.Arch))
|
||||
LibraryConsumerList = [Module]
|
||||
|
||||
# "CompilerStub" is a must for R8 modules
|
||||
# "CompilerStub" is a must for Edk modules
|
||||
if Module.Libraries:
|
||||
Module.Libraries.append("CompilerStub")
|
||||
LibraryList = []
|
||||
@@ -1794,6 +1794,10 @@ class ModuleAutoGen(AutoGen):
|
||||
def _GetBaseName(self):
|
||||
return self.Module.BaseName
|
||||
|
||||
## Return the module DxsFile if exist
|
||||
def _GetDxsFile(self):
|
||||
return self.Module.DxsFile
|
||||
|
||||
## Return the module SourceOverridePath
|
||||
def _GetSourceOverridePath(self):
|
||||
return self.Module.SourceOverridePath
|
||||
@@ -1810,7 +1814,7 @@ class ModuleAutoGen(AutoGen):
|
||||
def _GetModuleType(self):
|
||||
return self.Module.ModuleType
|
||||
|
||||
## Return the component type (for R8.x style of module)
|
||||
## Return the component type (for Edk.x style of module)
|
||||
def _GetComponentType(self):
|
||||
return self.Module.ComponentType
|
||||
|
||||
@@ -1913,7 +1917,7 @@ class ModuleAutoGen(AutoGen):
|
||||
def _GetDepexTokenList(self):
|
||||
if self._DepexList == None:
|
||||
self._DepexList = {}
|
||||
if self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
|
||||
if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
|
||||
return self._DepexList
|
||||
|
||||
self._DepexList[self.ModuleType] = []
|
||||
@@ -1949,7 +1953,7 @@ class ModuleAutoGen(AutoGen):
|
||||
def _GetDepexExpressionTokenList(self):
|
||||
if self._DepexExpressionList == None:
|
||||
self._DepexExpressionList = {}
|
||||
if self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
|
||||
if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
|
||||
return self._DepexExpressionList
|
||||
|
||||
self._DepexExpressionList[self.ModuleType] = ''
|
||||
@@ -2153,7 +2157,7 @@ class ModuleAutoGen(AutoGen):
|
||||
self._BuildTargets = {}
|
||||
self._FileTypes = {}
|
||||
|
||||
#TRICK: call _GetSourceFileList to apply build rule for binary files
|
||||
#TRICK: call _GetSourceFileList to apply build rule for source files
|
||||
if self.SourceFileList:
|
||||
pass
|
||||
|
||||
@@ -2306,11 +2310,11 @@ class ModuleAutoGen(AutoGen):
|
||||
for Inc in self.Module.Includes:
|
||||
if Inc not in self._IncludePathList:
|
||||
self._IncludePathList.append(Inc)
|
||||
# for r8 modules
|
||||
# for Edk modules
|
||||
Inc = path.join(Inc, self.Arch.capitalize())
|
||||
if os.path.exists(Inc) and Inc not in self._IncludePathList:
|
||||
self._IncludePathList.append(Inc)
|
||||
# r8 module needs to put DEBUG_DIR at the end of search path and not to use SOURCE_DIR all the time
|
||||
# Edk module needs to put DEBUG_DIR at the end of search path and not to use SOURCE_DIR all the time
|
||||
self._IncludePathList.append(self.DebugDir)
|
||||
else:
|
||||
self._IncludePathList.append(self.MetaFile.Dir)
|
||||
@@ -2470,7 +2474,7 @@ class ModuleAutoGen(AutoGen):
|
||||
|
||||
for File in self.AutoGenFileList:
|
||||
if GenC.Generate(File.Path, self.AutoGenFileList[File], File.IsBinary):
|
||||
#Ignore R8 AutoGen.c
|
||||
#Ignore Edk AutoGen.c
|
||||
if self.AutoGenVersion < 0x00010005 and File.Name == 'AutoGen.c':
|
||||
continue
|
||||
|
||||
@@ -2572,6 +2576,7 @@ class ModuleAutoGen(AutoGen):
|
||||
ProtocolList = property(_GetProtocolList)
|
||||
PpiList = property(_GetPpiList)
|
||||
DepexList = property(_GetDepexTokenList)
|
||||
DxsFile = property(_GetDxsFile)
|
||||
DepexExpressionList = property(_GetDepexExpressionTokenList)
|
||||
BuildOption = property(_GetModuleBuildOption)
|
||||
BuildCommand = property(_GetBuildCommand)
|
||||
|
@@ -67,21 +67,21 @@ typedef UINT8 SKU_ID;
|
||||
|
||||
#define PCD_TYPE_SHIFT 28
|
||||
|
||||
#define PCD_TYPE_DATA (0x0 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_HII (0x8 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_VPD (0x4 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_SKU_ENABLED (0x2 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_STRING (0x1 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_DATA (0x0U << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_HII (0x8U << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_VPD (0x4U << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_SKU_ENABLED (0x2U << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_STRING (0x1U << PCD_TYPE_SHIFT)
|
||||
|
||||
#define PCD_TYPE_ALL_SET (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING)
|
||||
|
||||
#define PCD_DATUM_TYPE_SHIFT 24
|
||||
|
||||
#define PCD_DATUM_TYPE_POINTER (0x0 << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT8 (0x1 << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT16 (0x2 << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT32 (0x4 << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT64 (0x8 << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_POINTER (0x0U << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT8 (0x1U << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT16 (0x2U << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT32 (0x4U << PCD_DATUM_TYPE_SHIFT)
|
||||
#define PCD_DATUM_TYPE_UINT64 (0x8U << PCD_DATUM_TYPE_SHIFT)
|
||||
|
||||
#define PCD_DATUM_TYPE_ALL_SET (PCD_DATUM_TYPE_POINTER | \\
|
||||
PCD_DATUM_TYPE_UINT8 | \\
|
||||
@@ -1951,7 +1951,11 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH):
|
||||
if Info.ModuleType in gModuleTypeHeaderFile \
|
||||
and gModuleTypeHeaderFile[Info.ModuleType][0] != gBasicHeaderFile:
|
||||
AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.ModuleType][0])
|
||||
if 'PcdLib' in Info.Module.LibraryClasses:
|
||||
#
|
||||
# if either PcdLib in [LibraryClasses] sections or there exist Pcd section, add PcdLib.h
|
||||
# As if modules only uses FixedPcd, then PcdLib is not needed in [LibraryClasses] section.
|
||||
#
|
||||
if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds:
|
||||
AutoGenH.Append("#include <Library/PcdLib.h>\n")
|
||||
|
||||
AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;\n\n')
|
||||
@@ -2018,7 +2022,7 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer):
|
||||
|
||||
CreateFooterCode(Info, AutoGenC, AutoGenH)
|
||||
|
||||
# no generation of AutoGen.c for R8 modules without unicode file
|
||||
# no generation of AutoGen.c for Edk modules without unicode file
|
||||
if Info.AutoGenVersion < 0x00010005 and len(Info.UnicodeFileList) == 0:
|
||||
AutoGenC.String = ''
|
||||
|
||||
|
@@ -23,7 +23,7 @@ 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)
|
||||
@@ -354,7 +354,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]"
|
||||
|
@@ -31,7 +31,7 @@ gIncludePattern = re.compile(r"^[ \t]*#?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n
|
||||
## Regular expression for matching macro used in header file inclusion
|
||||
gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
|
||||
|
||||
## pattern for include style in R8.x code
|
||||
## pattern for include style in Edk.x code
|
||||
gProtocolDefinition = "Protocol/%(HeaderKey)s/%(HeaderKey)s.h"
|
||||
gGuidDefinition = "Guid/%(HeaderKey)s/%(HeaderKey)s.h"
|
||||
gArchProtocolDefinition = "ArchProtocol/%(HeaderKey)s/%(HeaderKey)s.h"
|
||||
@@ -462,13 +462,13 @@ cleanlib:
|
||||
ArchEntryPoint = ModuleEntryPoint
|
||||
|
||||
if self._AutoGenObject.Arch == "EBC":
|
||||
# EBC compiler always use "EfiStart" as entry point. Only applies to R9 modules
|
||||
# EBC compiler always use "EfiStart" as entry point. Only applies to EdkII modules
|
||||
ImageEntryPoint = "EfiStart"
|
||||
elif self._AutoGenObject.AutoGenVersion < 0x00010005:
|
||||
# R8 modules use entry point specified in INF file
|
||||
# Edk modules use entry point specified in INF file
|
||||
ImageEntryPoint = ModuleEntryPoint
|
||||
else:
|
||||
# R9 modules always use "_ModuleEntryPoint" as entry point
|
||||
# EdkII modules always use "_ModuleEntryPoint" as entry point
|
||||
ImageEntryPoint = "_ModuleEntryPoint"
|
||||
|
||||
# tools definitions
|
||||
@@ -535,7 +535,7 @@ cleanlib:
|
||||
False
|
||||
)
|
||||
|
||||
# R8 modules need <BaseName>StrDefs.h for string ID
|
||||
# Edk modules need <BaseName>StrDefs.h for string ID
|
||||
#if self._AutoGenObject.AutoGenVersion < 0x00010005 and len(self._AutoGenObject.UnicodeFileList) > 0:
|
||||
# BcTargetList = ['strdefs']
|
||||
#else:
|
||||
|
Reference in New Issue
Block a user