From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 3FBE82034A8AB for ; Tue, 23 Jan 2018 00:48:01 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 00:53:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,400,1511856000"; d="scan'208";a="195548990" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 23 Jan 2018 00:53:27 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Jan 2018 00:53:24 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Tue, 23 Jan 2018 16:53:22 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name Thread-Index: AQHTk/soeK8ir3wJUE+UMQ8uGaPYtaOBJxKA Date: Tue, 23 Jan 2018 08:53:22 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1AB03F@SHSMSX104.ccr.corp.intel.com> References: <20180123033445.13468-1-bob.c.feng@intel.com> In-Reply-To: <20180123033445.13468-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 08:48:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Bob: Patch title is < 80. Please move the information in the commit message.=20 >-----Original Message----- >From: Feng, Bob C >Sent: Tuesday, January 23, 2018 11:35 AM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTools: Fixed some small issues 1. The structure pcd >default value should use the default value under sku. 2. Incorrect VpdOffs= et >value for those un-used in module Vpd 3. Add a checkpoint for Structure Pc= d >Name > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- > BaseTools/Source/Python/Workspace/DscBuildData.py | 7 +++++-- > BaseTools/Source/Python/Workspace/MetaFileParser.py | 3 +++ > 3 files changed, 10 insertions(+), 4 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index 604d38a4d6..ce8bc64ca5 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -1749,12 +1749,12 @@ class PlatformAutoGen(AutoGen): > DefaultSku =3D DscPcdEntry.SkuInfoList.get('D= EFAULT') > if DefaultSku: > PcdValue =3D DefaultSku.DefaultValue > if PcdValue not in SkuValueMap: > SkuValueMap[PcdValue] =3D [] >- VpdFile.Add(DscPcdEntry, 'DEFAULT',Sk= u.VpdOffset) >- SkuValueMap[PcdValue].append(Sku) >+ VpdFile.Add(DscPcdEntry, >'DEFAULT',DefaultSku.VpdOffset) >+ SkuValueMap[PcdValue].append(DefaultSku) > for (SkuName,Sku) in DscPcdEntry.SkuInfoList.= items(): > Sku.VpdOffset =3D Sku.VpdOffset.strip() > > # Need to iterate DEC pcd information to = get the value & >datumtype > for eachDec in self.PackageList: >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py >b/BaseTools/Source/Python/Workspace/DscBuildData.py >index 60aa4868ed..6e4f8ac390 100644 >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py >@@ -1287,12 +1287,15 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D CApp + ' UINT32 OriginalSize;\n' > CApp =3D CApp + ' VOID *OriginalPcd;\n' > CApp =3D CApp + ' %s *Pcd; // From %s Line %d \n' % (P= cd.DatumType, >Pcd.PkgPath, Pcd.PcdDefineLineNo) > CApp =3D CApp + '\n' > >- Pcd.DefaultValue =3D Pcd.DefaultValue.strip() >- PcdDefaultValue =3D StringToArray(Pcd.DefaultValue) >+ if SkuName in Pcd.SkuInfoList: >+ DefaultValue =3D >Pcd.SkuInfoList[SkuName].DefaultStoreDict.get(DefaultStoreName,Pcd.SkuIn >foList[SkuName].HiiDefaultValue) if >Pcd.SkuInfoList[SkuName].HiiDefaultValue else >Pcd.SkuInfoList[SkuName].DefaultValue >+ else: >+ DefaultValue =3D Pcd.DefaultValue >+ PcdDefaultValue =3D StringToArray(DefaultValue.strip()) > > InitByteValue +=3D '%s.%s.%s.%s|%s|%s\n' % (SkuName, >DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, >Pcd.DatumType, PcdDefaultValue) > > # > # Get current PCD value and size >diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py >b/BaseTools/Source/Python/Workspace/MetaFileParser.py >index 7469cd7ab7..f404db7b7a 100644 >--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py >+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py >@@ -1915,10 +1915,13 @@ class DecParser(MetaFileParser): > PcdTockens =3D self._CurrentLine.split(TAB_VALUE_SPLIT) > PcdNames =3D PcdTockens[0].split(TAB_SPLIT) > if len(PcdNames) =3D=3D 2: > self._CurrentStructurePcdName =3D "" > else: >+ if self._CurrentStructurePcdName !=3D >TAB_SPLIT.join(PcdNames[:2]): >+ EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Na= me does >not match: %s and %s " % (self._CurrentStructurePcdName , >TAB_SPLIT.join(PcdNames[:2])), >+ File=3Dself.MetaFile, Line=3Dself._LineIn= dex + 1) > self._ValueList[1] =3D TAB_SPLIT.join(PcdNames[2:]) > self._ValueList[2] =3D PcdTockens[1] > if not self._CurrentStructurePcdName: > TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_= SPLIT, 1) > self._ValueList[0:1] =3D GetSplitValueList(TokenList[0], TAB_= SPLIT) >-- >2.14.3.windows.1