import Common.VpdInfoFile as VpdInfoFile\r
from GenPcdDb import CreatePcdDatabaseCode\r
from Workspace.MetaFileCommentParser import UsageList\r
import Common.VpdInfoFile as VpdInfoFile\r
from GenPcdDb import CreatePcdDatabaseCode\r
from Workspace.MetaFileCommentParser import UsageList\r
import InfSectionParser\r
\r
## Regular expression for splitting Dependency Expression string into tokens\r
import InfSectionParser\r
\r
## Regular expression for splitting Dependency Expression string into tokens\r
# @param SkuId SKU id from command line\r
#\r
def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,\r
# @param SkuId SKU id from command line\r
#\r
def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,\r
- BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=None, Fvs=None, Caps=None, SkuId='', UniFlag=None, \r
+ BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=None, Fvs=None, Caps=None, SkuId='', UniFlag=None,\r
ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]"\r
% (self.BuildTarget, " ".join(self.Platform.BuildTargets)))\r
\r
ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]"\r
% (self.BuildTarget, " ".join(self.Platform.BuildTargets)))\r
\r
# parse FDF file to get PCDs in it, if any\r
if not self.FdfFile:\r
self.FdfFile = self.Platform.FlashDefinition\r
# parse FDF file to get PCDs in it, if any\r
if not self.FdfFile:\r
self.FdfFile = self.Platform.FlashDefinition\r
EdkLogger.info("")\r
if self.ArchList:\r
EdkLogger.info('%-16s = %s' % ("Architecture(s)", ' '.join(self.ArchList)))\r
EdkLogger.info('%-16s = %s' % ("Build target", self.BuildTarget))\r
EdkLogger.info("")\r
if self.ArchList:\r
EdkLogger.info('%-16s = %s' % ("Architecture(s)", ' '.join(self.ArchList)))\r
EdkLogger.info('%-16s = %s' % ("Build target", self.BuildTarget))\r
EdkLogger.info('\n%-24s = %s' % ("Active Platform", self.Platform))\r
if BuildModule:\r
EdkLogger.info('%-24s = %s' % ("Active Module", BuildModule))\r
EdkLogger.info('\n%-24s = %s' % ("Active Platform", self.Platform))\r
if BuildModule:\r
EdkLogger.info('%-24s = %s' % ("Active Module", BuildModule))\r
if self.FdfFile:\r
EdkLogger.info('%-24s = %s' % ("Flash Image Definition", self.FdfFile))\r
\r
EdkLogger.verbose("\nFLASH_DEFINITION = %s" % self.FdfFile)\r
if self.FdfFile:\r
EdkLogger.info('%-24s = %s' % ("Flash Image Definition", self.FdfFile))\r
\r
EdkLogger.verbose("\nFLASH_DEFINITION = %s" % self.FdfFile)\r
if self.CapTargetList:\r
EdkLogger.info("No flash definition file found. Capsule [%s] will be ignored." % " ".join(self.CapTargetList))\r
self.CapTargetList = []\r
if self.CapTargetList:\r
EdkLogger.info("No flash definition file found. Capsule [%s] will be ignored." % " ".join(self.CapTargetList))\r
self.CapTargetList = []\r
# apply SKU and inject PCDs from Flash Definition file\r
for Arch in self.ArchList:\r
Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
# apply SKU and inject PCDs from Flash Definition file\r
for Arch in self.ArchList:\r
Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
Pa.CollectPlatformDynamicPcds()\r
Pa.CollectFixedAtBuildPcds()\r
self.AutoGenObjectList.append(Pa)\r
Pa.CollectPlatformDynamicPcds()\r
Pa.CollectFixedAtBuildPcds()\r
self.AutoGenObjectList.append(Pa)\r
FfsFile.CurrentLineContent,\r
_GuidDict[Module.Guid.upper()].CurrentLineNum,\r
_GuidDict[Module.Guid.upper()].CurrentLineContent,\r
FfsFile.CurrentLineContent,\r
_GuidDict[Module.Guid.upper()].CurrentLineNum,\r
_GuidDict[Module.Guid.upper()].CurrentLineContent,\r
InfPath = NormPath(FfsFile.InfFileName)\r
if not os.path.exists(InfPath):\r
EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))\r
InfPath = NormPath(FfsFile.InfFileName)\r
if not os.path.exists(InfPath):\r
EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))\r
PathClassObj = PathClass(FfsFile.InfFileName, self.WorkspaceDir)\r
#\r
# Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use \r
PathClassObj = PathClass(FfsFile.InfFileName, self.WorkspaceDir)\r
#\r
# Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use \r
FfsFile.CurrentLineContent,\r
_GuidDict[InfObj.Guid.upper()].CurrentLineNum,\r
_GuidDict[InfObj.Guid.upper()].CurrentLineContent,\r
InfObj.Guid.upper()),\r
ExtraData=self.FdfFile)\r
InfFoundFlag = False\r
FfsFile.CurrentLineContent,\r
_GuidDict[InfObj.Guid.upper()].CurrentLineNum,\r
_GuidDict[InfObj.Guid.upper()].CurrentLineContent,\r
InfObj.Guid.upper()),\r
ExtraData=self.FdfFile)\r
InfFoundFlag = False\r
# First convert from CFormatGuid to GUID string\r
#\r
_PcdGuidString = GuidStructureStringToGuidString(PcdItem.DefaultValue)\r
# First convert from CFormatGuid to GUID string\r
#\r
_PcdGuidString = GuidStructureStringToGuidString(PcdItem.DefaultValue)\r
if not _PcdGuidString:\r
#\r
# Not Byte array or CFormat GUID, raise error.\r
#\r
EdkLogger.error("build",\r
FORMAT_INVALID,\r
if not _PcdGuidString:\r
#\r
# Not Byte array or CFormat GUID, raise error.\r
#\r
EdkLogger.error("build",\r
FORMAT_INVALID,\r
- "The format of PCD value is incorrect. PCD: %s , Value: %s\n"%(_PcdName, PcdItem.DefaultValue),\r
+ "The format of PCD value is incorrect. PCD: %s , Value: %s\n" % (_PcdName, PcdItem.DefaultValue),\r
FfsFile.CurrentLineContent,\r
_GuidDict[_PcdGuidString.upper()].CurrentLineNum,\r
_GuidDict[_PcdGuidString.upper()].CurrentLineContent,\r
FfsFile.NameGuid.upper()),\r
FfsFile.CurrentLineContent,\r
_GuidDict[_PcdGuidString.upper()].CurrentLineNum,\r
_GuidDict[_PcdGuidString.upper()].CurrentLineContent,\r
FfsFile.NameGuid.upper()),\r
if not FfsFile.NameGuid.upper() in _GuidDict.keys():\r
_GuidDict[FfsFile.NameGuid.upper()] = FfsFile\r
else:\r
#\r
# Two raw file GUID conflict.\r
#\r
if not FfsFile.NameGuid.upper() in _GuidDict.keys():\r
_GuidDict[FfsFile.NameGuid.upper()] = FfsFile\r
else:\r
#\r
# Two raw file GUID conflict.\r
#\r
FfsFile.CurrentLineContent,\r
_GuidDict[FfsFile.NameGuid.upper()].CurrentLineNum,\r
_GuidDict[FfsFile.NameGuid.upper()].CurrentLineContent,\r
FfsFile.NameGuid.upper()),\r
ExtraData=self.FdfFile)\r
FfsFile.CurrentLineContent,\r
_GuidDict[FfsFile.NameGuid.upper()].CurrentLineNum,\r
_GuidDict[FfsFile.NameGuid.upper()].CurrentLineContent,\r
FfsFile.NameGuid.upper()),\r
ExtraData=self.FdfFile)\r
# Key of DSC's Pcds dictionary is PcdCName, TokenSpaceGuid\r
for Pcd in Pa.Platform.Pcds:\r
PcdType = Pa.Platform.Pcds[Pcd].Type\r
# Key of DSC's Pcds dictionary is PcdCName, TokenSpaceGuid\r
for Pcd in Pa.Platform.Pcds:\r
PcdType = Pa.Platform.Pcds[Pcd].Type\r
# Try to remove Hii and Vpd suffix\r
if PcdType.startswith("DynamicEx"):\r
PcdType = "DynamicEx"\r
elif PcdType.startswith("Dynamic"):\r
PcdType = "Dynamic"\r
# Try to remove Hii and Vpd suffix\r
if PcdType.startswith("DynamicEx"):\r
PcdType = "DynamicEx"\r
elif PcdType.startswith("Dynamic"):\r
PcdType = "Dynamic"\r
for Package in Pa.PackageList:\r
# Key of DEC's Pcds dictionary is PcdCName, TokenSpaceGuid, PcdType\r
if (Pcd[0], Pcd[1], PcdType) in Package.Pcds:\r
for Package in Pa.PackageList:\r
# Key of DEC's Pcds dictionary is PcdCName, TokenSpaceGuid, PcdType\r
if (Pcd[0], Pcd[1], PcdType) in Package.Pcds:\r
# BuildCommand should be all the same. So just get one from platform AutoGen\r
self._BuildCommand = self.AutoGenObjectList[0].BuildCommand\r
return self._BuildCommand\r
# BuildCommand should be all the same. So just get one from platform AutoGen\r
self._BuildCommand = self.AutoGenObjectList[0].BuildCommand\r
return self._BuildCommand\r
## Check the PCDs token value conflict in each DEC file.\r
#\r
# Will cause build break and raise error message while two PCDs conflict.\r
## Check the PCDs token value conflict in each DEC file.\r
#\r
# Will cause build break and raise error message while two PCDs conflict.\r
for Pa in self.AutoGenObjectList:\r
for Package in Pa.PackageList:\r
PcdList = Package.Pcds.values()\r
for Pa in self.AutoGenObjectList:\r
for Package in Pa.PackageList:\r
PcdList = Package.Pcds.values()\r
- PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue)) \r
+ PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0))) \r
SameTokenValuePcdList = []\r
SameTokenValuePcdList.append(Item)\r
SameTokenValuePcdList.append(ItemNext)\r
RemainPcdListLength = len(PcdList) - Count - 2\r
for ValueSameCount in range(RemainPcdListLength):\r
SameTokenValuePcdList = []\r
SameTokenValuePcdList.append(Item)\r
SameTokenValuePcdList.append(ItemNext)\r
RemainPcdListLength = len(PcdList) - Count - 2\r
for ValueSameCount in range(RemainPcdListLength):\r
SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])\r
else:\r
break;\r
#\r
# Sort same token value PCD list with TokenGuid and TokenCName\r
#\r
SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])\r
else:\r
break;\r
#\r
# Sort same token value PCD list with TokenGuid and TokenCName\r
#\r
- SameTokenValuePcdList.sort(lambda x, y: cmp("%s.%s"%(x.TokenSpaceGuidCName, x.TokenCName), "%s.%s"%(y.TokenSpaceGuidCName, y.TokenCName))) \r
- SameTokenValuePcdListCount = 0 \r
+ SameTokenValuePcdList.sort(lambda x, y: cmp("%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName), "%s.%s" % (y.TokenSpaceGuidCName, y.TokenCName)))\r
+ SameTokenValuePcdListCount = 0\r
- TemListItem = SameTokenValuePcdList[SameTokenValuePcdListCount]\r
- TemListItemNext = SameTokenValuePcdList[SameTokenValuePcdListCount + 1] \r
- \r
+ TemListItem = SameTokenValuePcdList[SameTokenValuePcdListCount]\r
+ TemListItemNext = SameTokenValuePcdList[SameTokenValuePcdListCount + 1]\r
+\r
- PcdList.sort(lambda x, y: cmp("%s.%s"%(x.TokenSpaceGuidCName, x.TokenCName), "%s.%s"%(y.TokenSpaceGuidCName, y.TokenCName)))\r
+ PcdList.sort(lambda x, y: cmp("%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName), "%s.%s" % (y.TokenSpaceGuidCName, y.TokenCName)))\r
"0x01001" : 3, # ******_TOOLCHAIN_****_***********_ATTRIBUTE\r
"0x10001" : 2, # TARGET_*********_****_***********_ATTRIBUTE\r
"0x00001" : 1} # ******_*********_****_***********_ATTRIBUTE (Lowest)\r
"0x01001" : 3, # ******_TOOLCHAIN_****_***********_ATTRIBUTE\r
"0x10001" : 2, # TARGET_*********_****_***********_ATTRIBUTE\r
"0x00001" : 1} # ******_*********_****_***********_ATTRIBUTE (Lowest)\r
## The real constructor of PlatformAutoGen\r
#\r
# This method is not supposed to be called by users of PlatformAutoGen. It's\r
## The real constructor of PlatformAutoGen\r
#\r
# This method is not supposed to be called by users of PlatformAutoGen. It's\r
FdfModuleList.append(os.path.normpath(InfName))\r
for F in self.Platform.Modules.keys():\r
M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.ToolChain, self.Arch, self.MetaFile)\r
#GuidValue.update(M.Guids)\r
\r
self.Platform.Modules[F].M = M\r
FdfModuleList.append(os.path.normpath(InfName))\r
for F in self.Platform.Modules.keys():\r
M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.ToolChain, self.Arch, self.MetaFile)\r
#GuidValue.update(M.Guids)\r
\r
self.Platform.Modules[F].M = M\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize in [None, '']:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize in [None, '']:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))\r
if (self.Workspace.ArchList[-1] == self.Arch): \r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
if (self.Workspace.ArchList[-1] == self.Arch): \r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
PcdValue = Sku.DefaultValue\r
if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):\r
# if found PCD which datum value is unicode string the insert to left size of UnicodeIndex\r
PcdValue = Sku.DefaultValue\r
if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):\r
# if found PCD which datum value is unicode string the insert to left size of UnicodeIndex\r
else:\r
OtherPcdArray.append(Pcd)\r
if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:\r
else:\r
OtherPcdArray.append(Pcd)\r
if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:\r
if self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == '':\r
EdkLogger.error("Build", FILE_NOT_FOUND, \\r
"Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
if self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == '':\r
EdkLogger.error("Build", FILE_NOT_FOUND, \\r
"Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
#\r
# Fix the PCDs define in VPD PCD section that never referenced by module.\r
# An example is PCD for signature usage.\r
#\r
# Fix the PCDs define in VPD PCD section that never referenced by module.\r
# An example is PCD for signature usage.\r
if (VpdPcd.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \\r
(VpdPcd.TokenCName == DscPcdEntry.TokenCName):\r
FoundFlag = True\r
if (VpdPcd.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \\r
(VpdPcd.TokenCName == DscPcdEntry.TokenCName):\r
FoundFlag = True\r
# Not found, it should be signature\r
if not FoundFlag :\r
# just pick the a value to determine whether is unicode string type\r
# Not found, it should be signature\r
if not FoundFlag :\r
# just pick the a value to determine whether is unicode string type\r
VpdFile.GetCount() != 0:\r
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, \r
"Fail to get FLASH_DEFINITION definition in DSC file %s which is required when DSC contains VPD PCD." % str(self.Platform.MetaFile))\r
VpdFile.GetCount() != 0:\r
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, \r
"Fail to get FLASH_DEFINITION definition in DSC file %s which is required when DSC contains VPD PCD." % str(self.Platform.MetaFile))\r
if VpdFile.GetCount() != 0:\r
DscTimeStamp = self.Platform.MetaFile.TimeStamp\r
FvPath = os.path.join(self.BuildDir, "FV")\r
if VpdFile.GetCount() != 0:\r
DscTimeStamp = self.Platform.MetaFile.TimeStamp\r
FvPath = os.path.join(self.BuildDir, "FV")\r
if not os.path.exists(VpdFilePath) or os.path.getmtime(VpdFilePath) < DscTimeStamp:\r
VpdFile.Write(VpdFilePath)\r
if not os.path.exists(VpdFilePath) or os.path.getmtime(VpdFilePath) < DscTimeStamp:\r
VpdFile.Write(VpdFilePath)\r
# retrieve BPDG tool's path from tool_def.txt according to VPD_TOOL_GUID defined in DSC file.\r
BPDGToolName = None\r
for ToolDef in self.ToolDefinition.values():\r
# retrieve BPDG tool's path from tool_def.txt according to VPD_TOOL_GUID defined in DSC file.\r
BPDGToolName = None\r
for ToolDef in self.ToolDefinition.values():\r
VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)\r
else:\r
EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)\r
else:\r
EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
# Process VPD map file generated by third party BPDG tool\r
if NeedProcessVpdMapFile:\r
VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)\r
if os.path.exists(VpdMapFilePath):\r
VpdFile.Read(VpdMapFilePath)\r
# Process VPD map file generated by third party BPDG tool\r
if NeedProcessVpdMapFile:\r
VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)\r
if os.path.exists(VpdMapFilePath):\r
VpdFile.Read(VpdMapFilePath)\r
# Fixup "*" offset\r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
# Fixup "*" offset\r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
i += 1\r
else:\r
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)\r
i += 1\r
else:\r
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)\r
self._DynamicPcdList.extend(UnicodePcdArray)\r
self._DynamicPcdList.extend(HiiPcdArray)\r
self._DynamicPcdList.extend(OtherPcdArray)\r
self._DynamicPcdList.extend(UnicodePcdArray)\r
self._DynamicPcdList.extend(HiiPcdArray)\r
self._DynamicPcdList.extend(OtherPcdArray)\r
else:\r
if self._BuildRule._FileVersion < AutoGenReqBuildRuleVerNum :\r
# If Build Rule's version is less than the version number required by the tools, halting the build.\r
else:\r
if self._BuildRule._FileVersion < AutoGenReqBuildRuleVerNum :\r
# If Build Rule's version is less than the version number required by the tools, halting the build.\r
ExtraData="The version number [%s] of build_rule.txt is less than the version number required by the AutoGen.(the minimum required version number is [%s])"\\r
% (self._BuildRule._FileVersion, AutoGenReqBuildRuleVerNum))\r
ExtraData="The version number [%s] of build_rule.txt is less than the version number required by the AutoGen.(the minimum required version number is [%s])"\\r
% (self._BuildRule._FileVersion, AutoGenReqBuildRuleVerNum))\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.DynamicPcdList:\r
if Pcd.Phase == "PEI":\r
if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.DynamicPcdList:\r
if Pcd.Phase == "PEI":\r
if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.DynamicPcdList:\r
if Pcd.Phase == "DXE":\r
if Pcd.Type in ["Dynamic", "DynamicDefault", "DynamicVpd", "DynamicHii"]:\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.DynamicPcdList:\r
if Pcd.Phase == "DXE":\r
if Pcd.Type in ["Dynamic", "DynamicDefault", "DynamicVpd", "DynamicHii"]:\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.DynamicPcdList:\r
if Pcd.Phase == "DXE":\r
if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.DynamicPcdList:\r
if Pcd.Phase == "DXE":\r
if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:\r
EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.NonDynamicPcdList:\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
for Pcd in self.NonDynamicPcdList:\r
self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber\r
TokenNumber += 1\r
elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\\r
and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):\r
if ToPcd.Type.strip() == "DynamicEx":\r
elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\\r
and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):\r
if ToPcd.Type.strip() == "DynamicEx":\r
elif ToPcd.Type not in [None, ''] and FromPcd.Type not in [None, ''] \\r
and ToPcd.Type != FromPcd.Type:\r
EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD type",\r
elif ToPcd.Type not in [None, ''] and FromPcd.Type not in [None, ''] \\r
and ToPcd.Type != FromPcd.Type:\r
EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD type",\r
#\r
def ApplyPcdSetting(self, Module, Pcds):\r
# for each PCD in module\r
#\r
def ApplyPcdSetting(self, Module, Pcds):\r
# for each PCD in module\r
- for Name,Guid in Pcds:\r
- PcdInModule = Pcds[Name,Guid]\r
+ for Name, Guid in Pcds:\r
+ PcdInModule = Pcds[Name, Guid]\r
- if (Name,Guid) in self.Platform.Pcds:\r
- PcdInPlatform = self.Platform.Pcds[Name,Guid]\r
+ if (Name, Guid) in self.Platform.Pcds:\r
+ PcdInPlatform = self.Platform.Pcds[Name, Guid]\r
# @retval Value Priority value based on the priority list.\r
#\r
def CalculatePriorityValue(self, Key):\r
# @retval Value Priority value based on the priority list.\r
#\r
def CalculatePriorityValue(self, Key):\r
- Target, ToolChain, Arch, CommandType, Attr = Key.split('_') \r
- PriorityValue = 0x11111 \r
+ Target, ToolChain, Arch, CommandType, Attr = Key.split('_')\r
+ PriorityValue = 0x11111\r
Target, ToolChain, Arch, CommandType, Attr = Key[1].split('_')\r
if Target == self.BuildTarget or Target == "*":\r
if ToolChain == self.ToolChain or ToolChain == "*":\r
if Arch == self.Arch or Arch == "*":\r
if Options[Key].startswith("="):\r
Target, ToolChain, Arch, CommandType, Attr = Key[1].split('_')\r
if Target == self.BuildTarget or Target == "*":\r
if ToolChain == self.ToolChain or ToolChain == "*":\r
if Arch == self.Arch or Arch == "*":\r
if Options[Key].startswith("="):\r
Target1, ToolChain1, Arch1, CommandType1, Attr1 = NowKey.split("_")\r
for Index1 in range(len(KeyList) - Index - 1):\r
NextKey = KeyList[Index1 + Index + 1]\r
Target1, ToolChain1, Arch1, CommandType1, Attr1 = NowKey.split("_")\r
for Index1 in range(len(KeyList) - Index - 1):\r
NextKey = KeyList[Index1 + Index + 1]\r
if CommandType1 == CommandType2 or CommandType1 == "*" or CommandType2 == "*":\r
if Attr1 == Attr2 or Attr1 == "*" or Attr2 == "*":\r
if self.CalculatePriorityValue(NowKey) > self.CalculatePriorityValue(NextKey):\r
if CommandType1 == CommandType2 or CommandType1 == "*" or CommandType2 == "*":\r
if Attr1 == Attr2 or Attr1 == "*" or Attr2 == "*":\r
if self.CalculatePriorityValue(NowKey) > self.CalculatePriorityValue(NextKey):\r
if Arch == "*" or Arch == self.Arch:\r
if Tool not in BuildOptions:\r
BuildOptions[Tool] = {}\r
if Arch == "*" or Arch == self.Arch:\r
if Tool not in BuildOptions:\r
BuildOptions[Tool] = {}\r
# Build Option Family has been checked, which need't to be checked again for family.\r
if FamilyMatch or FamilyIsNull:\r
return BuildOptions\r
# Build Option Family has been checked, which need't to be checked again for family.\r
if FamilyMatch or FamilyIsNull:\r
return BuildOptions\r
Family = Key[0]\r
Target, Tag, Arch, Tool, Attr = Key[1].split("_")\r
# if tool chain family doesn't match, skip it\r
Family = Key[0]\r
Target, Tag, Arch, Tool, Attr = Key[1].split("_")\r
# if tool chain family doesn't match, skip it\r
if Arch == "*" or Arch == self.Arch:\r
if Tool not in BuildOptions:\r
BuildOptions[Tool] = {}\r
if Arch == "*" or Arch == self.Arch:\r
if Tool not in BuildOptions:\r
BuildOptions[Tool] = {}\r
BuildOptions[Tool][Attr] = ""\r
# check if override is indicated\r
if Value.startswith('='):\r
BuildOptions[Tool][Attr] = ""\r
# check if override is indicated\r
if Value.startswith('='):\r
BuildOptions[Tool][Attr] += " " + Value\r
if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:\r
#\r
BuildOptions[Tool][Attr] += " " + Value\r
if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:\r
#\r
# is the former use /I , the Latter used -I to specify include directories\r
#\r
if self.PlatformInfo.ToolChainFamily in ('MSFT'):\r
# is the former use /I , the Latter used -I to specify include directories\r
#\r
if self.PlatformInfo.ToolChainFamily in ('MSFT'):\r
if self.AutoGenVersion >= 0x00010005 and len(IncPathList) > 0:\r
for Path in IncPathList:\r
if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):\r
if self.AutoGenVersion >= 0x00010005 and len(IncPathList) > 0:\r
for Path in IncPathList:\r
if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):\r
- ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption) \r
- EdkLogger.error("build", \r
+ ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption)\r
+ EdkLogger.error("build",\r
if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList:\r
# Skip all files that are not binary libraries\r
if not self.IsLibrary:\r
if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList:\r
# Skip all files that are not binary libraries\r
if not self.IsLibrary:\r
RuleObject = self.BuildRules[TAB_DEFAULT_BINARY_FILE]\r
elif FileType in self.BuildRules:\r
RuleObject = self.BuildRules[FileType]\r
RuleObject = self.BuildRules[TAB_DEFAULT_BINARY_FILE]\r
elif FileType in self.BuildRules:\r
RuleObject = self.BuildRules[FileType]\r
if PackageDir not in self._IncludePathList:\r
self._IncludePathList.append(PackageDir)\r
for Inc in Package.Includes:\r
if PackageDir not in self._IncludePathList:\r
self._IncludePathList.append(PackageDir)\r
for Inc in Package.Includes:\r
'module_uefi_hii_resource_section' : [MDefs['UEFI_HII_RESOURCE_SECTION']] if 'UEFI_HII_RESOURCE_SECTION' in MDefs else [],\r
'module_uni_file' : [MDefs['MODULE_UNI_FILE']] if 'MODULE_UNI_FILE' in MDefs else [],\r
'module_arch' : self.Arch,\r
'module_uefi_hii_resource_section' : [MDefs['UEFI_HII_RESOURCE_SECTION']] if 'UEFI_HII_RESOURCE_SECTION' in MDefs else [],\r
'module_uni_file' : [MDefs['MODULE_UNI_FILE']] if 'MODULE_UNI_FILE' in MDefs else [],\r
'module_arch' : self.Arch,\r
if 'PI_SPECIFICATION_VERSION' in self.Specification:\r
AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']]\r
\r
if 'PI_SPECIFICATION_VERSION' in self.Specification:\r
AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']]\r
\r
if self.ModuleType in ['BASE', 'USER_DEFINED']:\r
for Item in self.CodaTargetList:\r
if self.ModuleType in ['BASE', 'USER_DEFINED']:\r
for Item in self.CodaTargetList:\r
- File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')\r
- if Item.Target.Ext.lower() == '.aml': \r
+ File = Item.Target.Path.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/')\r
+ if Item.Target.Ext.lower() == '.aml':\r
AsBuiltInfDict['binary_item'] += ['ACPI|' + File]\r
else:\r
AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
else:\r
for Item in self.CodaTargetList:\r
AsBuiltInfDict['binary_item'] += ['ACPI|' + File]\r
else:\r
AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
else:\r
for Item in self.CodaTargetList:\r
- File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')\r
- if Item.Target.Ext.lower() == '.efi': \r
+ File = Item.Target.Path.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/')\r
+ if Item.Target.Ext.lower() == '.efi':\r
AsBuiltInfDict['binary_item'] += ['PE32|' + self.Name + '.efi']\r
else:\r
AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
if self.DepexGenerated:\r
if self.ModuleType in ['PEIM']:\r
AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']\r
AsBuiltInfDict['binary_item'] += ['PE32|' + self.Name + '.efi']\r
else:\r
AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
if self.DepexGenerated:\r
if self.ModuleType in ['PEIM']:\r
AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']\r
- if self.ModuleType in ['DXE_DRIVER','DXE_RUNTIME_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:\r
+ if self.ModuleType in ['DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'UEFI_DRIVER']:\r
AsBuiltInfDict['binary_item'] += ['DXE_DEPEX|' + self.Name + '.depex']\r
if self.ModuleType in ['DXE_SMM_DRIVER']:\r
AsBuiltInfDict['binary_item'] += ['SMM_DEPEX|' + self.Name + '.depex']\r
AsBuiltInfDict['binary_item'] += ['DXE_DEPEX|' + self.Name + '.depex']\r
if self.ModuleType in ['DXE_SMM_DRIVER']:\r
AsBuiltInfDict['binary_item'] += ['SMM_DEPEX|' + self.Name + '.depex']\r