From nobody Mon Apr 29 11:45:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523402250410845.7077071237352; Tue, 10 Apr 2018 16:17:30 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 178DB2261817E; Tue, 10 Apr 2018 16:17:28 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B3F6922618159 for ; Tue, 10 Apr 2018 16:17:26 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 16:17:25 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2018 16:17:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,434,1517904000"; d="scan'208";a="42343787" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 10 Apr 2018 16:17:20 -0700 Message-Id: <38adb39f1ac019d1a1dbc4363317816170f11361.1523402167.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 1/5] BaseTools: use existing shared variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenVar.py | 15 ++++---- BaseTools/Source/Python/Common/Misc.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 38 ++++++++++---------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index d222e6ed5e7e..7a29a0edca45 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -20,6 +20,7 @@ import copy from Common.VariableAttributes import VariableAttributes from Common.Misc import * import collections +import Common.DataType as DataType =20 var_info =3D collections.namedtuple("uefi_var", "pcdindex,pcdname,defaults= toragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default= _value, default_value, data_type") NvStorageHeaderSize =3D 28 @@ -141,7 +142,7 @@ class VariableMgr(object): default_data_buffer =3D "" others_data_buffer =3D "" tail =3D None - default_sku_default =3D indexedvarinfo.get(index).get(("DEFAUL= T","STANDARD")) + default_sku_default =3D indexedvarinfo.get(index).get(("DEFAUL= T",DataType.TAB_DEFAULT_STORES_DEFAULT)) =20 if default_sku_default.data_type not in ["UINT8","UINT16","UIN= T32","UINT64","BOOLEAN"]: var_max_len =3D max([len(var_item.default_value.split(",")= ) for var_item in sku_var_info.values()]) @@ -154,13 +155,13 @@ class VariableMgr(object): for item in default_data_buffer: default_data_array +=3D unpack("B",item) =20 - if ("DEFAULT","STANDARD") not in var_data: - var_data[("DEFAULT","STANDARD")] =3D collections.OrderedDi= ct() - var_data[("DEFAULT","STANDARD")][index] =3D (default_data_buff= er,sku_var_info[("DEFAULT","STANDARD")]) + if ("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT) not in var_= data: + var_data[("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT)] = =3D collections.OrderedDict() + var_data[("DEFAULT",DataType.TAB_DEFAULT_STORES_DEFAULT)][inde= x] =3D (default_data_buffer,sku_var_info[("DEFAULT",DataType.TAB_DEFAULT_ST= ORES_DEFAULT)]) =20 for (skuid,defaultstoragename) in indexedvarinfo.get(index): tail =3D None - if (skuid,defaultstoragename) =3D=3D ("DEFAULT","STANDARD"= ): + if (skuid,defaultstoragename) =3D=3D ("DEFAULT",DataType.T= AB_DEFAULT_STORES_DEFAULT): continue other_sku_other =3D indexedvarinfo.get(index).get((skuid,d= efaultstoragename)) =20 @@ -189,7 +190,7 @@ class VariableMgr(object): if not var_data: return [] =20 - pcds_default_data =3D var_data.get(("DEFAULT","STANDARD"),{}) + pcds_default_data =3D var_data.get(("DEFAULT",DataType.TAB_DEFAULT= _STORES_DEFAULT),{}) NvStoreDataBuffer =3D "" var_data_offset =3D collections.OrderedDict() offset =3D NvStorageHeaderSize @@ -219,7 +220,7 @@ class VariableMgr(object): =20 data_delta_structure_buffer =3D "" for skuname,defaultstore in var_data: - if (skuname,defaultstore) =3D=3D ("DEFAULT","STANDARD"): + if (skuname,defaultstore) =3D=3D ("DEFAULT",DataType.TAB_DEFAU= LT_STORES_DEFAULT): continue pcds_sku_data =3D var_data.get((skuname,defaultstore)) delta_data_set =3D [] diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index 23c1a4a0b236..5ffd8cd0223d 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1922,7 +1922,7 @@ class DefaultStore(): return (str(minvalue), self.DefaultStores[str(minvalue)]) def GetMin(self,DefaultSIdList): if not DefaultSIdList: - return "STANDARD" + return TAB_DEFAULT_STORES_DEFAULT storeidset =3D {storeid for storeid, storename in self.DefaultStor= es.values() if storename in DefaultSIdList} if not storeidset: return "" diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 6766f059b0f7..fcd3132860d5 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -947,10 +947,10 @@ class DscBuildData(PlatformBuildClassObject): for pcd in HiiPcd: for skuid in pcd.SkuInfoList: skuobj =3D pcd.SkuInfoList.get(skuid) - if "STANDARD" not in skuobj.DefaultStoreDict: + if TAB_DEFAULT_STORES_DEFAULT not in skuobj.DefaultStoreDi= ct: PcdDefaultStoreSet =3D set([defaultstorename for defa= ultstorename in skuobj.DefaultStoreDict]) mindefaultstorename =3D DefaultStoreMgr.GetMin(PcdDefa= ultStoreSet) - skuobj.DefaultStoreDict['STANDARD'] =3D copy.deepcopy(= skuobj.DefaultStoreDict[mindefaultstorename]) + skuobj.DefaultStoreDict[TAB_DEFAULT_STORES_DEFAULT] = =3D copy.deepcopy(skuobj.DefaultStoreDict[mindefaultstorename]) return Pcds =20 def RecoverCommandLinePcd(self): @@ -1325,7 +1325,7 @@ class DscBuildData(PlatformBuildClassObject): str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defau= ltstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore= , str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in Defaul= tStores} for skuname in str_pcd_obj.SkuInfoList} for str_pcd_data in StrPcdSet[str_pcd]: 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] =3D=3D 'COMMON' else str= _pcd_data[3],'STANDARD' if str_pcd_data[4] =3D=3D 'COMMON' else str_pcd_dat= a[4], self.MetaFile.File if self.WorkspaceDir not in self.MetaFile.File els= e self.MetaFile.File[len(self.WorkspaceDir) if self.WorkspaceDir.endswith(o= s.path.sep) else len(self.WorkspaceDir)+1:],LineNo=3Dstr_pcd_data[5]) + str_pcd_obj_str.AddOverrideValue(str_pcd_data[2], = str(str_pcd_data[6]), 'DEFAULT' if str_pcd_data[3] =3D=3D 'COMMON' else str= _pcd_data[3],TAB_DEFAULT_STORES_DEFAULT if str_pcd_data[4] =3D=3D 'COMMON' = else str_pcd_data[4], self.MetaFile.File if self.WorkspaceDir not in self.M= etaFile.File else self.MetaFile.File[len(self.WorkspaceDir) if self.Workspa= ceDir.endswith(os.path.sep) else len(self.WorkspaceDir)+1:],LineNo=3Dstr_pc= d_data[5]) S_pcd_set[str_pcd[1], str_pcd[0]] =3D str_pcd_obj_str else: EdkLogger.error('build', PARSER_ERROR, @@ -1359,7 +1359,7 @@ class DscBuildData(PlatformBuildClassObject): NoDefault =3D True break nextskuid =3D self.SkuIdMgr.GetNextSkuId(nextskuid) - stru_pcd.SkuOverrideValues[skuid] =3D copy.deepcopy(st= ru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({d= efaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStor= es} if DefaultStores else {'STANDARD':stru_pcd.DefaultValues}) + stru_pcd.SkuOverrideValues[skuid] =3D copy.deepcopy(st= ru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({d= efaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStor= es} if DefaultStores else {TAB_DEFAULT_STORES_DEFAULT:stru_pcd.DefaultValue= s}) if not NoDefault: stru_pcd.ValueChain[(skuid,'')]=3D (nextskuid,'') if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_= HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: @@ -1744,10 +1744,10 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' UINT32 FieldSize;\n' CApp =3D CApp + ' CHAR8 *Value;\n' =20 - CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n" % ('DEF= AULT', 'STANDARD') + CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n" % ('DEF= AULT', TAB_DEFAULT_STORES_DEFAULT) inherit_OverrideValues =3D Pcd.SkuOverrideValues[SkuName] - if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT','STANDARD'): - pcddefaultvalue =3D Pcd.DefaultFromDSC.get('DEFAULT',{}).get('= STANDARD', Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue + if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT',TAB_DEFAULT_STORES= _DEFAULT): + pcddefaultvalue =3D Pcd.DefaultFromDSC.get('DEFAULT',{}).get(T= AB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd= .DefaultValue else: if not Pcd.DscRawValue: # handle the case that structure pcd is not appear in DSC @@ -1766,14 +1766,14 @@ class DscBuildData(PlatformBuildClassObject): (Pcd.TokenSpaceGuidCName, Pcd.Toke= nCName, FieldList)) Value, ValueSize =3D ParseFieldValue (FieldList) =20 - if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT','STANDARD'= ): + if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT',TAB_DEFAUL= T_STORES_DEFAULT): if isinstance(Value, str): - CApp =3D CApp + ' Pcd =3D %s; // From DSC Default= Value %s\n' % (Value, Pcd.DefaultFromDSC.get('DEFAULT',{}).get('STANDARD',= Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue) + CApp =3D CApp + ' Pcd =3D %s; // From DSC Default= Value %s\n' % (Value, Pcd.DefaultFromDSC.get('DEFAULT',{}).get(TAB_DEFAULT= _STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultVa= lue) elif IsArray: # # Use memcpy() to copy value into field # - CApp =3D CApp + ' Value =3D %s; // From DSC D= efault Value %s\n' % (self.IntToCString(Value, ValueSize), Pcd.DefaultFromD= SC.get('DEFAULT',{}).get('STANDARD', Pcd.DefaultValue) if Pcd.DefaultFromDS= C else Pcd.DefaultValue) + CApp =3D CApp + ' Value =3D %s; // From DSC D= efault Value %s\n' % (self.IntToCString(Value, ValueSize), Pcd.DefaultFromD= SC.get('DEFAULT',{}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if P= cd.DefaultFromDSC else Pcd.DefaultValue) CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (= ValueSize) else: if isinstance(Value, str): @@ -1785,7 +1785,7 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' Value =3D %s; // From DSC D= efault Value %s\n' % (self.IntToCString(Value, ValueSize), Pcd.DscRawValue.= get(SkuName,{}).get(DefaultStoreName)) CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (= ValueSize) continue - if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT','STANDARD') or= (( (SkuName,'') not in Pcd.ValueChain) and ( (SkuName,DefaultStoreName) no= t in Pcd.ValueChain )): + if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT',TAB_DEFAULT_ST= ORES_DEFAULT) or (( (SkuName,'') not in Pcd.ValueChain) and ( (SkuName,Defa= ultStoreName) not in Pcd.ValueChain )): for FieldName in FieldList: IsArray =3D IsFieldValueAnArray(FieldList[FieldName][0= ]) if IsArray: @@ -1941,7 +1941,7 @@ class DscBuildData(PlatformBuildClassObject): if Pcd.Type not in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_= BUILD], self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODU= LE]]: for skuname in self.SkuIdMgr.GetSkuChain(SkuName): - storeset =3D [DefaultStoreName] if DefaultStoreName = =3D=3D 'STANDARD' else ['STANDARD', DefaultStoreName] + storeset =3D [DefaultStoreName] if DefaultStoreName = =3D=3D TAB_DEFAULT_STORES_DEFAULT else [TAB_DEFAULT_STORES_DEFAULT, Default= StoreName] for defaultstorenameitem in storeset: CApp =3D CApp + "// SkuName: %s, DefaultStoreName= : %s \n" % (skuname, defaultstorenameitem) CApp =3D CApp + self.GenerateInitValueStatement(Pc= d,skuname,defaultstorenameitem) @@ -1949,7 +1949,7 @@ class DscBuildData(PlatformBuildClassObject): break else: CApp =3D CApp + "// SkuName: %s, DefaultStoreName: STANDA= RD \n" % self.SkuIdMgr.SystemSkuId - CApp =3D CApp + self.GenerateInitValueStatement(Pcd,self.S= kuIdMgr.SystemSkuId,"STANDARD") + CApp =3D CApp + self.GenerateInitValueStatement(Pcd,self.S= kuIdMgr.SystemSkuId,TAB_DEFAULT_STORES_DEFAULT) CApp =3D CApp + self.GenerateCommandLineValueStatement(Pcd) # # Set new PCD value and size @@ -1991,7 +1991,7 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + self.GenerateCommandLineValue(Pcd) if not Pcd.SkuOverrideValues or Pcd.Type in [self._PCD_TYPE_ST= RING_[MODEL_PCD_FIXED_AT_BUILD], self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODU= LE]]: - CApp =3D CApp + self.GenerateInitValueFunction(Pcd,self.Sk= uIdMgr.SystemSkuId, 'STANDARD') + CApp =3D CApp + self.GenerateInitValueFunction(Pcd,self.Sk= uIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT) else: for SkuName in self.SkuIdMgr.SkuOverrideOrder(): if SkuName not in Pcd.SkuOverrideValues: @@ -2000,7 +2000,7 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + self.GenerateInitValueFunction(Pcd= ,SkuName,DefaultStoreName) if not Pcd.SkuOverrideValues or Pcd.Type in [self._PCD_TYPE_ST= RING_[MODEL_PCD_FIXED_AT_BUILD], self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODU= LE]]: - InitByteValue, CApp =3D self.GenerateInitializeFunc(self.S= kuIdMgr.SystemSkuId, 'STANDARD', Pcd, InitByteValue, CApp) + InitByteValue, CApp =3D self.GenerateInitializeFunc(self.S= kuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT, Pcd, InitByteValue, CApp) else: for SkuName in self.SkuIdMgr.SkuOverrideOrder(): if SkuName not in Pcd.SkuOverrideValues: @@ -2016,7 +2016,7 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + '{\n' for Pcd in StructuredPcds.values(): if not Pcd.SkuOverrideValues or Pcd.Type in [self._PCD_TYPE_ST= RING_[MODEL_PCD_FIXED_AT_BUILD],self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_= IN_MODULE]]: - CApp =3D CApp + ' Initialize_%s_%s_%s_%s();\n' % (self.Sk= uIdMgr.SystemSkuId, 'STANDARD', Pcd.TokenSpaceGuidCName, Pcd.TokenCName) + CApp =3D CApp + ' Initialize_%s_%s_%s_%s();\n' % (self.Sk= uIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pc= d.TokenCName) else: for SkuName in self.SkuIdMgr.SkuOverrideOrder(): if SkuName not in Pcd.SkuOverrideValues: @@ -2340,14 +2340,14 @@ class DscBuildData(PlatformBuildClassObject): if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD], = self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]: if self.SkuIdMgr.SystemSkuId not in Pcd.DscRawValue: Pcd.DscRawValue[self.SkuIdMgr.SystemSkuId] =3D {} - Pcd.DscRawValue[self.SkuIdMgr.SystemSkuId]['STANDARD'] =3D Pcd= .DefaultValue + Pcd.DscRawValue[self.SkuIdMgr.SystemSkuId][TAB_DEFAULT_STORES_= DEFAULT] =3D Pcd.DefaultValue for skuname in Pcd.SkuInfoList: Pcd.DscRawValue[skuname] =3D {} if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],= self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for defaultstore in Pcd.SkuInfoList[skuname].DefaultStoreD= ict: Pcd.DscRawValue[skuname][defaultstore] =3D Pcd.SkuInfo= List[skuname].DefaultStoreDict[defaultstore] else: - Pcd.DscRawValue[skuname]['STANDARD'] =3D Pcd.SkuInfoList[s= kuname].DefaultValue + Pcd.DscRawValue[skuname][TAB_DEFAULT_STORES_DEFAULT] =3D P= cd.SkuInfoList[skuname].DefaultValue def CompletePcdValues(self,PcdSet): Pcds =3D {} DefaultStoreObj =3D DefaultStore(self._GetDefaultStores()) @@ -2412,7 +2412,7 @@ class DscBuildData(PlatformBuildClassObject): SkuName =3D 'DEFAULT' if SkuName =3D=3D 'COMMON' else SkuName DefaultStore =3D DefaultStore.upper() if DefaultStore =3D=3D "COMMON": - DefaultStore =3D "STANDARD" + DefaultStore =3D TAB_DEFAULT_STORES_DEFAULT if SkuName not in AvailableSkuIdSet: EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not= defined in [SkuIds] section' % SkuName, File=3Dself.MetaFile, Line=3DD= ummy5) --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 11:45:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152340225383732.056752181026695; Tue, 10 Apr 2018 16:17:33 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4718922526485; Tue, 10 Apr 2018 16:17:28 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D64062261814F for ; Tue, 10 Apr 2018 16:17:26 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 16:17:26 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2018 16:17:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,434,1517904000"; d="scan'208";a="42343790" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 10 Apr 2018 16:17:21 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 2/5] BaseTools: no need to save the data X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It's never accessed. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 9280ae4c7df2..5dd24ffc8720 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -361,13 +361,12 @@ class WorkspaceAutoGen(AutoGen): # but the path (self.MetaFile.Path) is the real path for key in self.FdfProfile.InfDict: if key =3D=3D 'ArchTBD': - Platform_cache =3D {} MetaFile_cache =3D {} for Arch in self.ArchList: - Platform_cache[Arch] =3D self.BuildDatabase[self.M= etaFile, Arch, Target, Toolchain] + Current_Platform_cache =3D self.BuildDatabase[self= .MetaFile, Arch, Target, Toolchain] MetaFile_cache[Arch] =3D set() - for Pkey in Platform_cache[Arch].Modules: - MetaFile_cache[Arch].add(Platform_cache[Arch].= Modules[Pkey].MetaFile) + for Pkey in Current_Platform_cache.Modules: + MetaFile_cache[Arch].add(Current_Platform_cach= e.Modules[Pkey].MetaFile) for Inf in self.FdfProfile.InfDict[key]: ModuleFile =3D PathClass(NormPath(Inf), GlobalData= .gWorkspace, Arch) for Arch in self.ArchList: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 11:45:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523402256982748.3403050177925; Tue, 10 Apr 2018 16:17:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 71D53226516BB; Tue, 10 Apr 2018 16:17:28 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0802722618159 for ; Tue, 10 Apr 2018 16:17:27 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 16:17:26 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2018 16:17:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,434,1517904000"; d="scan'208";a="42343792" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 10 Apr 2018 16:17:22 -0700 Message-Id: <0ecd0d8b8925eceba9fb552281f0c882fd68ef0c.1523402167.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 3/5] BaseTools: skip updating temporary variable. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 5dd24ffc8720..8adb2527c79f 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -256,12 +256,6 @@ class WorkspaceAutoGen(AutoGen): def _InitWorker(self, WorkspaceDir, ActivePlatform, Target, Toolchain,= ArchList, MetaFileDb, BuildConfig, ToolDefinition, FlashDefinitionFile=3D'', Fds= =3DNone, Fvs=3DNone, Caps=3DNone, SkuId=3D'', UniFlag=3DNone, Progress=3DNone, BuildModule=3DNone): - if Fds is None: - Fds =3D [] - if Fvs is None: - Fvs =3D [] - if Caps is None: - Caps =3D [] self.BuildDatabase =3D MetaFileDb self.MetaFile =3D ActivePlatform self.WorkspaceDir =3D WorkspaceDir @@ -276,9 +270,9 @@ class WorkspaceAutoGen(AutoGen): self.TargetTxt =3D BuildConfig self.ToolDef =3D ToolDefinition self.FdfFile =3D FlashDefinitionFile - self.FdTargetList =3D Fds - self.FvTargetList =3D Fvs - self.CapTargetList =3D Caps + self.FdTargetList =3D Fds if Fds else [] + self.FvTargetList =3D Fvs if Fvs else [] + self.CapTargetList =3D Caps if Caps else [] self.AutoGenObjectList =3D [] self._BuildDir =3D None self._FvDir =3D None --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 11:45:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523402259482717.9516848484056; Tue, 10 Apr 2018 16:17:39 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 96CB5226516BF; Tue, 10 Apr 2018 16:17:28 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2E20822618176 for ; Tue, 10 Apr 2018 16:17:27 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 16:17:26 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2018 16:17:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,434,1517904000"; d="scan'208";a="42343795" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 10 Apr 2018 16:17:23 -0700 Message-Id: <6349886e15f3085cc5636f73b1c85eeb55e9eb9d.1523402167.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 4/5] BaseTools: use set instead of list for a variable to be used with in X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 8adb2527c79f..57f1a0d8ba06 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1450,13 +1450,10 @@ class PlatformAutoGen(AutoGen): self._NonDynaPcdList_.remove (self._NonDynaPcdList= _[Index]) PcdFromModule.Pending =3D False self._NonDynaPcdList_.append (PcdFromModule) - # Parse the DynamicEx PCD from the AsBuild INF module list of FDF. - DscModuleList =3D [] - for ModuleInf in self.Platform.Modules.keys(): - DscModuleList.append (os.path.normpath(ModuleInf.Path)) + DscModuleSet =3D {os.path.normpath(ModuleInf.Path) for ModuleInf i= n self.Platform.Modules} # add the PCD from modules that listed in FDF but not in DSC to Da= tabase=20 for InfName in FdfModuleList: - if InfName not in DscModuleList: + if InfName not in DscModuleSet: InfClass =3D PathClass(InfName) M =3D self.BuildDatabase[InfClass, self.Arch, self.BuildTa= rget, self.ToolChain] # If a module INF in FDF but not in current arch's DSC mod= ule list, it must be module (either binary or source)=20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 11:45:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152340226224096.48244385995406; Tue, 10 Apr 2018 16:17:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BECBF2267F115; Tue, 10 Apr 2018 16:17:28 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5416B22618159 for ; Tue, 10 Apr 2018 16:17:27 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 16:17:26 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2018 16:17:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,434,1517904000"; d="scan'208";a="42343798" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 10 Apr 2018 16:17:24 -0700 Message-Id: <1edee333925ff9df02022a5b0541d9b66fc1c608.1523402167.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 5/5] BaseTools: reduce list usage when not needed X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" remove not needed lists. some were just counted and others should be sets. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenC.py | 48 +++++++++++--------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 58da9e6b1784..c11bbc5716f9 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -813,7 +813,7 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): # AutoGen for each PCD listed in a [PcdEx] section of a Module/Lib INF= file. # Auto generate a macro for each TokenName that takes a Guid pointer a= s a parameter. =20 # Use the Guid pointer to see if it matches any of the token space GUI= Ds. - TokenCNameList =3D [] + TokenCNameList =3D set() for TokenCName in ExTokenCNameList: if TokenCName in TokenCNameList: continue @@ -836,9 +836,9 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName)) if Index =3D=3D Count: AutoGenH.Append('0 \\\n )\n') - TokenCNameList.append(TokenCName) + TokenCNameList.add(TokenCName) =20 - TokenCNameList =3D [] + TokenCNameList =3D set() for TokenCName in ExTokenCNameList: if TokenCName in TokenCNameList: continue @@ -868,7 +868,7 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): # COMPAREGUID() will only be used if the Guid passed = in is local to the module. AutoGenH.Append('#define _PCD_TOKEN_EX_%s(GuidPtr) _= _PCD_%s_ADDR_CMP(GuidPtr) ? __PCD_%s_ADDR_CMP(GuidPtr) : __PCD_%s_VAL_CMP(G= uidPtr) \n' % (RealTokenCName, RealTokenCName, Rea= lTokenCName, RealTokenCName)) - TokenCNameList.append(TokenCName) + TokenCNameList.add(TokenCName) =20 def GetPcdSize(Pcd): if Pcd.DatumType not in _NumericDataTypesList: @@ -962,19 +962,22 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): SetModeStatusName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd= .DatumType] + '_S_' + TokenCName if Pcd.DatumType in gDatumSizeStringDataba= seH else '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH['VOID*'] + '_S_' + To= kenCName GetModeSizeName =3D '_PCD_GET_MODE_SIZE' + '_' + TokenCName =20 - PcdExCNameList =3D [] if Pcd.Type in gDynamicExPcd: if Info.IsLibrary: PcdList =3D Info.LibraryPcdList else: PcdList =3D Info.ModulePcdList + PcdExCNameTest =3D 0 for PcdModule in PcdList: - if PcdModule.Type in gDynamicExPcd: - PcdExCNameList.append(PcdModule.TokenCName) + if PcdModule.Type in gDynamicExPcd and Pcd.TokenCName =3D=3D P= cdModule.TokenCName: + PcdExCNameTest +=3D 1 + # get out early once we found > 1... + if PcdExCNameTest > 1: + break # Be compatible with the current code which using PcdToken and Pcd= Get/Set for DynamicEx Pcd. # If only PcdToken and PcdGet/Set used in all Pcds with different = CName, it should succeed to build. # If PcdToken and PcdGet/Set used in the Pcds with different Guids= but same CName, it should failed to build. - if PcdExCNameList.count(Pcd.TokenCName) > 1: + if PcdExCNameTest > 1: AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGe= t/Set are not allowed in the case that more than one DynamicEx Pcds are dif= ferent Guids but same CName.\n') AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTo= kenName)) AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (G= etModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) @@ -996,14 +999,14 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s,= (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdToke= nName)) AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s= , (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, = PcdTokenName)) elif Pcd.Type in gDynamicPcd: - PcdList =3D [] - PcdCNameList =3D [] - PcdList.extend(Info.LibraryPcdList) - PcdList.extend(Info.ModulePcdList) - for PcdModule in PcdList: - if PcdModule.Type in gDynamicPcd: - PcdCNameList.append(PcdModule.TokenCName) - if PcdCNameList.count(Pcd.TokenCName) > 1: + PcdCNameTest =3D 0 + for PcdModule in Info.LibraryPcdList + Info.ModulePcdList: + if PcdModule.Type in gDynamicPcd and Pcd.TokenCName =3D=3D Pcd= Module.TokenCName: + PcdCNameTest +=3D 1 + # get out early once we found > 1... + if PcdCNameTest > 1: + break + if PcdCNameTest > 1: EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic= Pcds [%s] are different Guids but same CName. They need to be changed to D= ynamicEx type to avoid the confliction.\n" % (TokenCName), ExtraData=3D"[%s= ]" % str(Info.MetaFile.Path)) else: AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName= , DatumSizeLib, PcdTokenName)) @@ -1265,7 +1268,6 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pc= d): Type =3D '(VOID *)' Array =3D '[]' PcdItemType =3D Pcd.Type - PcdExCNameList =3D [] if PcdItemType in gDynamicExPcd: PcdExTokenName =3D '_PCD_TOKEN_' + TokenSpaceGuidCName + '_' + Tok= enCName AutoGenH.Append('\n#define %s %dU\n' % (PcdExTokenName, TokenNumb= er)) @@ -1274,13 +1276,17 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, = Pcd): PcdList =3D Info.LibraryPcdList else: PcdList =3D Info.ModulePcdList + PcdExCNameTest =3D 0 for PcdModule in PcdList: - if PcdModule.Type in gDynamicExPcd: - PcdExCNameList.append(PcdModule.TokenCName) + if PcdModule.Type in gDynamicExPcd and Pcd.TokenCName =3D=3D P= cdModule.TokenCName: + PcdExCNameTest +=3D 1 + # get out early once we found > 1... + if PcdExCNameTest > 1: + break # Be compatible with the current code which using PcdGet/Set for D= ynamicEx Pcd. # If only PcdGet/Set used in all Pcds with different CName, it sho= uld succeed to build. # If PcdGet/Set used in the Pcds with different Guids but same CNa= me, it should failed to build. - if PcdExCNameList.count(Pcd.TokenCName) > 1: + if PcdExCNameTest > 1: AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGe= t/Set are not allowed in the case that more than one DynamicEx Pcds are dif= ferent Guids but same CName.\n') AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTo= kenName)) AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (G= etModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) @@ -1696,7 +1702,7 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH): AutoGenH.Append("\n// Definition of SkuId Array\n") AutoGenH.Append("extern UINT64 _gPcd_SkuId_Array[];\n") # Add extern declarations to AutoGen.h if one or more Token Space GUID= s were found - if TokenSpaceList <> []: =20 + if TokenSpaceList: AutoGenH.Append("\n// Definition of PCD Token Space GUIDs used in = this module\n\n") if Info.ModuleType in ["USER_DEFINED", "BASE"]: GuidType =3D "GUID" --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel