From nobody Sun Apr 28 15:55:39 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 1523652707290466.89304640798366; Fri, 13 Apr 2018 13:51:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id ED83C220E8CD7; Fri, 13 Apr 2018 13:51:42 -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 74788220E8CC6 for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:40 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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,446,1517904000"; d="scan'208";a="47729430" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:28 -0700 Message-Id: <38be6a3a18881cfd35bbadf6e7b1d2a6b7c9c2d1.1523652583.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/9] BaseTools: remove unused local 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" From: Jaben 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/Workspace/DscBuildData.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 6766f059b0f7..39ac73a04867 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -279,8 +279,6 @@ class DscBuildData(PlatformBuildClassObject): ## handle Override Path of Module def _HandleOverridePath(self): RecordList =3D self._RawData[MODEL_META_DATA_COMPONENT, self._Arch] - Macros =3D self._Macros - Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource for Record in RecordList: ModuleId =3D Record[6] LineNo =3D Record[7] --=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 Sun Apr 28 15:55:39 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 1523652711894790.3153751674154; Fri, 13 Apr 2018 13:51:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7C32D203C0054; Fri, 13 Apr 2018 13:51:43 -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 99B02220E8CC8 for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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,446,1517904000"; d="scan'208";a="47729433" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:29 -0700 Message-Id: <3fa9fab0776145bd78d28c244f111bbcfddf8979.1523652583.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 2/9] BaseTools: change DscBuildData functions without need for self to staticmethod 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" From: Jaben prepend functiosn with @staticmethod change calls to use class name, not self 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/Workspace/DscBuildData.py | 102 ++++++++++++------= -- 1 file changed, 64 insertions(+), 38 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 39ac73a04867..6177a964a1ad 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -650,14 +650,17 @@ class DscBuildData(PlatformBuildClassObject): if not IsValidWord(Record[1]): EdkLogger.error('build', FORMAT_INVALID, "The format o= f the Sku ID name is invalid. The correct format is '(a-zA-Z0-9_)(a-zA-Z0-9= _-.)*'", File=3Dself.MetaFile, Line=3DRecord[-1= ]) - self._SkuIds[Record[1].upper()] =3D (str(self.ToInt(Record= [0])), Record[1].upper(), Record[2].upper()) + self._SkuIds[Record[1].upper()] =3D (str(DscBuildData.ToIn= t(Record[0])), Record[1].upper(), Record[2].upper()) if 'DEFAULT' not in self._SkuIds: self._SkuIds['DEFAULT'] =3D ("0","DEFAULT","DEFAULT") if 'COMMON' not in self._SkuIds: self._SkuIds['COMMON'] =3D ("0","DEFAULT","DEFAULT") return self._SkuIds - def ToInt(self,intstr): + + @staticmethod + def ToInt(intstr): return int(intstr,16) if intstr.upper().startswith("0X") else int(= intstr) + def _GetDefaultStores(self): if self.DefaultStores is None: self.DefaultStores =3D OrderedDict() @@ -677,7 +680,7 @@ class DscBuildData(PlatformBuildClassObject): if not IsValidWord(Record[1]): EdkLogger.error('build', FORMAT_INVALID, "The format o= f the DefaultStores ID name is invalid. The correct format is '(a-zA-Z0-9_)= (a-zA-Z0-9_-.)*'", File=3Dself.MetaFile, Line=3DRecord[-1= ]) - self.DefaultStores[Record[1].upper()] =3D (self.ToInt(Reco= rd[0]),Record[1].upper()) + self.DefaultStores[Record[1].upper()] =3D (DscBuildData.To= Int(Record[0]),Record[1].upper()) if TAB_DEFAULT_STORES_DEFAULT not in self.DefaultStores: self.DefaultStores[TAB_DEFAULT_STORES_DEFAULT] =3D (0,TAB_= DEFAULT_STORES_DEFAULT) GlobalData.gDefaultStores =3D self.DefaultStores.keys() @@ -1034,9 +1037,9 @@ class DscBuildData(PlatformBuildClassObject): EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd %= s is not found in the DEC file." % (DisplayName)) pcdvalue =3D pcdvalue.replace("\\\\\\'", '\\\\\\"').replac= e('\\\'', '\'').replace('\\\\\\"', "\\'") if FieldName: - pcdvalue =3D self.HandleFlexiblePcd(TokenSpaceGuidCNam= e, TokenCName, pcdvalue, PcdDatumType, self._GuidDict, FieldName) + pcdvalue =3D DscBuildData.HandleFlexiblePcd(TokenSpace= GuidCName, TokenCName, pcdvalue, PcdDatumType, self._GuidDict, FieldName) else: - pcdvalue =3D self.HandleFlexiblePcd(TokenSpaceGuidCNam= e, TokenCName, pcdvalue, PcdDatumType, self._GuidDict) + pcdvalue =3D DscBuildData.HandleFlexiblePcd(TokenSpace= GuidCName, TokenCName, pcdvalue, PcdDatumType, self._GuidDict) IsValid, Cause =3D CheckPcdDatum(PcdDatumType, pcdvalu= e) if not IsValid: EdkLogger.error("build", FORMAT_INVALID, Cause, Ex= traData=3D"%s.%s" % (TokenSpaceGuidCName, TokenCName)) @@ -1050,7 +1053,8 @@ class DscBuildData(PlatformBuildClassObject): if (TokenSpaceGuidCName, TokenCName) =3D=3D (PcdIt= em.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName =3D=3D"": PcdItem.DefaultValue =3D pcdvalue =20 - def HandleFlexiblePcd(self, TokenSpaceGuidCName, TokenCName, PcdValue,= PcdDatumType, GuidDict, FieldName=3D''): + @staticmethod + def HandleFlexiblePcd(TokenSpaceGuidCName, TokenCName, PcdValue, PcdDa= tumType, GuidDict, FieldName=3D''): if FieldName: IsArray =3D False TokenCName +=3D '.' + FieldName @@ -1203,7 +1207,9 @@ class DscBuildData(PlatformBuildClassObject): structure_pcd_data[(item[0],item[1])].append(item) =20 return structure_pcd_data - def OverrideByFdfComm(self,StruPcds): + =20 + @staticmethod + def OverrideByFdfComm(StruPcds): StructurePcdInCom =3D OrderedDict() for item in GlobalData.BuildOptionPcd: if len(item) =3D=3D 5 and (item[1],item[0]) in StruPcds: @@ -1223,6 +1229,7 @@ class DscBuildData(PlatformBuildClassObject): Pcd.PcdFieldValueFromComm[field][1] =3D FieldValues[field]= [1][0] Pcd.PcdFieldValueFromComm[field][2] =3D FieldValues[field]= [1][1] return StruPcds + def OverrideByFdfCommOverAll(self,AllPcds): def CheckStructureInComm(commpcds): if not commpcds: @@ -1379,7 +1386,7 @@ class DscBuildData(PlatformBuildClassObject): if defaultstoreid not in stru_pcd.SkuOverrideValue= s[skuid]: stru_pcd.SkuOverrideValues[skuid][defaultstore= id] =3D copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstore= name]) stru_pcd.ValueChain[(skuid,defaultstoreid)]=3D= (nextskuid,mindefaultstorename) - S_pcd_set =3D self.OverrideByFdfComm(S_pcd_set) + S_pcd_set =3D DscBuildData.OverrideByFdfComm(S_pcd_set) Str_Pcd_Values =3D self.GenerateByteArrayValue(S_pcd_set) if Str_Pcd_Values: for (skuname,StoreName,PcdGuid,PcdName,PcdValue) in Str_Pcd_Va= lues: @@ -1551,7 +1558,8 @@ class DscBuildData(PlatformBuildClassObject): =20 return str(max([pcd_size for pcd_size in [get_length(item) for ite= m in sku_values]])) =20 - def ExecuteCommand (self, Command): + @staticmethod + def ExecuteCommand (Command): try: Process =3D subprocess.Popen(Command, stdout=3Dsubprocess.PIPE= , stderr=3Dsubprocess.PIPE, shell=3DTrue) except: @@ -1559,7 +1567,8 @@ class DscBuildData(PlatformBuildClassObject): Result =3D Process.communicate() return Process.returncode, Result[0], Result[1] =20 - def IntToCString(self, Value, ValueSize): + @staticmethod + def IntToCString(Value, ValueSize): Result =3D '"' if not isinstance (Value, str): for Index in range(0, ValueSize): @@ -1568,7 +1577,8 @@ class DscBuildData(PlatformBuildClassObject): Result =3D Result + '"' return Result =20 - def GetPcdMaxSize(self,Pcd): + @staticmethod + def GetPcdMaxSize(Pcd): MaxSize =3D int(Pcd.MaxDatumSize,10) if Pcd.MaxDatumSize else 0 if Pcd.DatumType not in ['BOOLEAN','UINT8','UINT16','UINT32','UINT= 64']: if Pcd.PcdValueFromComm: @@ -1589,6 +1599,7 @@ class DscBuildData(PlatformBuildClassObject): elif Pcd.DatumType =3D=3D 'UINT64': MaxSize =3D 8 return MaxSize + def GenerateSizeFunction(self,Pcd): CApp =3D "// Default Value in Dec \n" CApp =3D CApp + "void Cal_%s_%s_Size(UINT32 *Size){\n" % (Pcd.Toke= nSpaceGuidCName, Pcd.TokenCName) @@ -1671,13 +1682,16 @@ class DscBuildData(PlatformBuildClassObject): while '[' in FieldName: FieldName =3D FieldName.rsplit('[', 1)[0] CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d);= // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), Ar= rayIndex + 1, Pcd.PcdFieldValueFromComm[FieldName_ori][1], Pcd.PcdFieldValu= eFromComm[FieldName_ori][2], Pcd.PcdFieldValueFromComm[FieldName_ori][0]) - CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); // The Pcd= maxsize is %d \n" % (self.GetPcdMaxSize(Pcd),self.GetPcdMaxSize(Pcd),self.= GetPcdMaxSize(Pcd)) + CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); // The Pcd= maxsize is %d \n" % (DscBuildData.GetPcdMaxSize(Pcd),DscBuildData.GetPcdMa= xSize(Pcd),DscBuildData.GetPcdMaxSize(Pcd)) CApp =3D CApp + "}\n" return CApp - def GenerateSizeStatments(self,Pcd): + =20 + @staticmethod + def GenerateSizeStatments(Pcd): CApp =3D ' Size =3D sizeof(%s);\n' % (Pcd.DatumType) CApp =3D CApp + ' Cal_%s_%s_Size(&Size);\n' % (Pcd.TokenSpaceGuid= CName, Pcd.TokenCName) return CApp + def GenerateDefaultValueAssignFunction(self,Pcd): CApp =3D "// Default value in Dec \n" CApp =3D CApp + "void Assign_%s_%s_Default_Value(%s *Pcd){\n" % (P= cd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType) @@ -1699,7 +1713,7 @@ class DscBuildData(PlatformBuildClassObject): # # Use memcpy() to copy value into field # - CApp =3D CApp + ' Value =3D %s; // From DEC Default Value= %s\n' % (self.IntToCString(Value, ValueSize), Pcd.DefaultValueFromDec) + CApp =3D CApp + ' Value =3D %s; // From DEC Default Value= %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DefaultValueFrom= Dec) CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (ValueSize) for FieldList in [Pcd.DefaultValues]: if not FieldList: @@ -1724,7 +1738,7 @@ class DscBuildData(PlatformBuildClassObject): # Use memcpy() to copy value into field # CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, %s);= \n' % (Pcd.DatumType, FieldName) - CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (self.IntToCString(Value, ValueSize), FieldList[FieldName][= 1], FieldList[FieldName][2], FieldList[FieldName][0]) + CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList[Fie= ldName][1], FieldList[FieldName][2], FieldList[FieldName][0]) CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (FieldSize= > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, Valu= eSize) else: if ValueSize > 4: @@ -1733,9 +1747,12 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' Pcd->%s =3D %d; // From %s Line= %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[Fie= ldName][2], FieldList[FieldName][0]) CApp =3D CApp + "}\n" return CApp - def GenerateDefaultValueAssignStatement(self,Pcd): + =20 + @staticmethod + def GenerateDefaultValueAssignStatement(Pcd): CApp =3D ' Assign_%s_%s_Default_Value(Pcd);\n' % (Pcd.TokenSpaceG= uidCName, Pcd.TokenCName) return CApp + def GenerateInitValueFunction(self,Pcd,SkuName,DefaultStoreName): CApp =3D "// Value in Dsc for Sku: %s, DefaultStore %s\n" % (SkuNa= me,DefaultStoreName) CApp =3D CApp + "void Assign_%s_%s_%s_%s_Value(%s *Pcd){\n" % (Pcd= .TokenSpaceGuidCName, Pcd.TokenCName,SkuName,DefaultStoreName,Pcd.DatumType) @@ -1771,7 +1788,7 @@ class DscBuildData(PlatformBuildClassObject): # # 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' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.Defa= ultFromDSC.get('DEFAULT',{}).get('STANDARD', Pcd.DefaultValue) if Pcd.Defau= ltFromDSC else Pcd.DefaultValue) CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (= ValueSize) else: if isinstance(Value, str): @@ -1780,7 +1797,7 @@ class DscBuildData(PlatformBuildClassObject): # # 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.DscRawValue.= get(SkuName,{}).get(DefaultStoreName)) + CApp =3D CApp + ' Value =3D %s; // From DSC D= efault Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DscR= awValue.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 )): @@ -1803,7 +1820,7 @@ class DscBuildData(PlatformBuildClassObject): # Use memcpy() to copy value into field # CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, = %s);\n' % (Pcd.DatumType, FieldName) - CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (self.IntToCString(Value, ValueSize), FieldList[FieldNa= me][1], FieldList[FieldName][2], FieldList[FieldName][0]) + CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList= [FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0]) CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (Field= Size > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, = ValueSize) else: if ValueSize > 4: @@ -1812,9 +1829,12 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' Pcd->%s =3D %d; // From %s = Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList= [FieldName][2], FieldList[FieldName][0]) CApp =3D CApp + "}\n" return CApp - def GenerateInitValueStatement(self,Pcd,SkuName,DefaultStoreName): + =20 + @staticmethod + def GenerateInitValueStatement(Pcd,SkuName,DefaultStoreName): CApp =3D ' Assign_%s_%s_%s_%s_Value(Pcd);\n' % (Pcd.TokenSpaceGui= dCName, Pcd.TokenCName,SkuName,DefaultStoreName) return CApp + def GenerateCommandLineValue(self,Pcd): CApp =3D "// Value in CommandLine\n" CApp =3D CApp + "void Assign_%s_%s_CommandLine_Value(%s *Pcd){\n" = % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType) @@ -1841,7 +1861,7 @@ class DscBuildData(PlatformBuildClassObject): # # Use memcpy() to copy value into field # - CApp =3D CApp + ' Value =3D %s; // From Command L= ine.\n' % (self.IntToCString(Value, ValueSize)) + CApp =3D CApp + ' Value =3D %s; // From Command L= ine.\n' % (DscBuildData.IntToCString(Value, ValueSize)) CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (Valu= eSize) continue for FieldName in FieldList: @@ -1865,7 +1885,7 @@ class DscBuildData(PlatformBuildClassObject): # Use memcpy() to copy value into field # CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, %s);= \n' % (Pcd.DatumType, FieldName) - CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (self.IntToCString(Value, ValueSize), FieldList[FieldName][= 1], FieldList[FieldName][2], FieldList[FieldName][0]) + CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList[Fie= ldName][1], FieldList[FieldName][2], FieldList[FieldName][0]) CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (FieldSize= > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, Valu= eSize) else: if ValueSize > 4: @@ -1874,9 +1894,12 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' Pcd->%s =3D %d; // From %s Line= %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[Fie= ldName][2], FieldList[FieldName][0]) CApp =3D CApp + "}\n" return CApp - def GenerateCommandLineValueStatement(self,Pcd): + =20 + @staticmethod + def GenerateCommandLineValueStatement(Pcd): CApp =3D ' Assign_%s_%s_CommandLine_Value(Pcd);\n' % (Pcd.TokenSp= aceGuidCName, Pcd.TokenCName) return CApp + def GenerateInitializeFunc(self, SkuName, DefaultStore, Pcd, InitByteV= alue, CApp): OverrideValues =3D {DefaultStore:""} if Pcd.SkuOverrideValues: @@ -1916,7 +1939,7 @@ class DscBuildData(PlatformBuildClassObject): # in a structure. The size formula for this case is: # OFFSET_OF(FlexbleArrayField) + sizeof(FlexibleArray[0]) * (H= ighestIndex + 1) # - CApp =3D CApp + self.GenerateSizeStatments(Pcd) + CApp =3D CApp + DscBuildData.GenerateSizeStatments(Pcd) =20 # # Allocate and zero buffer for the PCD @@ -1935,20 +1958,20 @@ class DscBuildData(PlatformBuildClassObject): # # Assign field values in PCD # - CApp =3D CApp + self.GenerateDefaultValueAssignStatement(Pcd) + CApp =3D CApp + DscBuildData.GenerateDefaultValueAssignStateme= nt(Pcd) 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] for defaultstorenameitem in storeset: CApp =3D CApp + "// SkuName: %s, DefaultStoreName= : %s \n" % (skuname, defaultstorenameitem) - CApp =3D CApp + self.GenerateInitValueStatement(Pc= d,skuname,defaultstorenameitem) + CApp =3D CApp + DscBuildData.GenerateInitValueStat= ement(Pcd,skuname,defaultstorenameitem) if skuname =3D=3D SkuName: 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.GenerateCommandLineValueStatement(Pcd) + CApp =3D CApp + DscBuildData.GenerateInitValueStatement(Pc= d,self.SkuIdMgr.SystemSkuId,"STANDARD") + CApp =3D CApp + DscBuildData.GenerateCommandLineValueStatement= (Pcd) # # Set new PCD value and size # @@ -2143,11 +2166,11 @@ class DscBuildData(PlatformBuildClassObject): Messages =3D '' if sys.platform =3D=3D "win32": MakeCommand =3D 'nmake -f %s' % (MakeFileName) - returncode, StdOut, StdErr =3D self.ExecuteCommand (MakeComman= d) + returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Ma= keCommand) Messages =3D StdOut else: MakeCommand =3D 'make -f %s' % (MakeFileName) - returncode, StdOut, StdErr =3D self.ExecuteCommand (MakeComman= d) + returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Ma= keCommand) Messages =3D StdErr Messages =3D Messages.split('\n') MessageGroup =3D [] @@ -2193,9 +2216,9 @@ class DscBuildData(PlatformBuildClassObject): else: EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute= command: %s' % MakeCommand) =20 - if self.NeedUpdateOutput(OutputValueFile, PcdValueInitExe ,InputVa= lueFile): + if DscBuildData.NeedUpdateOutput(OutputValueFile, PcdValueInitExe = ,InputValueFile): Command =3D PcdValueInitExe + ' -i %s -o %s' % (InputValueFile= , OutputValueFile) - returncode, StdOut, StdErr =3D self.ExecuteCommand (Command) + returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Co= mmand) if returncode <> 0: EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect = output from command: %s' % Command) =20 @@ -2210,7 +2233,8 @@ class DscBuildData(PlatformBuildClassObject): StructurePcdSet.append((PcdInfo[0],PcdInfo[1], PcdInfo[2], Pcd= Info[3], PcdValue[2].strip())) return StructurePcdSet =20 - def NeedUpdateOutput(self,OutputFile, ValueCFile, StructureInput): + @staticmethod + def NeedUpdateOutput(OutputFile, ValueCFile, StructureInput): if not os.path.exists(OutputFile): return True if os.stat(OutputFile).st_mtime <=3D os.stat(ValueCFile).st_mtime: @@ -2320,8 +2344,8 @@ class DscBuildData(PlatformBuildClassObject): =20 return PcdObj =20 - - def CompareVarAttr(self, Attr1, Attr2): + @staticmethod + def CompareVarAttr(Attr1, Attr2): if not Attr1 or not Attr2: # for empty string return True Attr1s =3D [attr.strip() for attr in Attr1.split(",")] @@ -2332,6 +2356,7 @@ class DscBuildData(PlatformBuildClassObject): return True else: return False + def CopyDscRawValue(self,Pcd): if Pcd.DscRawValue is None: Pcd.DscRawValue =3D dict() @@ -2459,7 +2484,7 @@ class DscBuildData(PlatformBuildClassObject): if (VariableName, VariableGuid) not in VariableAttrs: VariableAttrs[(VariableName, VariableGuid)] =3D VarAttribu= te else: - if not self.CompareVarAttr(VariableAttrs[(VariableName, Va= riableGuid)], VarAttribute): + if not DscBuildData.CompareVarAttr(VariableAttrs[(Variable= Name, VariableGuid)], VarAttribute): EdkLogger.error('Build', PCD_VARIABLE_ATTRIBUTES_CONFL= ICT_ERROR, "The variable %s.%s for DynamicHii PCDs has conflicting attribut= es [%s] and [%s] " % (VariableGuid, VariableName, VarAttribute, VariableAtt= rs[(VariableName, VariableGuid)])) =20 pcdDecObject =3D self._DecPcds[PcdCName, TokenSpaceGuid] @@ -2526,7 +2551,7 @@ class DscBuildData(PlatformBuildClassObject): skuobj.DefaultStoreDict[defaultst] =3D StringToArr= ay(skuobj.DefaultStoreDict[defaultst]) pcd.DefaultValue =3D StringToArray(pcd.DefaultValue) pcd.MaxDatumSize =3D str(MaxSize) - rt, invalidhii =3D self.CheckVariableNameAssignment(Pcds) + rt, invalidhii =3D DscBuildData.CheckVariableNameAssignment(Pcds) if not rt: invalidpcd =3D ",".join(invalidhii) EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR, Message=3D'T= he same HII PCD must map to the same EFI variable for all SKUs', File=3Dsel= f.MetaFile, ExtraData=3Dinvalidpcd) @@ -2535,7 +2560,8 @@ class DscBuildData(PlatformBuildClassObject): =20 return Pcds =20 - def CheckVariableNameAssignment(self,Pcds): + @staticmethod + def CheckVariableNameAssignment(Pcds): invalidhii =3D [] for pcdname in Pcds: pcd =3D Pcds[pcdname] --=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 Sun Apr 28 15:55:39 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 1523652719765671.5989326708195; Fri, 13 Apr 2018 13:51:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 07F8D226EAC71; Fri, 13 Apr 2018 13:51:44 -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 D5435220E8CC9 for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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,446,1517904000"; d="scan'208";a="47729436" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:30 -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 3/9] BaseTools: Remove unused functions from DscBuildData 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" From: Jaben 3 functions were never called: _dumpPcdInfo __STRING2OCTList __UNICODE2OCTList 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/Workspace/DscBuildData.py | 31 -------------------- 1 file changed, 31 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 6177a964a1ad..ea001eef0281 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1145,17 +1145,6 @@ class DscBuildData(PlatformBuildClassObject): self.RecoverCommandLinePcd() return self._Pcds =20 - def _dumpPcdInfo(self,Pcds): - for pcd in Pcds: - pcdobj =3D Pcds[pcd] - if not pcdobj.TokenCName.startswith("Test"): - continue - for skuid in pcdobj.SkuInfoList: - if pcdobj.Type in (self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMI= C_HII],self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]): - for storename in pcdobj.SkuInfoList[skuid].DefaultStor= eDict: - print "PcdCName: %s, SkuName: %s, StoreName: %s, V= alue: %s" % (".".join((pcdobj.TokenSpaceGuidCName, pcdobj.TokenCName)), sku= id,storename,str(pcdobj.SkuInfoList[skuid].DefaultStoreDict[storename])) - else: - print "PcdCName: %s, SkuName: %s, Value: %s" % (".".jo= in((pcdobj.TokenSpaceGuidCName, pcdobj.TokenCName)), skuid,str(pcdobj.SkuIn= foList[skuid].DefaultValue)) ## Retrieve [BuildOptions] def _GetBuildOptions(self): if self._BuildOptions is None: @@ -1514,26 +1503,6 @@ class DscBuildData(PlatformBuildClassObject): =20 return Pcds =20 - def __UNICODE2OCTList(self,Value): - Value =3D Value.strip() - Value =3D Value[2:-1] - List =3D [] - for Item in Value: - Temp =3D '%04X' % ord(Item) - List.append('0x' + Temp[2:4]) - List.append('0x' + Temp[0:2]) - List.append('0x00') - List.append('0x00') - return List - def __STRING2OCTList(self,Value): - OCTList =3D [] - Value =3D Value.strip('"') - for char in Value: - Temp =3D '%02X' % ord(char) - OCTList.append('0x' + Temp) - OCTList.append('0x00') - return OCTList - def GetStructurePcdMaxSize(self, str_pcd): pcd_default_value =3D str_pcd.DefaultValue sku_values =3D [skuobj.HiiDefaultValue if str_pcd.Type in [self._P= CD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DY= NAMIC_EX_HII]] else skuobj.DefaultValue for skuobj in str_pcd.SkuInfoList.v= alues()] --=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 Sun Apr 28 15:55:39 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 1523652707027646.4220335150525; Fri, 13 Apr 2018 13:51:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2105F220E8CDB; Fri, 13 Apr 2018 13:51:43 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 9ADB1220E8CC9 for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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=134.134.136.126; helo=mga18.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,446,1517904000"; d="scan'208";a="47729439" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:31 -0700 Message-Id: <97f8837d02ec5a17dceda6ac7393d22819cd087a.1523652583.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/9] BaseTools: move RegEx compile out of loops 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" From: Jaben 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/Workspace/DscBuildData.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index ea001eef0281..fb0def46f331 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -95,6 +95,9 @@ MAKEROOT ?=3D $(EDK_TOOLS_PATH)/Source/C LIBS =3D -lCommon ''' =20 +## regular expressions for finding decimal and hex numbers +Pattern =3D re.compile('^[1-9]\d*|0$') +HexPattern =3D re.compile(r'0[xX][0-9a-fA-F]+$') ## Regular expression for finding header file inclusions from AutoGen.GenMake import gIncludePattern =20 @@ -642,9 +645,7 @@ class DscBuildData(PlatformBuildClassObject): if Record[1] in [None, '']: EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID na= me', File=3Dself.MetaFile, Line=3DRecord[-1= ]) - Pattern =3D re.compile('^[1-9]\d*|0$') - HexPattern =3D re.compile(r'0[xX][0-9a-fA-F]+$') - if Pattern.match(Record[0]) is None and HexPattern.match(R= ecord[0]) is None: + if not Pattern.match(Record[0]) and not HexPattern.match(R= ecord[0]): EdkLogger.error('build', FORMAT_INVALID, "The format o= f the Sku ID number is invalid. It only support Integer and HexNumber", File=3Dself.MetaFile, Line=3DRecord[-1= ]) if not IsValidWord(Record[1]): @@ -672,9 +673,7 @@ class DscBuildData(PlatformBuildClassObject): if Record[1] in [None, '']: EdkLogger.error('build', FORMAT_INVALID, 'No DefaultSt= ores ID name', File=3Dself.MetaFile, Line=3DRecord[-1= ]) - Pattern =3D re.compile('^[1-9]\d*|0$') - HexPattern =3D re.compile(r'0[xX][0-9a-fA-F]+$') - if Pattern.match(Record[0]) is None and HexPattern.match(R= ecord[0]) is None: + if not Pattern.match(Record[0]) and not HexPattern.match(R= ecord[0]): EdkLogger.error('build', FORMAT_INVALID, "The format o= f the DefaultStores ID number is invalid. It only support Integer and HexNu= mber", File=3Dself.MetaFile, Line=3DRecord[-1= ]) if not IsValidWord(Record[1]): --=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 Sun Apr 28 15:55:39 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 15236527221121013.386240525805; Fri, 13 Apr 2018 13:52:02 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 33E6C22729617; Fri, 13 Apr 2018 13:51:44 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 E8AAA220E8CD2 for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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=134.134.136.126; helo=mga18.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,446,1517904000"; d="scan'208";a="47729441" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:32 -0700 Message-Id: <99eece92dc0492b3241b25d375301aa3eeb8b475.1523652584.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/9] BaseTools: use dictionary.get() when we have value if not found 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" From: Jaben 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/build/build.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 6fb2e0ed3d09..ede963bc231a 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1604,9 +1604,7 @@ class Build(): SmmModuleList[Module.MetaFile] =3D ImageInfo SmmSize +=3D ImageInfo.Image.Size if Module.ModuleType =3D=3D 'DXE_SMM_DRIVER': - PiSpecVersion =3D '0x00000000' - if 'PI_SPECIFICATION_VERSION' in Module.Module= .Specification: - PiSpecVersion =3D Module.Module.Specificat= ion['PI_SPECIFICATION_VERSION'] + PiSpecVersion =3D Module.Module.Specification.= get('PI_SPECIFICATION_VERSION', '0x00000000') # for PI specification < PI1.1, DXE_SMM_DRIVER= also runs as BOOT time driver. if int(PiSpecVersion, 16) < 0x0001000A: BtModuleList[Module.MetaFile] =3D ImageInfo --=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 Sun Apr 28 15:55:39 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 1523652717232448.1340453642408; Fri, 13 Apr 2018 13:51:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CF9A4203C005C; Fri, 13 Apr 2018 13:51:43 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 DBDE8220E8CD0 for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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=134.134.136.126; helo=mga18.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,446,1517904000"; d="scan'208";a="47729444" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:33 -0700 Message-Id: <4461066fd603e3dc8eb1c16538da6a93d40606bf.1523652584.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 6/9] BaseTools: refactor DepexSection.GenSection 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" From: Jaben change default parameter value to None since the parameter isn't used. remove temporary dictionary and just do the reaplce call. 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/GenFds/DepexSection.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/DepexSection.py b/BaseTools/Sou= rce/Python/GenFds/DepexSection.py index ef30a2f083c6..4ed1aa779292 100644 --- a/BaseTools/Source/Python/GenFds/DepexSection.py +++ b/BaseTools/Source/Python/GenFds/DepexSection.py @@ -1,7 +1,7 @@ ## @file # process depex section generation # -# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -76,12 +76,10 @@ class DepexSection (DepexSectionClassObject): # @param Dict dictionary contains macro and its value # @retval tuple (Generated file name list, section alignment) # - def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, Ff= sFile =3D None, Dict =3D {}, IsMakefile =3D False): - =20 + def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, Ff= sFile =3D None, Dict =3D None, IsMakefile =3D False): if self.ExpressionProcessed =3D=3D False: self.Expression =3D self.Expression.replace("\n", " ").replace= ("\r", " ") ExpList =3D self.Expression.split() - ExpGuidDict =3D {} =20 for Exp in ExpList: if Exp.upper() not in ('AND', 'OR', 'NOT', 'TRUE', 'FALSE'= , 'SOR', 'BEFORE', 'AFTER', 'END'): @@ -90,10 +88,7 @@ class DepexSection (DepexSectionClassObject): EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE, "Depex GUID %s could not be found = in build DB! (ModuleName: %s)" % (Exp, ModuleName)) =20 - ExpGuidDict[Exp] =3D GuidStr - - for Item in ExpGuidDict: - self.Expression =3D self.Expression.replace(Item, ExpGuidD= ict[Item]) + self.Expression =3D self.Expression.replace(Exp, GuidS= tr) =20 self.Expression =3D self.Expression.strip() self.ExpressionProcessed =3D True @@ -120,5 +115,4 @@ class DepexSection (DepexSectionClassObject): OutputFile =3D os.path.normpath(OutputFile) =20 GenFdsGlobalVariable.GenerateSection(OutputFile, [InputFile], Sect= ion.Section.SectionType.get (SecType), IsMakefile=3DIsMakefile) - FileList =3D [OutputFile] - return FileList, self.Alignment + return [OutputFile], self.Alignment --=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 Sun Apr 28 15:55:39 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 1523652724582174.42950167539675; Fri, 13 Apr 2018 13:52:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5F0C92272962B; Fri, 13 Apr 2018 13:51:44 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 0A2DD220E8CA6 for ; Fri, 13 Apr 2018 13:51:42 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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=134.134.136.126; helo=mga18.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,446,1517904000"; d="scan'208";a="47729447" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:34 -0700 Message-Id: <7587b13b00c7a731ddcb67623af606199179e2be.1523652584.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 7/9] BaseTools: FdfParser refactor to remove a dictionary 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" From: Jaben __GetInfStatement() does not use the dict parameter, so remove it from the API and from all callers. 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/GenFds/FdfParser.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 0427b80b2460..662c232c86e4 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -2158,7 +2158,7 @@ class FdfParser: self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy()) =20 while True: - isInf =3D self.__GetInfStatement(FvObj, MacroDict =3D FvObj.De= fineVarDict.copy()) + isInf =3D self.__GetInfStatement(FvObj) isFile =3D self.__GetFileStatement(FvObj, MacroDict =3D FvObj.= DefineVarDict.copy()) if not isInf and not isFile: break @@ -2423,7 +2423,7 @@ class FdfParser: MacroDict.update(AprSectionObj.DefineVarDict) =20 while True: - IsInf =3D self.__GetInfStatement( AprSectionObj, MacroDict =3D= MacroDict) + IsInf =3D self.__GetInfStatement(AprSectionObj) IsFile =3D self.__GetFileStatement( AprSectionObj) if not IsInf and not IsFile: break @@ -2486,11 +2486,10 @@ class FdfParser: # # @param self The object pointer # @param Obj for whom inf statement is got - # @param MacroDict dictionary used to replace macro # @retval True Successfully find inf statement # @retval False Not able to find inf statement # - def __GetInfStatement(self, Obj, ForCapsule=3DFalse, MacroDict=3D{}): + def __GetInfStatement(self, Obj, ForCapsule=3DFalse): ffsInf =3D self.__ParseInfStatement() if not ffsInf: return False @@ -2926,7 +2925,7 @@ class FdfParser: self.__GetAprioriSection(FvObj, MacroDict.copy()) =20 while True: - IsInf =3D self.__GetInfStatement(FvObj, MacroDict.copy= ()) + IsInf =3D self.__GetInfStatement(FvObj) IsFile =3D self.__GetFileStatement(FvObj, MacroDict.co= py()) if not IsInf and not IsFile: break --=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 Sun Apr 28 15:55:39 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 152365271467063.30516755381632; Fri, 13 Apr 2018 13:51:54 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A6F1B203C0058; Fri, 13 Apr 2018 13:51:43 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 C5F9A220E8CCF for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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=134.134.136.126; helo=mga18.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,446,1517904000"; d="scan'208";a="47729451" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:35 -0700 Message-Id: <88f706cc2b907abdebee4396c4d6868bbc333d6b.1523652584.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 8/9] BaseTools: FdfParser - refactor functions to make static 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" From: Jaben make functions that doesn't use self into @staticmethod 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/GenFds/FdfParser.py | 11 ++++++----- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 662c232c86e4..dce41701a510 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1131,7 +1131,8 @@ class FdfParser: self.__UndoToken() return False =20 - def __Verify(self, Name, Value, Scope): + @staticmethod + def __Verify(Name, Value, Scope): if Scope in ['UINT64', 'UINT8']: ValueNumber =3D 0 try: @@ -3200,16 +3201,16 @@ class FdfParser: raise Warning("expected value of %s" % Name, self.File= Name, self.CurrentLineNumber) Value =3D self.__Token if Name =3D=3D 'IMAGE_HEADER_INIT_VERSION': - if self.__Verify(Name, Value, 'UINT8'): + if FdfParser.__Verify(Name, Value, 'UINT8'): FmpData.Version =3D Value elif Name =3D=3D 'IMAGE_INDEX': - if self.__Verify(Name, Value, 'UINT8'): + if FdfParser.__Verify(Name, Value, 'UINT8'): FmpData.ImageIndex =3D Value elif Name =3D=3D 'HARDWARE_INSTANCE': - if self.__Verify(Name, Value, 'UINT8'): + if FdfParser.__Verify(Name, Value, 'UINT8'): FmpData.HardwareInstance =3D Value elif Name =3D=3D 'MONOTONIC_COUNT': - if self.__Verify(Name, Value, 'UINT64'): + if FdfParser.__Verify(Name, Value, 'UINT64'): FmpData.MonotonicCount =3D Value if FmpData.MonotonicCount.upper().startswith('0X'): FmpData.MonotonicCount =3D (long)(FmpData.Mono= tonicCount, 16) diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/= Source/Python/GenFds/FfsInfStatement.py index 5364569b96d7..4f9936a97342 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -1011,7 +1011,7 @@ class FfsInfStatement(FfsInfStatementClassObject): if VfrUniOffsetList: UniVfrOffsetFileName =3D os.path.join(self.Out= putPath, self.BaseName + '.offset') UniVfrOffsetFileSection =3D os.path.join(self.= OutputPath, self.BaseName + 'Offset' + '.raw') - self.__GenUniVfrOffsetFile (VfrUniOffsetList, = UniVfrOffsetFileName) + FfsInfStatement.__GenUniVfrOffsetFile (VfrUniO= ffsetList, UniVfrOffsetFileName) UniVfrOffsetFileNameList =3D [] UniVfrOffsetFileNameList.append(UniVfrOffsetFi= leName) """Call GenSection""" @@ -1069,11 +1069,11 @@ class FfsInfStatement(FfsInfStatementClassObject): # # Create parameter string for GenFfs # - # @param self The object pointer # @param Rule The rule object used to generate section # @retval tuple (FileType, Fixed, CheckSum, Alignment) # - def __GetGenFfsCmdParameter__(self, Rule): + @staticmethod + def __GetGenFfsCmdParameter__(Rule): result =3D tuple() result +=3D ('-t', Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType= ]) if Rule.Fixed !=3D False: @@ -1103,11 +1103,11 @@ class FfsInfStatement(FfsInfStatementClassObject): # # Generate the offset file for the module which contain VFR or UNI f= ile. # - # @param self The object pointer # @param VfrUniOffsetList A list contain the VFR/UNI offsets= in the EFI image file. # @param UniVfrOffsetFileName The output offset file name. # - def __GenUniVfrOffsetFile(self, VfrUniOffsetList, UniVfrOffsetFileName= ): + @staticmethod + def __GenUniVfrOffsetFile(VfrUniOffsetList, UniVfrOffsetFileName): =20 # Use a instance of StringIO to cache data fStringIO =3D StringIO.StringIO('') =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 Sun Apr 28 15:55:39 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 1523652709370974.7888608710857; Fri, 13 Apr 2018 13:51:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 527D0220E8CDF; Fri, 13 Apr 2018 13:51:43 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 B0234220E8CCC for ; Fri, 13 Apr 2018 13:51:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 13:51:41 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2018 13:51:40 -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=134.134.136.126; helo=mga18.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,446,1517904000"; d="scan'208";a="47729453" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 13:51:36 -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 9/9] BaseTools: FfsInfStatement - remove unused function 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" From: Jaben 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/GenFds/FfsInfStatement.py | 21 -------------------- 1 file changed, 21 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/= Source/Python/GenFds/FfsInfStatement.py index 4f9936a97342..8ae29b285d06 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -1065,27 +1065,6 @@ class FfsInfStatement(FfsInfStatementClassObject): ) return FfsOutput =20 - ## __GetGenFfsCmdParameter__() method - # - # Create parameter string for GenFfs - # - # @param Rule The rule object used to generate section - # @retval tuple (FileType, Fixed, CheckSum, Alignment) - # - @staticmethod - def __GetGenFfsCmdParameter__(Rule): - result =3D tuple() - result +=3D ('-t', Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType= ]) - if Rule.Fixed !=3D False: - result +=3D ('-x',) - if Rule.CheckSum !=3D False: - result +=3D ('-s',) - - if Rule.Alignment is not None and Rule.Alignment !=3D '': - result +=3D ('-a', Rule.Alignment) - - return result -=20 ## __GetBuildOutputMapFileVfrUniInfo() method # # Find the offset of UNI/INF object offset in the EFI image file. --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel