mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
BaseTools: use predefined constants instead of local strings
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
parent
5a693b89a1
commit
55c84777ee
@ -259,7 +259,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
self.BuildDatabase = MetaFileDb
|
self.BuildDatabase = MetaFileDb
|
||||||
self.MetaFile = ActivePlatform
|
self.MetaFile = ActivePlatform
|
||||||
self.WorkspaceDir = WorkspaceDir
|
self.WorkspaceDir = WorkspaceDir
|
||||||
self.Platform = self.BuildDatabase[self.MetaFile, 'COMMON', Target, Toolchain]
|
self.Platform = self.BuildDatabase[self.MetaFile, TAB_COMMON, Target, Toolchain]
|
||||||
GlobalData.gActivePlatform = self.Platform
|
GlobalData.gActivePlatform = self.Platform
|
||||||
self.BuildTarget = Target
|
self.BuildTarget = Target
|
||||||
self.ToolChain = Toolchain
|
self.ToolChain = Toolchain
|
||||||
@ -788,7 +788,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
# Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use
|
# Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use
|
||||||
# BuildObject from one of AutoGenObjectList is enough.
|
# BuildObject from one of AutoGenObjectList is enough.
|
||||||
#
|
#
|
||||||
InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, 'COMMON', self.BuildTarget, self.ToolChain]
|
InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, TAB_COMMON, self.BuildTarget, self.ToolChain]
|
||||||
if not InfObj.Guid.upper() in _GuidDict.keys():
|
if not InfObj.Guid.upper() in _GuidDict.keys():
|
||||||
_GuidDict[InfObj.Guid.upper()] = FfsFile
|
_GuidDict[InfObj.Guid.upper()] = FfsFile
|
||||||
else:
|
else:
|
||||||
@ -1338,7 +1338,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
|
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
|
||||||
|
|
||||||
NvStoreOffset = int(NvStoreOffset,16) if NvStoreOffset.upper().startswith("0X") else int(NvStoreOffset)
|
NvStoreOffset = int(NvStoreOffset,16) if NvStoreOffset.upper().startswith("0X") else int(NvStoreOffset)
|
||||||
default_skuobj = PcdNvStoreDfBuffer[0].SkuInfoList.get("DEFAULT")
|
default_skuobj = PcdNvStoreDfBuffer[0].SkuInfoList.get(TAB_DEFAULT)
|
||||||
maxsize = self.VariableInfo.VpdRegionSize - NvStoreOffset if self.VariableInfo.VpdRegionSize else len(default_skuobj.DefaultValue.split(","))
|
maxsize = self.VariableInfo.VpdRegionSize - NvStoreOffset if self.VariableInfo.VpdRegionSize else len(default_skuobj.DefaultValue.split(","))
|
||||||
var_data = self.VariableInfo.PatchNVStoreDefaultMaxSize(maxsize)
|
var_data = self.VariableInfo.PatchNVStoreDefaultMaxSize(maxsize)
|
||||||
|
|
||||||
@ -1346,7 +1346,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
default_skuobj.DefaultValue = var_data
|
default_skuobj.DefaultValue = var_data
|
||||||
PcdNvStoreDfBuffer[0].DefaultValue = var_data
|
PcdNvStoreDfBuffer[0].DefaultValue = var_data
|
||||||
PcdNvStoreDfBuffer[0].SkuInfoList.clear()
|
PcdNvStoreDfBuffer[0].SkuInfoList.clear()
|
||||||
PcdNvStoreDfBuffer[0].SkuInfoList['DEFAULT'] = default_skuobj
|
PcdNvStoreDfBuffer[0].SkuInfoList[TAB_DEFAULT] = default_skuobj
|
||||||
PcdNvStoreDfBuffer[0].MaxDatumSize = str(len(default_skuobj.DefaultValue.split(",")))
|
PcdNvStoreDfBuffer[0].MaxDatumSize = str(len(default_skuobj.DefaultValue.split(",")))
|
||||||
|
|
||||||
return OrgVpdFile
|
return OrgVpdFile
|
||||||
@ -1577,12 +1577,12 @@ class PlatformAutoGen(AutoGen):
|
|||||||
PcdKey in VpdPcdDict:
|
PcdKey in VpdPcdDict:
|
||||||
Pcd = VpdPcdDict[PcdKey]
|
Pcd = VpdPcdDict[PcdKey]
|
||||||
SkuValueMap = {}
|
SkuValueMap = {}
|
||||||
DefaultSku = Pcd.SkuInfoList.get('DEFAULT')
|
DefaultSku = Pcd.SkuInfoList.get(TAB_DEFAULT)
|
||||||
if DefaultSku:
|
if DefaultSku:
|
||||||
PcdValue = DefaultSku.DefaultValue
|
PcdValue = DefaultSku.DefaultValue
|
||||||
if PcdValue not in SkuValueMap:
|
if PcdValue not in SkuValueMap:
|
||||||
SkuValueMap[PcdValue] = []
|
SkuValueMap[PcdValue] = []
|
||||||
VpdFile.Add(Pcd, 'DEFAULT',DefaultSku.VpdOffset)
|
VpdFile.Add(Pcd, TAB_DEFAULT,DefaultSku.VpdOffset)
|
||||||
SkuValueMap[PcdValue].append(DefaultSku)
|
SkuValueMap[PcdValue].append(DefaultSku)
|
||||||
|
|
||||||
for (SkuName,Sku) in Pcd.SkuInfoList.items():
|
for (SkuName,Sku) in Pcd.SkuInfoList.items():
|
||||||
@ -1641,9 +1641,9 @@ class PlatformAutoGen(AutoGen):
|
|||||||
# just pick the a value to determine whether is unicode string type
|
# just pick the a value to determine whether is unicode string type
|
||||||
SkuValueMap = {}
|
SkuValueMap = {}
|
||||||
SkuObjList = DscPcdEntry.SkuInfoList.items()
|
SkuObjList = DscPcdEntry.SkuInfoList.items()
|
||||||
DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT')
|
DefaultSku = DscPcdEntry.SkuInfoList.get(TAB_DEFAULT)
|
||||||
if DefaultSku:
|
if DefaultSku:
|
||||||
defaultindex = SkuObjList.index(('DEFAULT',DefaultSku))
|
defaultindex = SkuObjList.index((TAB_DEFAULT,DefaultSku))
|
||||||
SkuObjList[0],SkuObjList[defaultindex] = SkuObjList[defaultindex],SkuObjList[0]
|
SkuObjList[0],SkuObjList[defaultindex] = SkuObjList[defaultindex],SkuObjList[0]
|
||||||
for (SkuName,Sku) in SkuObjList:
|
for (SkuName,Sku) in SkuObjList:
|
||||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||||
@ -1767,7 +1767,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
for (SkuName,SkuId) in allskuset:
|
for (SkuName,SkuId) in allskuset:
|
||||||
if type(SkuId) in (str,unicode) and eval(SkuId) == 0 or SkuId == 0:
|
if type(SkuId) in (str,unicode) and eval(SkuId) == 0 or SkuId == 0:
|
||||||
continue
|
continue
|
||||||
pcd.SkuInfoList[SkuName] = copy.deepcopy(pcd.SkuInfoList['DEFAULT'])
|
pcd.SkuInfoList[SkuName] = copy.deepcopy(pcd.SkuInfoList[TAB_DEFAULT])
|
||||||
pcd.SkuInfoList[SkuName].SkuId = SkuId
|
pcd.SkuInfoList[SkuName].SkuId = SkuId
|
||||||
self.AllPcdList = self._NonDynamicPcdList + self._DynamicPcdList
|
self.AllPcdList = self._NonDynamicPcdList + self._DynamicPcdList
|
||||||
|
|
||||||
@ -2390,7 +2390,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
if self.Platform.SkuName in self.Platform.SkuIds:
|
if self.Platform.SkuName in self.Platform.SkuIds:
|
||||||
SkuName = self.Platform.SkuName
|
SkuName = self.Platform.SkuName
|
||||||
else:
|
else:
|
||||||
SkuName = 'DEFAULT'
|
SkuName = TAB_DEFAULT
|
||||||
ToPcd.SkuInfoList = {
|
ToPcd.SkuInfoList = {
|
||||||
SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuName][0], '', '', '', '', '', ToPcd.DefaultValue)
|
SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuName][0], '', '', '', '', '', ToPcd.DefaultValue)
|
||||||
}
|
}
|
||||||
@ -3420,7 +3420,7 @@ class ModuleAutoGen(AutoGen):
|
|||||||
if self._BinaryFileList is None:
|
if self._BinaryFileList is None:
|
||||||
self._BinaryFileList = []
|
self._BinaryFileList = []
|
||||||
for F in self.Module.Binaries:
|
for F in self.Module.Binaries:
|
||||||
if F.Target not in ['COMMON', '*'] and F.Target != self.BuildTarget:
|
if F.Target not in [TAB_COMMON, '*'] and F.Target != self.BuildTarget:
|
||||||
continue
|
continue
|
||||||
self._BinaryFileList.append(F)
|
self._BinaryFileList.append(F)
|
||||||
self._ApplyBuildRule(F, F.Type)
|
self._ApplyBuildRule(F, F.Type)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# The engine for building files
|
# The engine for building files
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -364,7 +364,7 @@ class BuildRule:
|
|||||||
self.Parse()
|
self.Parse()
|
||||||
|
|
||||||
# some intrinsic rules
|
# some intrinsic rules
|
||||||
self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, "COMMON", "COMMON", "COMMON"] = self._BinaryFileRule
|
self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, TAB_COMMON, TAB_COMMON, TAB_COMMON] = self._BinaryFileRule
|
||||||
self.FileTypeList.add(TAB_DEFAULT_BINARY_FILE)
|
self.FileTypeList.add(TAB_DEFAULT_BINARY_FILE)
|
||||||
|
|
||||||
## Parse the build rule strings
|
## Parse the build rule strings
|
||||||
@ -424,8 +424,8 @@ class BuildRule:
|
|||||||
def EndOfSection(self):
|
def EndOfSection(self):
|
||||||
Database = self.RuleDatabase
|
Database = self.RuleDatabase
|
||||||
# if there's specific toochain family, 'COMMON' doesn't make sense any more
|
# if there's specific toochain family, 'COMMON' doesn't make sense any more
|
||||||
if len(self._TotalToolChainFamilySet) > 1 and 'COMMON' in self._TotalToolChainFamilySet:
|
if len(self._TotalToolChainFamilySet) > 1 and TAB_COMMON in self._TotalToolChainFamilySet:
|
||||||
self._TotalToolChainFamilySet.remove('COMMON')
|
self._TotalToolChainFamilySet.remove(TAB_COMMON)
|
||||||
for Family in self._TotalToolChainFamilySet:
|
for Family in self._TotalToolChainFamilySet:
|
||||||
Input = self._RuleInfo[Family, self._InputFile]
|
Input = self._RuleInfo[Family, self._InputFile]
|
||||||
Output = self._RuleInfo[Family, self._OutputFile]
|
Output = self._RuleInfo[Family, self._OutputFile]
|
||||||
@ -452,8 +452,8 @@ class BuildRule:
|
|||||||
FileType = ''
|
FileType = ''
|
||||||
RuleNameList = self.RuleContent[LineIndex][1:-1].split(',')
|
RuleNameList = self.RuleContent[LineIndex][1:-1].split(',')
|
||||||
for RuleName in RuleNameList:
|
for RuleName in RuleNameList:
|
||||||
Arch = 'COMMON'
|
Arch = TAB_COMMON
|
||||||
BuildType = 'COMMON'
|
BuildType = TAB_COMMON
|
||||||
TokenList = [Token.strip().upper() for Token in RuleName.split('.')]
|
TokenList = [Token.strip().upper() for Token in RuleName.split('.')]
|
||||||
# old format: Build.File-Type
|
# old format: Build.File-Type
|
||||||
if TokenList[0] == "BUILD":
|
if TokenList[0] == "BUILD":
|
||||||
@ -486,12 +486,12 @@ class BuildRule:
|
|||||||
self._BuildTypeList.add(BuildType)
|
self._BuildTypeList.add(BuildType)
|
||||||
self._ArchList.add(Arch)
|
self._ArchList.add(Arch)
|
||||||
|
|
||||||
if 'COMMON' in self._BuildTypeList and len(self._BuildTypeList) > 1:
|
if TAB_COMMON in self._BuildTypeList and len(self._BuildTypeList) > 1:
|
||||||
EdkLogger.error("build", FORMAT_INVALID,
|
EdkLogger.error("build", FORMAT_INVALID,
|
||||||
"Specific build types must not be mixed with common one",
|
"Specific build types must not be mixed with common one",
|
||||||
File=self.RuleFile, Line=LineIndex + 1,
|
File=self.RuleFile, Line=LineIndex + 1,
|
||||||
ExtraData=self.RuleContent[LineIndex])
|
ExtraData=self.RuleContent[LineIndex])
|
||||||
if 'COMMON' in self._ArchList and len(self._ArchList) > 1:
|
if TAB_COMMON in self._ArchList and len(self._ArchList) > 1:
|
||||||
EdkLogger.error("build", FORMAT_INVALID,
|
EdkLogger.error("build", FORMAT_INVALID,
|
||||||
"Specific ARCH must not be mixed with common one",
|
"Specific ARCH must not be mixed with common one",
|
||||||
File=self.RuleFile, Line=LineIndex + 1,
|
File=self.RuleFile, Line=LineIndex + 1,
|
||||||
@ -524,7 +524,7 @@ class BuildRule:
|
|||||||
if len(TokenList) > 1:
|
if len(TokenList) > 1:
|
||||||
Family = TokenList[1].strip().upper()
|
Family = TokenList[1].strip().upper()
|
||||||
else:
|
else:
|
||||||
Family = "COMMON"
|
Family = TAB_COMMON
|
||||||
|
|
||||||
if Family not in FamilyList:
|
if Family not in FamilyList:
|
||||||
FamilyList.append(Family)
|
FamilyList.append(Family)
|
||||||
@ -532,7 +532,7 @@ class BuildRule:
|
|||||||
self._FamilyList = FamilyList
|
self._FamilyList = FamilyList
|
||||||
self._TotalToolChainFamilySet.update(FamilyList)
|
self._TotalToolChainFamilySet.update(FamilyList)
|
||||||
self._State = SectionType.upper()
|
self._State = SectionType.upper()
|
||||||
if 'COMMON' in FamilyList and len(FamilyList) > 1:
|
if TAB_COMMON in FamilyList and len(FamilyList) > 1:
|
||||||
EdkLogger.error("build", FORMAT_INVALID,
|
EdkLogger.error("build", FORMAT_INVALID,
|
||||||
"Specific tool chain family should not be mixed with general one",
|
"Specific tool chain family should not be mixed with general one",
|
||||||
File=self.RuleFile, Line=LineIndex + 1,
|
File=self.RuleFile, Line=LineIndex + 1,
|
||||||
|
@ -20,6 +20,7 @@ from ValidCheckingInfoObject import VAR_VALID_OBJECT_FACTORY
|
|||||||
from Common.VariableAttributes import VariableAttributes
|
from Common.VariableAttributes import VariableAttributes
|
||||||
import copy
|
import copy
|
||||||
from struct import unpack
|
from struct import unpack
|
||||||
|
from Common.DataType import TAB_DEFAULT
|
||||||
|
|
||||||
DATABASE_VERSION = 7
|
DATABASE_VERSION = 7
|
||||||
|
|
||||||
@ -981,14 +982,14 @@ def CreatePcdDataBase(PcdDBData):
|
|||||||
delta = {}
|
delta = {}
|
||||||
basedata = {}
|
basedata = {}
|
||||||
for skuname,skuid in PcdDBData:
|
for skuname,skuid in PcdDBData:
|
||||||
if len(PcdDBData[(skuname,skuid)][1]) != len(PcdDBData[("DEFAULT","0")][1]):
|
if len(PcdDBData[(skuname,skuid)][1]) != len(PcdDBData[(TAB_DEFAULT,"0")][1]):
|
||||||
EdkLogger.ERROR("The size of each sku in one pcd are not same")
|
EdkLogger.ERROR("The size of each sku in one pcd are not same")
|
||||||
for skuname,skuid in PcdDBData:
|
for skuname,skuid in PcdDBData:
|
||||||
if skuname == "DEFAULT":
|
if skuname == TAB_DEFAULT:
|
||||||
continue
|
continue
|
||||||
delta[(skuname,skuid)] = [(index,data,hex(data)) for index,data in enumerate(PcdDBData[(skuname,skuid)][1]) if PcdDBData[(skuname,skuid)][1][index] != PcdDBData[("DEFAULT","0")][1][index]]
|
delta[(skuname,skuid)] = [(index,data,hex(data)) for index,data in enumerate(PcdDBData[(skuname,skuid)][1]) if PcdDBData[(skuname,skuid)][1][index] != PcdDBData[(TAB_DEFAULT,"0")][1][index]]
|
||||||
basedata[(skuname,skuid)] = [(index,PcdDBData[("DEFAULT","0")][1][index],hex(PcdDBData[("DEFAULT","0")][1][index])) for index,data in enumerate(PcdDBData[(skuname,skuid)][1]) if PcdDBData[(skuname,skuid)][1][index] != PcdDBData[("DEFAULT","0")][1][index]]
|
basedata[(skuname,skuid)] = [(index,PcdDBData[(TAB_DEFAULT,"0")][1][index],hex(PcdDBData[(TAB_DEFAULT,"0")][1][index])) for index,data in enumerate(PcdDBData[(skuname,skuid)][1]) if PcdDBData[(skuname,skuid)][1][index] != PcdDBData[(TAB_DEFAULT,"0")][1][index]]
|
||||||
databasebuff = PcdDBData[("DEFAULT","0")][0]
|
databasebuff = PcdDBData[(TAB_DEFAULT,"0")][0]
|
||||||
|
|
||||||
for skuname,skuid in delta:
|
for skuname,skuid in delta:
|
||||||
# 8 byte align
|
# 8 byte align
|
||||||
@ -1010,8 +1011,10 @@ def CreatePcdDataBase(PcdDBData):
|
|||||||
newbuffer += databasebuff[i]
|
newbuffer += databasebuff[i]
|
||||||
|
|
||||||
return newbuffer
|
return newbuffer
|
||||||
|
|
||||||
def CreateVarCheckBin(VarCheckTab):
|
def CreateVarCheckBin(VarCheckTab):
|
||||||
return VarCheckTab[('DEFAULT',"0")]
|
return VarCheckTab[(TAB_DEFAULT,"0")]
|
||||||
|
|
||||||
def CreateAutoGen(PcdDriverAutoGenData):
|
def CreateAutoGen(PcdDriverAutoGenData):
|
||||||
autogenC = TemplateString()
|
autogenC = TemplateString()
|
||||||
for skuname,skuid in PcdDriverAutoGenData:
|
for skuname,skuid in PcdDriverAutoGenData:
|
||||||
@ -1062,7 +1065,7 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase):
|
|||||||
final_data = ()
|
final_data = ()
|
||||||
for item in PcdDbBuffer:
|
for item in PcdDbBuffer:
|
||||||
final_data += unpack("B",item)
|
final_data += unpack("B",item)
|
||||||
PcdDBData[("DEFAULT","0")] = (PcdDbBuffer, final_data)
|
PcdDBData[(TAB_DEFAULT,"0")] = (PcdDbBuffer, final_data)
|
||||||
|
|
||||||
return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDBData)
|
return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDBData)
|
||||||
## Create PCD database in DXE or PEI phase
|
## Create PCD database in DXE or PEI phase
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -142,7 +142,7 @@ class VariableMgr(object):
|
|||||||
default_data_buffer = ""
|
default_data_buffer = ""
|
||||||
others_data_buffer = ""
|
others_data_buffer = ""
|
||||||
tail = None
|
tail = None
|
||||||
default_sku_default = indexedvarinfo.get(index).get(("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT))
|
default_sku_default = indexedvarinfo.get(index).get((DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT))
|
||||||
|
|
||||||
if default_sku_default.data_type not in ["UINT8","UINT16","UINT32","UINT64","BOOLEAN"]:
|
if default_sku_default.data_type not in ["UINT8","UINT16","UINT32","UINT64","BOOLEAN"]:
|
||||||
var_max_len = max([len(var_item.default_value.split(",")) for var_item in sku_var_info.values()])
|
var_max_len = max([len(var_item.default_value.split(",")) for var_item in sku_var_info.values()])
|
||||||
@ -155,13 +155,13 @@ class VariableMgr(object):
|
|||||||
for item in default_data_buffer:
|
for item in default_data_buffer:
|
||||||
default_data_array += unpack("B",item)
|
default_data_array += unpack("B",item)
|
||||||
|
|
||||||
if ("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT) not in var_data:
|
if (DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT) not in var_data:
|
||||||
var_data[("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT)] = collections.OrderedDict()
|
var_data[(DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT)] = collections.OrderedDict()
|
||||||
var_data[("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT)][index] = (default_data_buffer,sku_var_info[("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT)])
|
var_data[(DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT)][index] = (default_data_buffer,sku_var_info[(DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT)])
|
||||||
|
|
||||||
for (skuid,defaultstoragename) in indexedvarinfo.get(index):
|
for (skuid,defaultstoragename) in indexedvarinfo.get(index):
|
||||||
tail = None
|
tail = None
|
||||||
if (skuid,defaultstoragename) == ("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT):
|
if (skuid,defaultstoragename) == (DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT):
|
||||||
continue
|
continue
|
||||||
other_sku_other = indexedvarinfo.get(index).get((skuid,defaultstoragename))
|
other_sku_other = indexedvarinfo.get(index).get((skuid,defaultstoragename))
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ class VariableMgr(object):
|
|||||||
if not var_data:
|
if not var_data:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
pcds_default_data = var_data.get(("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT),{})
|
pcds_default_data = var_data.get((DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT),{})
|
||||||
NvStoreDataBuffer = ""
|
NvStoreDataBuffer = ""
|
||||||
var_data_offset = collections.OrderedDict()
|
var_data_offset = collections.OrderedDict()
|
||||||
offset = NvStorageHeaderSize
|
offset = NvStorageHeaderSize
|
||||||
@ -220,7 +220,7 @@ class VariableMgr(object):
|
|||||||
|
|
||||||
data_delta_structure_buffer = ""
|
data_delta_structure_buffer = ""
|
||||||
for skuname,defaultstore in var_data:
|
for skuname,defaultstore in var_data:
|
||||||
if (skuname,defaultstore) == ("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT):
|
if (skuname,defaultstore) == (DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT):
|
||||||
continue
|
continue
|
||||||
pcds_sku_data = var_data.get((skuname,defaultstore))
|
pcds_sku_data = var_data.get((skuname,defaultstore))
|
||||||
delta_data_set = []
|
delta_data_set = []
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# This file is used to define common static strings used by INF/DEC/DSC files
|
# This file is used to define common static strings used by INF/DEC/DSC files
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
|
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -312,6 +312,8 @@ TAB_DEFINE = 'DEFINE'
|
|||||||
TAB_NMAKE = 'Nmake'
|
TAB_NMAKE = 'Nmake'
|
||||||
TAB_USER_EXTENSIONS = 'UserExtensions'
|
TAB_USER_EXTENSIONS = 'UserExtensions'
|
||||||
TAB_INCLUDE = '!include'
|
TAB_INCLUDE = '!include'
|
||||||
|
TAB_DEFAULT = 'DEFAULT'
|
||||||
|
TAB_COMMON = 'COMMON'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Common Define
|
# Common Define
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# process APRIORI file data and generate PEI/DXE APRIORI file
|
# process APRIORI file data and generate PEI/DXE APRIORI file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -25,6 +25,7 @@ from Common.String import *
|
|||||||
from Common.Misc import SaveFileOnChange,PathClass
|
from Common.Misc import SaveFileOnChange,PathClass
|
||||||
from Common import EdkLogger
|
from Common import EdkLogger
|
||||||
from Common.BuildToolError import *
|
from Common.BuildToolError import *
|
||||||
|
from Common.DataType import TAB_COMMON
|
||||||
|
|
||||||
## process APRIORI file data and generate PEI/DXE APRIORI file
|
## process APRIORI file data and generate PEI/DXE APRIORI file
|
||||||
#
|
#
|
||||||
@ -84,7 +85,7 @@ class AprioriSection (AprioriSectionClassObject):
|
|||||||
Guid = Inf.Guid
|
Guid = Inf.Guid
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
|
Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
|
||||||
Guid = Inf.Guid
|
Guid = Inf.Guid
|
||||||
|
|
||||||
self.BinFileList = Inf.Module.Binaries
|
self.BinFileList = Inf.Module.Binaries
|
||||||
|
@ -52,6 +52,7 @@ from Common.String import NormPath
|
|||||||
import Common.GlobalData as GlobalData
|
import Common.GlobalData as GlobalData
|
||||||
from Common.Expression import *
|
from Common.Expression import *
|
||||||
from Common import GlobalData
|
from Common import GlobalData
|
||||||
|
from Common.DataType import *
|
||||||
from Common.String import ReplaceMacro
|
from Common.String import ReplaceMacro
|
||||||
import uuid
|
import uuid
|
||||||
from Common.Misc import tdict
|
from Common.Misc import tdict
|
||||||
@ -511,8 +512,8 @@ class FdfParser:
|
|||||||
if Item == '' or Item == 'RULE':
|
if Item == '' or Item == 'RULE':
|
||||||
return
|
return
|
||||||
|
|
||||||
if Item == 'DEFINES':
|
if Item == TAB_COMMON_DEFINES.upper():
|
||||||
self.__CurSection = ['COMMON', 'COMMON', 'COMMON']
|
self.__CurSection = [TAB_COMMON, TAB_COMMON, TAB_COMMON]
|
||||||
elif Item == 'VTF' and len(ItemList) == 3:
|
elif Item == 'VTF' and len(ItemList) == 3:
|
||||||
UiName = ItemList[2]
|
UiName = ItemList[2]
|
||||||
Pos = UiName.find(',')
|
Pos = UiName.find(',')
|
||||||
@ -520,9 +521,9 @@ class FdfParser:
|
|||||||
UiName = UiName[:Pos]
|
UiName = UiName[:Pos]
|
||||||
self.__CurSection = ['VTF', UiName, ItemList[1]]
|
self.__CurSection = ['VTF', UiName, ItemList[1]]
|
||||||
elif len(ItemList) > 1:
|
elif len(ItemList) > 1:
|
||||||
self.__CurSection = [ItemList[0], ItemList[1], 'COMMON']
|
self.__CurSection = [ItemList[0], ItemList[1], TAB_COMMON]
|
||||||
elif len(ItemList) > 0:
|
elif len(ItemList) > 0:
|
||||||
self.__CurSection = [ItemList[0], 'DUMMY', 'COMMON']
|
self.__CurSection = [ItemList[0], 'DUMMY', TAB_COMMON]
|
||||||
|
|
||||||
## PreprocessFile() method
|
## PreprocessFile() method
|
||||||
#
|
#
|
||||||
@ -886,7 +887,7 @@ class FdfParser:
|
|||||||
|
|
||||||
if self.__CurSection:
|
if self.__CurSection:
|
||||||
# Defines macro
|
# Defines macro
|
||||||
ScopeMacro = self.__MacroDict['COMMON', 'COMMON', 'COMMON']
|
ScopeMacro = self.__MacroDict[TAB_COMMON, TAB_COMMON, TAB_COMMON]
|
||||||
if ScopeMacro:
|
if ScopeMacro:
|
||||||
MacroDict.update(ScopeMacro)
|
MacroDict.update(ScopeMacro)
|
||||||
|
|
||||||
@ -3586,7 +3587,7 @@ class FdfParser:
|
|||||||
raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
|
raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
|
||||||
|
|
||||||
Arch = self.__SkippedChars.rstrip(".")
|
Arch = self.__SkippedChars.rstrip(".")
|
||||||
if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):
|
if Arch.upper() not in ARCH_LIST_FULL:
|
||||||
raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
|
raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
|
||||||
|
|
||||||
ModuleType = self.__GetModuleType()
|
ModuleType = self.__GetModuleType()
|
||||||
|
@ -47,6 +47,7 @@ import Common.GlobalData as GlobalData
|
|||||||
from DepexSection import DepexSection
|
from DepexSection import DepexSection
|
||||||
from Common.Misc import SaveFileOnChange
|
from Common.Misc import SaveFileOnChange
|
||||||
from Common.Expression import *
|
from Common.Expression import *
|
||||||
|
from Common.DataType import TAB_COMMON
|
||||||
|
|
||||||
## generate FFS from INF
|
## generate FFS from INF
|
||||||
#
|
#
|
||||||
@ -205,7 +206,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
|
|||||||
self.ShadowFromInfFile = Inf.Shadow
|
self.ShadowFromInfFile = Inf.Shadow
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
|
Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
|
||||||
self.BaseName = Inf.BaseName
|
self.BaseName = Inf.BaseName
|
||||||
self.ModuleGuid = Inf.Guid
|
self.ModuleGuid = Inf.Guid
|
||||||
self.ModuleType = Inf.ModuleType
|
self.ModuleType = Inf.ModuleType
|
||||||
@ -570,7 +571,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
|
|||||||
|
|
||||||
RuleName = 'RULE' + \
|
RuleName = 'RULE' + \
|
||||||
'.' + \
|
'.' + \
|
||||||
'COMMON' + \
|
TAB_COMMON + \
|
||||||
'.' + \
|
'.' + \
|
||||||
self.ModuleType.upper()
|
self.ModuleType.upper()
|
||||||
|
|
||||||
|
@ -238,11 +238,11 @@ def main():
|
|||||||
ArchList = Options.archList.split(',')
|
ArchList = Options.archList.split(',')
|
||||||
else:
|
else:
|
||||||
# EdkLogger.error("GenFds", OPTION_MISSING, "Missing build ARCH")
|
# EdkLogger.error("GenFds", OPTION_MISSING, "Missing build ARCH")
|
||||||
ArchList = BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON', Options.BuildTarget, Options.ToolChain].SupArchList
|
ArchList = BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, TAB_COMMON, Options.BuildTarget, Options.ToolChain].SupArchList
|
||||||
|
|
||||||
TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON', Options.BuildTarget, Options.ToolChain].SupArchList) & set(ArchList)
|
TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, TAB_COMMON, Options.BuildTarget, Options.ToolChain].SupArchList) & set(ArchList)
|
||||||
if len(TargetArchList) == 0:
|
if len(TargetArchList) == 0:
|
||||||
EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in platform supported ARCH %s" % (str(ArchList), str(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList)))
|
EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in platform supported ARCH %s" % (str(ArchList), str(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, TAB_COMMON].SupArchList)))
|
||||||
|
|
||||||
for Arch in ArchList:
|
for Arch in ArchList:
|
||||||
GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, Options.BuildTarget, Options.ToolChain].OutputDirectory)
|
GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, Options.BuildTarget, Options.ToolChain].OutputDirectory)
|
||||||
@ -674,7 +674,7 @@ class GenFds :
|
|||||||
# @retval None
|
# @retval None
|
||||||
#
|
#
|
||||||
def PreprocessImage(BuildDb, DscFile):
|
def PreprocessImage(BuildDb, DscFile):
|
||||||
PcdDict = BuildDb.BuildObject[DscFile, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Pcds
|
PcdDict = BuildDb.BuildObject[DscFile, TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Pcds
|
||||||
PcdValue = ''
|
PcdValue = ''
|
||||||
for Key in PcdDict:
|
for Key in PcdDict:
|
||||||
PcdObj = PcdDict[Key]
|
PcdObj = PcdDict[Key]
|
||||||
@ -693,9 +693,9 @@ class GenFds :
|
|||||||
if Int64PcdValue > 0:
|
if Int64PcdValue > 0:
|
||||||
TopAddress = Int64PcdValue
|
TopAddress = Int64PcdValue
|
||||||
|
|
||||||
ModuleDict = BuildDb.BuildObject[DscFile, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Modules
|
ModuleDict = BuildDb.BuildObject[DscFile, TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Modules
|
||||||
for Key in ModuleDict:
|
for Key in ModuleDict:
|
||||||
ModuleObj = BuildDb.BuildObject[Key, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
|
ModuleObj = BuildDb.BuildObject[Key, TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
|
||||||
print ModuleObj.BaseName + ' ' + ModuleObj.ModuleType
|
print ModuleObj.BaseName + ' ' + ModuleObj.ModuleType
|
||||||
|
|
||||||
def GenerateGuidXRefFile(BuildDb, ArchList, FdfParserObj):
|
def GenerateGuidXRefFile(BuildDb, ArchList, FdfParserObj):
|
||||||
|
@ -130,7 +130,7 @@ class GenFdsGlobalVariable:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def GetBuildRules(Inf, Arch):
|
def GetBuildRules(Inf, Arch):
|
||||||
if not Arch:
|
if not Arch:
|
||||||
Arch = 'COMMON'
|
Arch = DataType.TAB_COMMON
|
||||||
|
|
||||||
if not Arch in GenFdsGlobalVariable.OutputDirDict:
|
if not Arch in GenFdsGlobalVariable.OutputDirDict:
|
||||||
return {}
|
return {}
|
||||||
@ -217,7 +217,7 @@ class GenFdsGlobalVariable:
|
|||||||
FileList.append((File, DataType.TAB_UNKNOWN_FILE))
|
FileList.append((File, DataType.TAB_UNKNOWN_FILE))
|
||||||
|
|
||||||
for File in Inf.Binaries:
|
for File in Inf.Binaries:
|
||||||
if File.Target in ['COMMON', '*', GenFdsGlobalVariable.TargetName]:
|
if File.Target in [DataType.TAB_COMMON, '*', GenFdsGlobalVariable.TargetName]:
|
||||||
FileList.append((File, File.Type))
|
FileList.append((File, File.Type))
|
||||||
|
|
||||||
for File, FileType in FileList:
|
for File, FileType in FileList:
|
||||||
@ -759,7 +759,7 @@ class GenFdsGlobalVariable:
|
|||||||
# @param Str String that may contain macro
|
# @param Str String that may contain macro
|
||||||
# @param MacroDict Dictionary that contains macro value pair
|
# @param MacroDict Dictionary that contains macro value pair
|
||||||
#
|
#
|
||||||
def MacroExtend (Str, MacroDict={}, Arch='COMMON'):
|
def MacroExtend (Str, MacroDict={}, Arch=DataType.TAB_COMMON):
|
||||||
if Str is None :
|
if Str is None :
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ class GenFdsGlobalVariable:
|
|||||||
'$(SPACE)' : ' '
|
'$(SPACE)' : ' '
|
||||||
}
|
}
|
||||||
OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[GenFdsGlobalVariable.ArchList[0]]
|
OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[GenFdsGlobalVariable.ArchList[0]]
|
||||||
if Arch != 'COMMON' and Arch in GenFdsGlobalVariable.ArchList:
|
if Arch != DataType.TAB_COMMON and Arch in GenFdsGlobalVariable.ArchList:
|
||||||
OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[Arch]
|
OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[Arch]
|
||||||
|
|
||||||
Dict['$(OUTPUT_DIRECTORY)'] = OutputDir
|
Dict['$(OUTPUT_DIRECTORY)'] = OutputDir
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# section base class
|
# section base class
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -20,6 +20,7 @@ from GenFdsGlobalVariable import GenFdsGlobalVariable
|
|||||||
import Common.LongFilePathOs as os, glob
|
import Common.LongFilePathOs as os, glob
|
||||||
from Common import EdkLogger
|
from Common import EdkLogger
|
||||||
from Common.BuildToolError import *
|
from Common.BuildToolError import *
|
||||||
|
from Common.DataType import TAB_ARCH_COMMON
|
||||||
|
|
||||||
## section base class
|
## section base class
|
||||||
#
|
#
|
||||||
@ -125,7 +126,7 @@ class Section (SectionClassObject):
|
|||||||
FileList = []
|
FileList = []
|
||||||
if FileType is not None:
|
if FileType is not None:
|
||||||
for File in FfsInf.BinFileList:
|
for File in FfsInf.BinFileList:
|
||||||
if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:
|
if File.Arch == TAB_ARCH_COMMON or FfsInf.CurrentArch == File.Arch:
|
||||||
if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \
|
if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \
|
||||||
and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX') \
|
and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX') \
|
||||||
or (FileType == 'TE'and File.Type == 'PE32'):
|
or (FileType == 'TE'and File.Type == 'PE32'):
|
||||||
|
@ -63,7 +63,7 @@ class DecBuildData(PackageBuildClassObject):
|
|||||||
# @param Platform (not used for DecBuildData)
|
# @param Platform (not used for DecBuildData)
|
||||||
# @param Macros Macros used for replacement in DSC file
|
# @param Macros Macros used for replacement in DSC file
|
||||||
#
|
#
|
||||||
def __init__(self, File, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
|
def __init__(self, File, RawData, BuildDataBase, Arch=TAB_ARCH_COMMON, Target=None, Toolchain=None):
|
||||||
self.MetaFile = File
|
self.MetaFile = File
|
||||||
self._PackageDir = File.Dir
|
self._PackageDir = File.Dir
|
||||||
self._RawData = RawData
|
self._RawData = RawData
|
||||||
@ -327,7 +327,7 @@ class DecBuildData(PackageBuildClassObject):
|
|||||||
PublicInclues.append(File)
|
PublicInclues.append(File)
|
||||||
if File in self._PrivateIncludes:
|
if File in self._PrivateIncludes:
|
||||||
EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % File, File=self.MetaFile, Line=LineNo)
|
EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % File, File=self.MetaFile, Line=LineNo)
|
||||||
if Record[3] == "COMMON":
|
if Record[3] == TAB_COMMON:
|
||||||
self._CommonIncludes.append(File)
|
self._CommonIncludes.append(File)
|
||||||
return self._Includes
|
return self._Includes
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
# @param Platform (not used for DscBuildData)
|
# @param Platform (not used for DscBuildData)
|
||||||
# @param Macros Macros used for replacement in DSC file
|
# @param Macros Macros used for replacement in DSC file
|
||||||
#
|
#
|
||||||
def __init__(self, FilePath, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
|
def __init__(self, FilePath, RawData, BuildDataBase, Arch=TAB_ARCH_COMMON, Target=None, Toolchain=None):
|
||||||
self.MetaFile = FilePath
|
self.MetaFile = FilePath
|
||||||
self._RawData = RawData
|
self._RawData = RawData
|
||||||
self._Bdb = BuildDataBase
|
self._Bdb = BuildDataBase
|
||||||
@ -510,7 +510,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
if self._Header is None:
|
if self._Header is None:
|
||||||
self._GetHeaderInfo()
|
self._GetHeaderInfo()
|
||||||
if self._SkuName is None:
|
if self._SkuName is None:
|
||||||
self._SkuName = 'DEFAULT'
|
self._SkuName = TAB_DEFAULT
|
||||||
return self._SkuName
|
return self._SkuName
|
||||||
|
|
||||||
## Override SKUID_IDENTIFIER
|
## Override SKUID_IDENTIFIER
|
||||||
@ -652,10 +652,10 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
EdkLogger.error('build', FORMAT_INVALID, "The format of the Sku ID name is invalid. The correct format is '(a-zA-Z0-9_)(a-zA-Z0-9_-.)*'",
|
EdkLogger.error('build', FORMAT_INVALID, "The format of the Sku ID name is invalid. The correct format is '(a-zA-Z0-9_)(a-zA-Z0-9_-.)*'",
|
||||||
File=self.MetaFile, Line=Record[-1])
|
File=self.MetaFile, Line=Record[-1])
|
||||||
self._SkuIds[Record[1].upper()] = (str(DscBuildData.ToInt(Record[0])), Record[1].upper(), Record[2].upper())
|
self._SkuIds[Record[1].upper()] = (str(DscBuildData.ToInt(Record[0])), Record[1].upper(), Record[2].upper())
|
||||||
if 'DEFAULT' not in self._SkuIds:
|
if TAB_DEFAULT not in self._SkuIds:
|
||||||
self._SkuIds['DEFAULT'] = ("0","DEFAULT","DEFAULT")
|
self._SkuIds[TAB_DEFAULT] = ("0", TAB_DEFAULT, TAB_DEFAULT)
|
||||||
if 'COMMON' not in self._SkuIds:
|
if TAB_COMMON not in self._SkuIds:
|
||||||
self._SkuIds['COMMON'] = ("0","DEFAULT","DEFAULT")
|
self._SkuIds[TAB_COMMON] = ("0", TAB_DEFAULT, TAB_DEFAULT)
|
||||||
return self._SkuIds
|
return self._SkuIds
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -708,7 +708,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
ExtraData=ErrorInfo)
|
ExtraData=ErrorInfo)
|
||||||
# Check duplication
|
# Check duplication
|
||||||
# If arch is COMMON, no duplicate module is checked since all modules in all component sections are selected
|
# If arch is COMMON, no duplicate module is checked since all modules in all component sections are selected
|
||||||
if self._Arch != 'COMMON' and ModuleFile in self._Modules:
|
if self._Arch != TAB_ARCH_COMMON and ModuleFile in self._Modules:
|
||||||
DuplicatedFile = True
|
DuplicatedFile = True
|
||||||
|
|
||||||
Module = ModuleBuildClassObject()
|
Module = ModuleBuildClassObject()
|
||||||
@ -817,7 +817,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
|
EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
|
||||||
ExtraData=ErrorInfo)
|
ExtraData=ErrorInfo)
|
||||||
|
|
||||||
if ModuleType != 'COMMON' and ModuleType not in SUP_MODULE_LIST:
|
if ModuleType != TAB_COMMON and ModuleType not in SUP_MODULE_LIST:
|
||||||
EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module type [%s]" % ModuleType,
|
EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module type [%s]" % ModuleType,
|
||||||
File=self.MetaFile, ExtraData=LibraryInstance, Line=LineNo)
|
File=self.MetaFile, ExtraData=LibraryInstance, Line=LineNo)
|
||||||
LibraryClassDict[Arch, ModuleType, LibraryClass] = LibraryInstance
|
LibraryClassDict[Arch, ModuleType, LibraryClass] = LibraryInstance
|
||||||
@ -929,9 +929,9 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
if sku_usage == SkuClass.SINGLE:
|
if sku_usage == SkuClass.SINGLE:
|
||||||
for pcdname in Pcds:
|
for pcdname in Pcds:
|
||||||
pcd = Pcds[pcdname]
|
pcd = Pcds[pcdname]
|
||||||
Pcds[pcdname].SkuInfoList = {"DEFAULT":pcd.SkuInfoList[skuid] for skuid in pcd.SkuInfoList if skuid in available_sku}
|
Pcds[pcdname].SkuInfoList = {TAB_DEFAULT:pcd.SkuInfoList[skuid] for skuid in pcd.SkuInfoList if skuid in available_sku}
|
||||||
if type(pcd) is StructurePcd and pcd.SkuOverrideValues:
|
if type(pcd) is StructurePcd and pcd.SkuOverrideValues:
|
||||||
Pcds[pcdname].SkuOverrideValues = {"DEFAULT":pcd.SkuOverrideValues[skuid] for skuid in pcd.SkuOverrideValues if skuid in available_sku}
|
Pcds[pcdname].SkuOverrideValues = {TAB_DEFAULT:pcd.SkuOverrideValues[skuid] for skuid in pcd.SkuOverrideValues if skuid in available_sku}
|
||||||
else:
|
else:
|
||||||
for pcdname in Pcds:
|
for pcdname in Pcds:
|
||||||
pcd = Pcds[pcdname]
|
pcd = Pcds[pcdname]
|
||||||
@ -957,9 +957,9 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:
|
self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:
|
||||||
pcd.PcdValueFromComm = pcd.DefaultValue
|
pcd.PcdValueFromComm = pcd.DefaultValue
|
||||||
elif pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
|
elif pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
|
||||||
pcd.PcdValueFromComm = pcd.SkuInfoList.get("DEFAULT").HiiDefaultValue
|
pcd.PcdValueFromComm = pcd.SkuInfoList.get(TAB_DEFAULT).HiiDefaultValue
|
||||||
else:
|
else:
|
||||||
pcd.PcdValueFromComm = pcd.SkuInfoList.get("DEFAULT").DefaultValue
|
pcd.PcdValueFromComm = pcd.SkuInfoList.get(TAB_DEFAULT).DefaultValue
|
||||||
for pcd in self._Pcds:
|
for pcd in self._Pcds:
|
||||||
if isinstance(self._Pcds[pcd],StructurePcd) and (self._Pcds[pcd].PcdValueFromComm or self._Pcds[pcd].PcdFieldValueFromComm):
|
if isinstance(self._Pcds[pcd],StructurePcd) and (self._Pcds[pcd].PcdValueFromComm or self._Pcds[pcd].PcdFieldValueFromComm):
|
||||||
UpdateCommandLineValue(self._Pcds[pcd])
|
UpdateCommandLineValue(self._Pcds[pcd])
|
||||||
@ -1152,7 +1152,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
for CodeBase in (EDKII_NAME, EDK_NAME):
|
for CodeBase in (EDKII_NAME, EDK_NAME):
|
||||||
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, CodeBase]
|
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, CodeBase]
|
||||||
for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4,Dummy5 in RecordList:
|
for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4,Dummy5 in RecordList:
|
||||||
if Dummy3.upper() != 'COMMON':
|
if Dummy3.upper() != TAB_COMMON:
|
||||||
continue
|
continue
|
||||||
CurKey = (ToolChainFamily, ToolChain, CodeBase)
|
CurKey = (ToolChainFamily, ToolChain, CodeBase)
|
||||||
#
|
#
|
||||||
@ -1172,7 +1172,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
options = OrderedDict()
|
options = OrderedDict()
|
||||||
self._ModuleTypeOptions[Edk, ModuleType] = options
|
self._ModuleTypeOptions[Edk, ModuleType] = options
|
||||||
DriverType = '%s.%s' % (Edk, ModuleType)
|
DriverType = '%s.%s' % (Edk, ModuleType)
|
||||||
CommonDriverType = '%s.%s' % ('COMMON', ModuleType)
|
CommonDriverType = '%s.%s' % (TAB_COMMON, ModuleType)
|
||||||
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch]
|
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch]
|
||||||
for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4,Dummy5 in RecordList:
|
for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4,Dummy5 in RecordList:
|
||||||
Type = Dummy2 + '.' + Dummy3
|
Type = Dummy2 + '.' + Dummy3
|
||||||
@ -1275,7 +1275,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
Pcds = AllPcds
|
Pcds = AllPcds
|
||||||
DefaultStoreMgr = DefaultStore(self.DefaultStores)
|
DefaultStoreMgr = DefaultStore(self.DefaultStores)
|
||||||
SkuIds = self.SkuIdMgr.AvailableSkuIdSet
|
SkuIds = self.SkuIdMgr.AvailableSkuIdSet
|
||||||
SkuIds.update({'DEFAULT':0})
|
SkuIds.update({TAB_DEFAULT:0})
|
||||||
DefaultStores = set([storename for pcdobj in AllPcds.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict.keys()])
|
DefaultStores = set([storename for pcdobj in AllPcds.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict.keys()])
|
||||||
|
|
||||||
S_PcdSet = []
|
S_PcdSet = []
|
||||||
@ -1288,7 +1288,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, default_store, Dummy4,Dummy5 in RecordList:
|
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, default_store, Dummy4,Dummy5 in RecordList:
|
||||||
SkuName = SkuName.upper()
|
SkuName = SkuName.upper()
|
||||||
default_store = default_store.upper()
|
default_store = default_store.upper()
|
||||||
SkuName = 'DEFAULT' if SkuName == 'COMMON' else SkuName
|
SkuName = TAB_DEFAULT if SkuName == TAB_COMMON else SkuName
|
||||||
if SkuName not in SkuIds:
|
if SkuName not in SkuIds:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -1316,7 +1316,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
|
str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
|
||||||
for str_pcd_data in StrPcdSet[str_pcd]:
|
for str_pcd_data in StrPcdSet[str_pcd]:
|
||||||
if str_pcd_data[3] in SkuIds:
|
if str_pcd_data[3] in SkuIds:
|
||||||
str_pcd_obj_str.AddOverrideValue(str_pcd_data[2], str(str_pcd_data[6]), 'DEFAULT' if str_pcd_data[3] == 'COMMON' else str_pcd_data[3],TAB_DEFAULT_STORES_DEFAULT if str_pcd_data[4] == 'COMMON' else str_pcd_data[4], self.MetaFile.File if self.WorkspaceDir not in self.MetaFile.File else self.MetaFile.File[len(self.WorkspaceDir) if self.WorkspaceDir.endswith(os.path.sep) else len(self.WorkspaceDir)+1:],LineNo=str_pcd_data[5])
|
str_pcd_obj_str.AddOverrideValue(str_pcd_data[2], str(str_pcd_data[6]), TAB_DEFAULT if str_pcd_data[3] == TAB_COMMON else str_pcd_data[3],TAB_DEFAULT_STORES_DEFAULT if str_pcd_data[4] == TAB_COMMON else str_pcd_data[4], self.MetaFile.File if self.WorkspaceDir not in self.MetaFile.File else self.MetaFile.File[len(self.WorkspaceDir) if self.WorkspaceDir.endswith(os.path.sep) else len(self.WorkspaceDir)+1:],LineNo=str_pcd_data[5])
|
||||||
S_pcd_set[str_pcd[1], str_pcd[0]] = str_pcd_obj_str
|
S_pcd_set[str_pcd[1], str_pcd[0]] = str_pcd_obj_str
|
||||||
else:
|
else:
|
||||||
EdkLogger.error('build', PARSER_ERROR,
|
EdkLogger.error('build', PARSER_ERROR,
|
||||||
@ -1346,7 +1346,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
NoDefault = False
|
NoDefault = False
|
||||||
if skuid not in stru_pcd.SkuOverrideValues:
|
if skuid not in stru_pcd.SkuOverrideValues:
|
||||||
while nextskuid not in stru_pcd.SkuOverrideValues:
|
while nextskuid not in stru_pcd.SkuOverrideValues:
|
||||||
if nextskuid == "DEFAULT":
|
if nextskuid == TAB_DEFAULT:
|
||||||
NoDefault = True
|
NoDefault = True
|
||||||
break
|
break
|
||||||
nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
|
nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
|
||||||
@ -1359,7 +1359,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
NoDefault = False
|
NoDefault = False
|
||||||
if skuid not in stru_pcd.SkuOverrideValues:
|
if skuid not in stru_pcd.SkuOverrideValues:
|
||||||
while nextskuid not in stru_pcd.SkuOverrideValues:
|
while nextskuid not in stru_pcd.SkuOverrideValues:
|
||||||
if nextskuid == "DEFAULT":
|
if nextskuid == TAB_DEFAULT:
|
||||||
NoDefault = True
|
NoDefault = True
|
||||||
break
|
break
|
||||||
nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
|
nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
|
||||||
@ -1389,14 +1389,14 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.update({StoreName:PcdValue})
|
str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.update({StoreName:PcdValue})
|
||||||
elif str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD],
|
elif str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD],
|
||||||
self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:
|
self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:
|
||||||
if skuname in (self.SkuIdMgr.SystemSkuId, 'DEFAULT', 'COMMON'):
|
if skuname in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COMMON):
|
||||||
str_pcd_obj.DefaultValue = PcdValue
|
str_pcd_obj.DefaultValue = PcdValue
|
||||||
else:
|
else:
|
||||||
if skuname not in str_pcd_obj.SkuInfoList:
|
if skuname not in str_pcd_obj.SkuInfoList:
|
||||||
nextskuid = self.SkuIdMgr.GetNextSkuId(skuname)
|
nextskuid = self.SkuIdMgr.GetNextSkuId(skuname)
|
||||||
NoDefault = False
|
NoDefault = False
|
||||||
while nextskuid not in str_pcd_obj.SkuInfoList:
|
while nextskuid not in str_pcd_obj.SkuInfoList:
|
||||||
if nextskuid == "DEFAULT":
|
if nextskuid == TAB_DEFAULT:
|
||||||
NoDefault = True
|
NoDefault = True
|
||||||
break
|
break
|
||||||
nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
|
nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
|
||||||
@ -1421,11 +1421,11 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
|
|
||||||
for pcdkey in Pcds:
|
for pcdkey in Pcds:
|
||||||
pcd = Pcds[pcdkey]
|
pcd = Pcds[pcdkey]
|
||||||
if 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
pcd.SkuInfoList['DEFAULT'] = pcd.SkuInfoList['COMMON']
|
pcd.SkuInfoList[TAB_DEFAULT] = pcd.SkuInfoList[TAB_COMMON]
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
elif 'DEFAULT' in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
|
|
||||||
map(self.FilterSkuSettings,[Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
|
map(self.FilterSkuSettings,[Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
|
||||||
return Pcds
|
return Pcds
|
||||||
@ -1451,11 +1451,11 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
PcdValueDict = OrderedDict()
|
PcdValueDict = OrderedDict()
|
||||||
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:
|
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:
|
||||||
SkuName = SkuName.upper()
|
SkuName = SkuName.upper()
|
||||||
SkuName = 'DEFAULT' if SkuName == 'COMMON' else SkuName
|
SkuName = TAB_DEFAULT if SkuName == TAB_COMMON else SkuName
|
||||||
if SkuName not in AvailableSkuIdSet:
|
if SkuName not in AvailableSkuIdSet:
|
||||||
EdkLogger.error('build ', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
EdkLogger.error('build ', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
||||||
File=self.MetaFile, Line=Dummy5)
|
File=self.MetaFile, Line=Dummy5)
|
||||||
if SkuName in (self.SkuIdMgr.SystemSkuId, 'DEFAULT', 'COMMON'):
|
if SkuName in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COMMON):
|
||||||
if "." not in TokenSpaceGuid:
|
if "." not in TokenSpaceGuid:
|
||||||
PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5))
|
PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5))
|
||||||
PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting
|
PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting
|
||||||
@ -1474,10 +1474,10 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
PcdValue = None
|
PcdValue = None
|
||||||
DatumType = None
|
DatumType = None
|
||||||
MaxDatumSize = None
|
MaxDatumSize = None
|
||||||
if 'COMMON' in PcdSetting:
|
if TAB_COMMON in PcdSetting:
|
||||||
PcdValue, DatumType, MaxDatumSize = PcdSetting['COMMON']
|
PcdValue, DatumType, MaxDatumSize = PcdSetting[TAB_COMMON]
|
||||||
if 'DEFAULT' in PcdSetting:
|
if TAB_DEFAULT in PcdSetting:
|
||||||
PcdValue, DatumType, MaxDatumSize = PcdSetting['DEFAULT']
|
PcdValue, DatumType, MaxDatumSize = PcdSetting[TAB_DEFAULT]
|
||||||
if self.SkuIdMgr.SystemSkuId in PcdSetting:
|
if self.SkuIdMgr.SystemSkuId in PcdSetting:
|
||||||
PcdValue, DatumType, MaxDatumSize = PcdSetting[self.SkuIdMgr.SystemSkuId]
|
PcdValue, DatumType, MaxDatumSize = PcdSetting[self.SkuIdMgr.SystemSkuId]
|
||||||
|
|
||||||
@ -1592,7 +1592,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
FieldName = FieldName.rsplit('[', 1)[0]
|
FieldName = FieldName.rsplit('[', 1)[0]
|
||||||
CApp = CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])
|
CApp = CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])
|
||||||
for skuname in Pcd.SkuOverrideValues:
|
for skuname in Pcd.SkuOverrideValues:
|
||||||
if skuname == "COMMON":
|
if skuname == TAB_COMMON:
|
||||||
continue
|
continue
|
||||||
for defaultstorenameitem in Pcd.SkuOverrideValues[skuname]:
|
for defaultstorenameitem in Pcd.SkuOverrideValues[skuname]:
|
||||||
CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (skuname, defaultstorenameitem)
|
CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (skuname, defaultstorenameitem)
|
||||||
@ -1722,10 +1722,10 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
CApp = CApp + ' UINT32 FieldSize;\n'
|
CApp = CApp + ' UINT32 FieldSize;\n'
|
||||||
CApp = CApp + ' CHAR8 *Value;\n'
|
CApp = CApp + ' CHAR8 *Value;\n'
|
||||||
|
|
||||||
CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % ('DEFAULT', TAB_DEFAULT_STORES_DEFAULT)
|
CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)
|
||||||
inherit_OverrideValues = Pcd.SkuOverrideValues[SkuName]
|
inherit_OverrideValues = Pcd.SkuOverrideValues[SkuName]
|
||||||
if (SkuName,DefaultStoreName) == ('DEFAULT',TAB_DEFAULT_STORES_DEFAULT):
|
if (SkuName,DefaultStoreName) == (TAB_DEFAULT,TAB_DEFAULT_STORES_DEFAULT):
|
||||||
pcddefaultvalue = Pcd.DefaultFromDSC.get('DEFAULT',{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue
|
pcddefaultvalue = Pcd.DefaultFromDSC.get(TAB_DEFAULT,{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue
|
||||||
else:
|
else:
|
||||||
if not Pcd.DscRawValue:
|
if not Pcd.DscRawValue:
|
||||||
# handle the case that structure pcd is not appear in DSC
|
# handle the case that structure pcd is not appear in DSC
|
||||||
@ -1744,14 +1744,14 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldList))
|
(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldList))
|
||||||
Value, ValueSize = ParseFieldValue (FieldList)
|
Value, ValueSize = ParseFieldValue (FieldList)
|
||||||
|
|
||||||
if (SkuName,DefaultStoreName) == ('DEFAULT',TAB_DEFAULT_STORES_DEFAULT):
|
if (SkuName,DefaultStoreName) == (TAB_DEFAULT,TAB_DEFAULT_STORES_DEFAULT):
|
||||||
if isinstance(Value, str):
|
if isinstance(Value, str):
|
||||||
CApp = CApp + ' Pcd = %s; // From DSC Default Value %s\n' % (Value, Pcd.DefaultFromDSC.get('DEFAULT',{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)
|
CApp = CApp + ' Pcd = %s; // From DSC Default Value %s\n' % (Value, Pcd.DefaultFromDSC.get(TAB_DEFAULT,{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)
|
||||||
elif IsArray:
|
elif IsArray:
|
||||||
#
|
#
|
||||||
# Use memcpy() to copy value into field
|
# Use memcpy() to copy value into field
|
||||||
#
|
#
|
||||||
CApp = CApp + ' Value = %s; // From DSC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DefaultFromDSC.get('DEFAULT',{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)
|
CApp = CApp + ' Value = %s; // From DSC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DefaultFromDSC.get(TAB_DEFAULT,{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)
|
||||||
CApp = CApp + ' memcpy (Pcd, Value, %d);\n' % (ValueSize)
|
CApp = CApp + ' memcpy (Pcd, Value, %d);\n' % (ValueSize)
|
||||||
else:
|
else:
|
||||||
if isinstance(Value, str):
|
if isinstance(Value, str):
|
||||||
@ -1763,7 +1763,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
CApp = CApp + ' Value = %s; // From DSC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DscRawValue.get(SkuName,{}).get(DefaultStoreName))
|
CApp = CApp + ' Value = %s; // From DSC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DscRawValue.get(SkuName,{}).get(DefaultStoreName))
|
||||||
CApp = CApp + ' memcpy (Pcd, Value, %d);\n' % (ValueSize)
|
CApp = CApp + ' memcpy (Pcd, Value, %d);\n' % (ValueSize)
|
||||||
continue
|
continue
|
||||||
if (SkuName,DefaultStoreName) == ('DEFAULT',TAB_DEFAULT_STORES_DEFAULT) or (( (SkuName,'') not in Pcd.ValueChain) and ( (SkuName,DefaultStoreName) not in Pcd.ValueChain )):
|
if (SkuName,DefaultStoreName) == (TAB_DEFAULT,TAB_DEFAULT_STORES_DEFAULT) or (( (SkuName,'') not in Pcd.ValueChain) and ( (SkuName,DefaultStoreName) not in Pcd.ValueChain )):
|
||||||
for FieldName in FieldList:
|
for FieldName in FieldList:
|
||||||
IsArray = IsFieldValueAnArray(FieldList[FieldName][0])
|
IsArray = IsFieldValueAnArray(FieldList[FieldName][0])
|
||||||
if IsArray:
|
if IsArray:
|
||||||
@ -2229,7 +2229,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
|
|
||||||
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:
|
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:
|
||||||
SkuName = SkuName.upper()
|
SkuName = SkuName.upper()
|
||||||
SkuName = 'DEFAULT' if SkuName == 'COMMON' else SkuName
|
SkuName = TAB_DEFAULT if SkuName == TAB_COMMON else SkuName
|
||||||
if SkuName not in AvailableSkuIdSet:
|
if SkuName not in AvailableSkuIdSet:
|
||||||
EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
||||||
File=self.MetaFile, Line=Dummy5)
|
File=self.MetaFile, Line=Dummy5)
|
||||||
@ -2279,15 +2279,15 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
for sku in pcd.SkuInfoList.values():
|
for sku in pcd.SkuInfoList.values():
|
||||||
if not sku.DefaultValue:
|
if not sku.DefaultValue:
|
||||||
sku.DefaultValue = pcdDecObject.DefaultValue
|
sku.DefaultValue = pcdDecObject.DefaultValue
|
||||||
if 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' not in pcd.SkuInfoList:
|
if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pcd.SkuInfoList:
|
||||||
valuefromDec = pcdDecObject.DefaultValue
|
valuefromDec = pcdDecObject.DefaultValue
|
||||||
SkuInfo = SkuInfoClass('DEFAULT', '0', '', '', '', '', '', valuefromDec)
|
SkuInfo = SkuInfoClass(TAB_DEFAULT, '0', '', '', '', '', '', valuefromDec)
|
||||||
pcd.SkuInfoList['DEFAULT'] = SkuInfo
|
pcd.SkuInfoList[TAB_DEFAULT] = SkuInfo
|
||||||
elif 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
pcd.SkuInfoList['DEFAULT'] = pcd.SkuInfoList['COMMON']
|
pcd.SkuInfoList[TAB_DEFAULT] = pcd.SkuInfoList[TAB_COMMON]
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
elif 'DEFAULT' in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
|
|
||||||
map(self.FilterSkuSettings,Pcds.values())
|
map(self.FilterSkuSettings,Pcds.values())
|
||||||
|
|
||||||
@ -2296,14 +2296,14 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
def FilterSkuSettings(self, PcdObj):
|
def FilterSkuSettings(self, PcdObj):
|
||||||
|
|
||||||
if self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.SINGLE:
|
if self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.SINGLE:
|
||||||
if 'DEFAULT' in PcdObj.SkuInfoList and self.SkuIdMgr.SystemSkuId not in PcdObj.SkuInfoList:
|
if TAB_DEFAULT in PcdObj.SkuInfoList and self.SkuIdMgr.SystemSkuId not in PcdObj.SkuInfoList:
|
||||||
PcdObj.SkuInfoList[self.SkuIdMgr.SystemSkuId] = PcdObj.SkuInfoList['DEFAULT']
|
PcdObj.SkuInfoList[self.SkuIdMgr.SystemSkuId] = PcdObj.SkuInfoList[TAB_DEFAULT]
|
||||||
PcdObj.SkuInfoList = {'DEFAULT':PcdObj.SkuInfoList[self.SkuIdMgr.SystemSkuId]}
|
PcdObj.SkuInfoList = {TAB_DEFAULT:PcdObj.SkuInfoList[self.SkuIdMgr.SystemSkuId]}
|
||||||
PcdObj.SkuInfoList['DEFAULT'].SkuIdName = 'DEFAULT'
|
PcdObj.SkuInfoList[TAB_DEFAULT].SkuIdName = TAB_DEFAULT
|
||||||
PcdObj.SkuInfoList['DEFAULT'].SkuId = '0'
|
PcdObj.SkuInfoList[TAB_DEFAULT].SkuId = '0'
|
||||||
|
|
||||||
elif self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.DEFAULT:
|
elif self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.DEFAULT:
|
||||||
PcdObj.SkuInfoList = {'DEFAULT':PcdObj.SkuInfoList['DEFAULT']}
|
PcdObj.SkuInfoList = {TAB_DEFAULT:PcdObj.SkuInfoList[TAB_DEFAULT]}
|
||||||
|
|
||||||
return PcdObj
|
return PcdObj
|
||||||
|
|
||||||
@ -2337,7 +2337,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
def CompletePcdValues(self,PcdSet):
|
def CompletePcdValues(self,PcdSet):
|
||||||
Pcds = {}
|
Pcds = {}
|
||||||
DefaultStoreObj = DefaultStore(self._GetDefaultStores())
|
DefaultStoreObj = DefaultStore(self._GetDefaultStores())
|
||||||
SkuIds = {skuname:skuid for skuname,skuid in self.SkuIdMgr.AvailableSkuIdSet.items() if skuname !='COMMON'}
|
SkuIds = {skuname:skuid for skuname,skuid in self.SkuIdMgr.AvailableSkuIdSet.items() if skuname != TAB_COMMON}
|
||||||
DefaultStores = set([storename for pcdobj in PcdSet.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict.keys()])
|
DefaultStores = set([storename for pcdobj in PcdSet.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict.keys()])
|
||||||
for PcdCName, TokenSpaceGuid in PcdSet:
|
for PcdCName, TokenSpaceGuid in PcdSet:
|
||||||
PcdObj = PcdSet[(PcdCName, TokenSpaceGuid)]
|
PcdObj = PcdSet[(PcdCName, TokenSpaceGuid)]
|
||||||
@ -2368,7 +2368,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
PcdObj.SkuInfoList[skuname].SkuId = skuid
|
PcdObj.SkuInfoList[skuname].SkuId = skuid
|
||||||
PcdObj.SkuInfoList[skuname].SkuIdName = skuname
|
PcdObj.SkuInfoList[skuname].SkuIdName = skuname
|
||||||
if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
|
if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
|
||||||
PcdObj.DefaultValue = PcdObj.SkuInfoList.values()[0].HiiDefaultValue if self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.SINGLE else PcdObj.SkuInfoList["DEFAULT"].HiiDefaultValue
|
PcdObj.DefaultValue = PcdObj.SkuInfoList.values()[0].HiiDefaultValue if self.SkuIdMgr.SkuUsageType == self.SkuIdMgr.SINGLE else PcdObj.SkuInfoList[TAB_DEFAULT].HiiDefaultValue
|
||||||
Pcds[PcdCName, TokenSpaceGuid]= PcdObj
|
Pcds[PcdCName, TokenSpaceGuid]= PcdObj
|
||||||
return Pcds
|
return Pcds
|
||||||
## Retrieve dynamic HII PCD settings
|
## Retrieve dynamic HII PCD settings
|
||||||
@ -2395,9 +2395,9 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
|
|
||||||
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, DefaultStore, Dummy4,Dummy5 in RecordList:
|
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, DefaultStore, Dummy4,Dummy5 in RecordList:
|
||||||
SkuName = SkuName.upper()
|
SkuName = SkuName.upper()
|
||||||
SkuName = 'DEFAULT' if SkuName == 'COMMON' else SkuName
|
SkuName = TAB_DEFAULT if SkuName == TAB_COMMON else SkuName
|
||||||
DefaultStore = DefaultStore.upper()
|
DefaultStore = DefaultStore.upper()
|
||||||
if DefaultStore == "COMMON":
|
if DefaultStore == TAB_COMMON:
|
||||||
DefaultStore = TAB_DEFAULT_STORES_DEFAULT
|
DefaultStore = TAB_DEFAULT_STORES_DEFAULT
|
||||||
if SkuName not in AvailableSkuIdSet:
|
if SkuName not in AvailableSkuIdSet:
|
||||||
EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
||||||
@ -2489,15 +2489,15 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
for default_store in sku.DefaultStoreDict:
|
for default_store in sku.DefaultStoreDict:
|
||||||
sku.DefaultStoreDict[default_store]=pcdDecObject.DefaultValue
|
sku.DefaultStoreDict[default_store]=pcdDecObject.DefaultValue
|
||||||
pcd.DefaultValue = pcdDecObject.DefaultValue
|
pcd.DefaultValue = pcdDecObject.DefaultValue
|
||||||
if 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' not in pcd.SkuInfoList:
|
if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pcd.SkuInfoList:
|
||||||
valuefromDec = pcdDecObject.DefaultValue
|
valuefromDec = pcdDecObject.DefaultValue
|
||||||
SkuInfo = SkuInfoClass('DEFAULT', '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec,VariableAttribute=SkuInfoObj.VariableAttribute,DefaultStore={DefaultStore:valuefromDec})
|
SkuInfo = SkuInfoClass(TAB_DEFAULT, '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec,VariableAttribute=SkuInfoObj.VariableAttribute,DefaultStore={DefaultStore:valuefromDec})
|
||||||
pcd.SkuInfoList['DEFAULT'] = SkuInfo
|
pcd.SkuInfoList[TAB_DEFAULT] = SkuInfo
|
||||||
elif 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
pcd.SkuInfoList['DEFAULT'] = pcd.SkuInfoList['COMMON']
|
pcd.SkuInfoList[TAB_DEFAULT] = pcd.SkuInfoList[TAB_COMMON]
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
elif 'DEFAULT' in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
|
|
||||||
if pcd.MaxDatumSize.strip():
|
if pcd.MaxDatumSize.strip():
|
||||||
MaxSize = int(pcd.MaxDatumSize, 0)
|
MaxSize = int(pcd.MaxDatumSize, 0)
|
||||||
@ -2558,7 +2558,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
|
|
||||||
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:
|
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:
|
||||||
SkuName = SkuName.upper()
|
SkuName = SkuName.upper()
|
||||||
SkuName = 'DEFAULT' if SkuName == 'COMMON' else SkuName
|
SkuName = TAB_DEFAULT if SkuName == TAB_COMMON else SkuName
|
||||||
if SkuName not in AvailableSkuIdSet:
|
if SkuName not in AvailableSkuIdSet:
|
||||||
EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
|
||||||
File=self.MetaFile, Line=Dummy5)
|
File=self.MetaFile, Line=Dummy5)
|
||||||
@ -2613,15 +2613,15 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
for sku in pcd.SkuInfoList.values():
|
for sku in pcd.SkuInfoList.values():
|
||||||
if not sku.DefaultValue:
|
if not sku.DefaultValue:
|
||||||
sku.DefaultValue = pcdDecObject.DefaultValue
|
sku.DefaultValue = pcdDecObject.DefaultValue
|
||||||
if 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' not in pcd.SkuInfoList:
|
if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pcd.SkuInfoList:
|
||||||
valuefromDec = pcdDecObject.DefaultValue
|
valuefromDec = pcdDecObject.DefaultValue
|
||||||
SkuInfo = SkuInfoClass('DEFAULT', '0', '', '', '', '', SkuInfoObj.VpdOffset, valuefromDec)
|
SkuInfo = SkuInfoClass(TAB_DEFAULT, '0', '', '', '', '', SkuInfoObj.VpdOffset, valuefromDec)
|
||||||
pcd.SkuInfoList['DEFAULT'] = SkuInfo
|
pcd.SkuInfoList[TAB_DEFAULT] = SkuInfo
|
||||||
elif 'DEFAULT' not in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
pcd.SkuInfoList['DEFAULT'] = pcd.SkuInfoList['COMMON']
|
pcd.SkuInfoList[TAB_DEFAULT] = pcd.SkuInfoList[TAB_COMMON]
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
elif 'DEFAULT' in pcd.SkuInfoList and 'COMMON' in pcd.SkuInfoList:
|
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
|
||||||
del pcd.SkuInfoList['COMMON']
|
del pcd.SkuInfoList[TAB_COMMON]
|
||||||
|
|
||||||
|
|
||||||
map(self.FilterSkuSettings,Pcds.values())
|
map(self.FilterSkuSettings,Pcds.values())
|
||||||
|
@ -107,7 +107,7 @@ class InfBuildData(ModuleBuildClassObject):
|
|||||||
# @param Platform The name of platform employing this module
|
# @param Platform The name of platform employing this module
|
||||||
# @param Macros Macros used for replacement in DSC file
|
# @param Macros Macros used for replacement in DSC file
|
||||||
#
|
#
|
||||||
def __init__(self, FilePath, RawData, BuildDatabase, Arch='COMMON', Target=None, Toolchain=None):
|
def __init__(self, FilePath, RawData, BuildDatabase, Arch=TAB_ARCH_COMMON, Target=None, Toolchain=None):
|
||||||
self.MetaFile = FilePath
|
self.MetaFile = FilePath
|
||||||
self._ModuleDir = FilePath.Dir
|
self._ModuleDir = FilePath.Dir
|
||||||
self._RawData = RawData
|
self._RawData = RawData
|
||||||
@ -115,7 +115,7 @@ class InfBuildData(ModuleBuildClassObject):
|
|||||||
self._Arch = Arch
|
self._Arch = Arch
|
||||||
self._Target = Target
|
self._Target = Target
|
||||||
self._Toolchain = Toolchain
|
self._Toolchain = Toolchain
|
||||||
self._Platform = 'COMMON'
|
self._Platform = TAB_COMMON
|
||||||
self._SourceOverridePath = None
|
self._SourceOverridePath = None
|
||||||
if FilePath.Key in GlobalData.gOverrideDir:
|
if FilePath.Key in GlobalData.gOverrideDir:
|
||||||
self._SourceOverridePath = GlobalData.gOverrideDir[FilePath.Key]
|
self._SourceOverridePath = GlobalData.gOverrideDir[FilePath.Key]
|
||||||
@ -602,7 +602,7 @@ class InfBuildData(ModuleBuildClassObject):
|
|||||||
for Record in RecordList:
|
for Record in RecordList:
|
||||||
FileType = Record[0]
|
FileType = Record[0]
|
||||||
LineNo = Record[-1]
|
LineNo = Record[-1]
|
||||||
Target = 'COMMON'
|
Target = TAB_COMMON
|
||||||
FeatureFlag = []
|
FeatureFlag = []
|
||||||
if Record[2]:
|
if Record[2]:
|
||||||
TokenList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
|
TokenList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
|
||||||
|
@ -219,7 +219,7 @@ class MetaFileParser(object):
|
|||||||
NewRecordList = []
|
NewRecordList = []
|
||||||
for Record in RecordList:
|
for Record in RecordList:
|
||||||
Arch = Record[3]
|
Arch = Record[3]
|
||||||
if Arch == 'COMMON' or Arch == FilterArch:
|
if Arch == TAB_ARCH_COMMON or Arch == FilterArch:
|
||||||
NewRecordList.append(Record)
|
NewRecordList.append(Record)
|
||||||
return NewRecordList
|
return NewRecordList
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ class MetaFileParser(object):
|
|||||||
if len(ItemList) > 1:
|
if len(ItemList) > 1:
|
||||||
S1 = ItemList[1].upper()
|
S1 = ItemList[1].upper()
|
||||||
else:
|
else:
|
||||||
S1 = 'COMMON'
|
S1 = TAB_ARCH_COMMON
|
||||||
ArchList.add(S1)
|
ArchList.add(S1)
|
||||||
|
|
||||||
# S2 may be Platform or ModuleType
|
# S2 may be Platform or ModuleType
|
||||||
@ -329,15 +329,15 @@ class MetaFileParser(object):
|
|||||||
else:
|
else:
|
||||||
S2 = ItemList[2].upper()
|
S2 = ItemList[2].upper()
|
||||||
else:
|
else:
|
||||||
S2 = 'COMMON'
|
S2 = TAB_COMMON
|
||||||
if len(ItemList) > 3:
|
if len(ItemList) > 3:
|
||||||
S3 = ItemList[3]
|
S3 = ItemList[3]
|
||||||
else:
|
else:
|
||||||
S3 = "COMMON"
|
S3 = TAB_COMMON
|
||||||
self._Scope.append([S1, S2, S3])
|
self._Scope.append([S1, S2, S3])
|
||||||
|
|
||||||
# 'COMMON' must not be used with specific ARCHs at the same section
|
# 'COMMON' must not be used with specific ARCHs at the same section
|
||||||
if 'COMMON' in ArchList and len(ArchList) > 1:
|
if TAB_ARCH_COMMON in ArchList and len(ArchList) > 1:
|
||||||
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
|
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
|
||||||
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
||||||
# If the section information is needed later, it should be stored in database
|
# If the section information is needed later, it should be stored in database
|
||||||
@ -455,12 +455,12 @@ class MetaFileParser(object):
|
|||||||
|
|
||||||
for ActiveScope in self._Scope:
|
for ActiveScope in self._Scope:
|
||||||
Scope0, Scope1,Scope2 = ActiveScope[0], ActiveScope[1],ActiveScope[2]
|
Scope0, Scope1,Scope2 = ActiveScope[0], ActiveScope[1],ActiveScope[2]
|
||||||
if(Scope0, Scope1,Scope2) not in Scope and (Scope0, "COMMON","COMMON") not in Scope and ("COMMON", Scope1,"COMMON") not in Scope:
|
if(Scope0, Scope1,Scope2) not in Scope and (Scope0, TAB_COMMON, TAB_COMMON) not in Scope and (TAB_COMMON, Scope1, TAB_COMMON) not in Scope:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
ComSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
|
ComSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
|
||||||
|
|
||||||
if ("COMMON", "COMMON","COMMON") in Scope:
|
if (TAB_COMMON, TAB_COMMON, TAB_COMMON) in Scope:
|
||||||
ComComMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
|
ComComMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
|
||||||
|
|
||||||
Macros.update(ComComMacroDict)
|
Macros.update(ComComMacroDict)
|
||||||
@ -568,8 +568,8 @@ class InfParser(MetaFileParser):
|
|||||||
if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
|
if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
|
||||||
if not GetHeaderComment:
|
if not GetHeaderComment:
|
||||||
for Cmt, LNo in Comments:
|
for Cmt, LNo in Comments:
|
||||||
self._Store(MODEL_META_DATA_HEADER_COMMENT, Cmt, '', '', 'COMMON',
|
self._Store(MODEL_META_DATA_HEADER_COMMENT, Cmt, '', '', TAB_COMMON,
|
||||||
'COMMON', self._Owner[-1], LNo, -1, LNo, -1, 0)
|
TAB_COMMON, self._Owner[-1], LNo, -1, LNo, -1, 0)
|
||||||
GetHeaderComment = True
|
GetHeaderComment = True
|
||||||
else:
|
else:
|
||||||
TailComments.extend(SectionComments + Comments)
|
TailComments.extend(SectionComments + Comments)
|
||||||
@ -658,8 +658,8 @@ class InfParser(MetaFileParser):
|
|||||||
|
|
||||||
# If there are tail comments in INF file, save to database whatever the comments are
|
# If there are tail comments in INF file, save to database whatever the comments are
|
||||||
for Comment in TailComments:
|
for Comment in TailComments:
|
||||||
self._Store(MODEL_META_DATA_TAIL_COMMENT, Comment[0], '', '', 'COMMON',
|
self._Store(MODEL_META_DATA_TAIL_COMMENT, Comment[0], '', '', TAB_COMMON,
|
||||||
'COMMON', self._Owner[-1], -1, -1, -1, -1, 0)
|
TAB_COMMON, self._Owner[-1], -1, -1, -1, -1, 0)
|
||||||
self._Done()
|
self._Done()
|
||||||
|
|
||||||
## Data parser for the format in which there's path
|
## Data parser for the format in which there's path
|
||||||
@ -1022,7 +1022,7 @@ class DscParser(MetaFileParser):
|
|||||||
ExtraData=self._CurrentLine)
|
ExtraData=self._CurrentLine)
|
||||||
|
|
||||||
ItemType = self.DataType[DirectiveName]
|
ItemType = self.DataType[DirectiveName]
|
||||||
Scope = [['COMMON', 'COMMON','COMMON']]
|
Scope = [[TAB_COMMON, TAB_COMMON, TAB_COMMON]]
|
||||||
if ItemType == MODEL_META_DATA_INCLUDE:
|
if ItemType == MODEL_META_DATA_INCLUDE:
|
||||||
Scope = self._Scope
|
Scope = self._Scope
|
||||||
if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:
|
if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:
|
||||||
@ -1832,7 +1832,7 @@ class DecParser(MetaFileParser):
|
|||||||
if len(ItemList) > 1:
|
if len(ItemList) > 1:
|
||||||
S1 = ItemList[1].upper()
|
S1 = ItemList[1].upper()
|
||||||
else:
|
else:
|
||||||
S1 = 'COMMON'
|
S1 = TAB_ARCH_COMMON
|
||||||
ArchList.add(S1)
|
ArchList.add(S1)
|
||||||
# S2 may be Platform or ModuleType
|
# S2 may be Platform or ModuleType
|
||||||
if len(ItemList) > 2:
|
if len(ItemList) > 2:
|
||||||
@ -1843,18 +1843,18 @@ class DecParser(MetaFileParser):
|
|||||||
EdkLogger.error("Parser", FORMAT_INVALID, 'Please use keyword "Private" as section tag modifier.',
|
EdkLogger.error("Parser", FORMAT_INVALID, 'Please use keyword "Private" as section tag modifier.',
|
||||||
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
||||||
else:
|
else:
|
||||||
S2 = 'COMMON'
|
S2 = TAB_COMMON
|
||||||
PrivateList.add(S2)
|
PrivateList.add(S2)
|
||||||
if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:
|
if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:
|
||||||
self._Scope.append([S1, S2, self.DataType[self._SectionName]])
|
self._Scope.append([S1, S2, self.DataType[self._SectionName]])
|
||||||
|
|
||||||
# 'COMMON' must not be used with specific ARCHs at the same section
|
# 'COMMON' must not be used with specific ARCHs at the same section
|
||||||
if 'COMMON' in ArchList and len(ArchList) > 1:
|
if TAB_ARCH_COMMON in ArchList and len(ArchList) > 1:
|
||||||
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
|
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
|
||||||
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
||||||
|
|
||||||
# It is not permissible to mix section tags without the Private attribute with section tags with the Private attribute
|
# It is not permissible to mix section tags without the Private attribute with section tags with the Private attribute
|
||||||
if 'COMMON' in PrivateList and len(PrivateList) > 1:
|
if TAB_COMMON in PrivateList and len(PrivateList) > 1:
|
||||||
EdkLogger.error('Parser', FORMAT_INVALID, "Can't mix section tags without the Private attribute with section tags with the Private attribute",
|
EdkLogger.error('Parser', FORMAT_INVALID, "Can't mix section tags without the Private attribute with section tags with the Private attribute",
|
||||||
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# This file is used to create/update/query/erase a meta file table
|
# This file is used to create/update/query/erase a meta file table
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -109,7 +109,7 @@ class ModuleTable(MetaFileTable):
|
|||||||
# @param EndColumn: EndColumn of a Inf item
|
# @param EndColumn: EndColumn of a Inf item
|
||||||
# @param Enabled: If this item enabled
|
# @param Enabled: If this item enabled
|
||||||
#
|
#
|
||||||
def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',
|
def Insert(self, Model, Value1, Value2, Value3, Scope1=TAB_ARCH_COMMON, Scope2=TAB_COMMON,
|
||||||
BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
|
BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
|
||||||
(Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
|
(Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
|
||||||
return Table.Insert(
|
return Table.Insert(
|
||||||
@ -140,9 +140,9 @@ class ModuleTable(MetaFileTable):
|
|||||||
ConditionString = "Model=%s AND Enabled>=0" % Model
|
ConditionString = "Model=%s AND Enabled>=0" % Model
|
||||||
ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
|
ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
|
||||||
|
|
||||||
if Arch is not None and Arch != 'COMMON':
|
if Arch is not None and Arch != TAB_ARCH_COMMON:
|
||||||
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
|
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
|
||||||
if Platform is not None and Platform != 'COMMON':
|
if Platform is not None and Platform != TAB_COMMON:
|
||||||
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Platform
|
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Platform
|
||||||
if BelongsToItem is not None:
|
if BelongsToItem is not None:
|
||||||
ConditionString += " AND BelongsToItem=%s" % BelongsToItem
|
ConditionString += " AND BelongsToItem=%s" % BelongsToItem
|
||||||
@ -191,7 +191,7 @@ class PackageTable(MetaFileTable):
|
|||||||
# @param EndColumn: EndColumn of a Dec item
|
# @param EndColumn: EndColumn of a Dec item
|
||||||
# @param Enabled: If this item enabled
|
# @param Enabled: If this item enabled
|
||||||
#
|
#
|
||||||
def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',
|
def Insert(self, Model, Value1, Value2, Value3, Scope1=TAB_ARCH_COMMON, Scope2=TAB_COMMON,
|
||||||
BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
|
BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
|
||||||
(Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
|
(Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
|
||||||
return Table.Insert(
|
return Table.Insert(
|
||||||
@ -221,7 +221,7 @@ class PackageTable(MetaFileTable):
|
|||||||
ConditionString = "Model=%s AND Enabled>=0" % Model
|
ConditionString = "Model=%s AND Enabled>=0" % Model
|
||||||
ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
|
ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
|
||||||
|
|
||||||
if Arch is not None and Arch != 'COMMON':
|
if Arch is not None and Arch != TAB_ARCH_COMMON:
|
||||||
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
|
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
|
||||||
|
|
||||||
SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
|
SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
|
||||||
@ -306,7 +306,7 @@ class PlatformTable(MetaFileTable):
|
|||||||
# @param EndColumn: EndColumn of a Dsc item
|
# @param EndColumn: EndColumn of a Dsc item
|
||||||
# @param Enabled: If this item enabled
|
# @param Enabled: If this item enabled
|
||||||
#
|
#
|
||||||
def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', Scope3=TAB_DEFAULT_STORES_DEFAULT,BelongsToItem=-1,
|
def Insert(self, Model, Value1, Value2, Value3, Scope1=TAB_ARCH_COMMON, Scope2=TAB_COMMON, Scope3=TAB_DEFAULT_STORES_DEFAULT,BelongsToItem=-1,
|
||||||
FromItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=1):
|
FromItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=1):
|
||||||
(Value1, Value2, Value3, Scope1, Scope2,Scope3) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2,Scope3))
|
(Value1, Value2, Value3, Scope1, Scope2,Scope3) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2,Scope3))
|
||||||
return Table.Insert(
|
return Table.Insert(
|
||||||
@ -341,13 +341,13 @@ class PlatformTable(MetaFileTable):
|
|||||||
ConditionString = "Model=%s AND Enabled>0" % Model
|
ConditionString = "Model=%s AND Enabled>0" % Model
|
||||||
ValueString = "Value1,Value2,Value3,Scope1,Scope2,Scope3,ID,StartLine"
|
ValueString = "Value1,Value2,Value3,Scope1,Scope2,Scope3,ID,StartLine"
|
||||||
|
|
||||||
if Scope1 is not None and Scope1 != 'COMMON':
|
if Scope1 is not None and Scope1 != TAB_ARCH_COMMON:
|
||||||
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1
|
ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1
|
||||||
if Scope2 is not None and Scope2 != 'COMMON':
|
if Scope2 is not None and Scope2 != TAB_COMMON:
|
||||||
# Cover the case that CodeBase is 'COMMON' for BuildOptions section
|
# Cover the case that CodeBase is 'COMMON' for BuildOptions section
|
||||||
if '.' in Scope2:
|
if '.' in Scope2:
|
||||||
Index = Scope2.index('.')
|
Index = Scope2.index('.')
|
||||||
NewScope = 'COMMON'+ Scope2[Index:]
|
NewScope = TAB_COMMON + Scope2[Index:]
|
||||||
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT' OR Scope2='%s')" % (Scope2, NewScope)
|
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT' OR Scope2='%s')" % (Scope2, NewScope)
|
||||||
else:
|
else:
|
||||||
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2
|
ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2
|
||||||
|
@ -305,7 +305,7 @@ determine whether database file is out of date!\n")
|
|||||||
PlatformList = []
|
PlatformList = []
|
||||||
for PlatformFile in self.TblFile.GetFileList(MODEL_FILE_DSC):
|
for PlatformFile in self.TblFile.GetFileList(MODEL_FILE_DSC):
|
||||||
try:
|
try:
|
||||||
Platform = self.BuildObject[PathClass(PlatformFile), 'COMMON']
|
Platform = self.BuildObject[PathClass(PlatformFile), TAB_COMMON]
|
||||||
except:
|
except:
|
||||||
Platform = None
|
Platform = None
|
||||||
if Platform is not None:
|
if Platform is not None:
|
||||||
@ -313,7 +313,7 @@ determine whether database file is out of date!\n")
|
|||||||
return PlatformList
|
return PlatformList
|
||||||
|
|
||||||
def _MapPlatform(self, Dscfile):
|
def _MapPlatform(self, Dscfile):
|
||||||
Platform = self.BuildObject[PathClass(Dscfile), 'COMMON']
|
Platform = self.BuildObject[PathClass(Dscfile), TAB_COMMON]
|
||||||
if Platform is None:
|
if Platform is None:
|
||||||
EdkLogger.error('build', PARSER_ERROR, "Failed to parser DSC file: %s" % Dscfile)
|
EdkLogger.error('build', PARSER_ERROR, "Failed to parser DSC file: %s" % Dscfile)
|
||||||
return Platform
|
return Platform
|
||||||
|
Loading…
x
Reference in New Issue
Block a user