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.65; helo=mga03.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 307C321D1B2A4 for ; Wed, 31 Jan 2018 04:13:38 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 04:19:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,440,1511856000"; d="scan'208";a="26924445" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 31 Jan 2018 04:19:14 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 31 Jan 2018 04:19:14 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 31 Jan 2018 04:19:14 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.192]) with mapi id 14.03.0319.002; Wed, 31 Jan 2018 20:19:12 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTool: Add comments in PcdValueInit.c. Thread-Index: AQHTmng2TTHsmGqDy0+xD5wDj7YlGqON5m/A Date: Wed, 31 Jan 2018 12:19:11 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1BA071@SHSMSX104.ccr.corp.intel.com> References: <20180131094502.19484-1-bob.c.feng@intel.com> In-Reply-To: <20180131094502.19484-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] BaseTool: Add comments in PcdValueInit.c. 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: Wed, 31 Jan 2018 12:13:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Wednesday, January 31, 2018 5:45 PM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTool: Add comments in PcdValueInit.c. > >Add Comments for __FLEXIBLE_SIZE () statement. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/Workspace/DscBuildData.py | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py >b/BaseTools/Source/Python/Workspace/DscBuildData.py >index 012e16a488..214e4fd569 100644 >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py >@@ -1325,42 +1325,44 @@ class DscBuildData(PlatformBuildClassObject): > for FieldName in FieldList: > FieldName =3D "." + FieldName > IsArray =3D self.IsFieldValueAnArray(FieldList[FieldN= ame.strip(".")][0]) > if IsArray: > Value, ValueSize =3D ParseFieldValue >(FieldList[FieldName.strip(".")][0]) >- CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, %s, = %d / >__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% >__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));\n' % (Pcd.DatumType, >FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), >ValueSize, Pcd.DatumType, FieldName.strip(".")); >+ CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, %s, = %d / >__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% >__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0)); // From %s Line %d Value %s \n' = % >(Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, >FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), >FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2], >FieldList[FieldName.strip(".")][0]); > else: > NewFieldName =3D '' >+ FieldName_ori =3D FieldName.strip('.') > while '[' in FieldName: > NewFieldName =3D NewFieldName + FieldName.spl= it('[', 1)[0] + >'[0]' > ArrayIndex =3D int(FieldName.split('[', 1)[1]= .split(']', 1)[0]) > FieldName =3D FieldName.split(']', 1)[1] > FieldName =3D NewFieldName + FieldName > while '[' in FieldName: > FieldName =3D FieldName.rsplit('[', 1)[0] >- CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, = %s, %d);\n' % >(Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1) >+ CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, = %s, %d); // >>From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."), >ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], >FieldList[FieldName_ori][0]) > for skuname in self.SkuIdMgr.GetSkuChain(SkuName): > inherit_OverrideValues =3D Pcd.SkuOverrideValues[skuname] > for FieldList in [inherit_OverrideValues.get(DefaultStore= Name)]: > if not FieldList: > continue > for FieldName in FieldList: > FieldName =3D "." + FieldName > IsArray =3D >self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0]) > if IsArray: > Value, ValueSize =3D ParseFieldValue >(FieldList[FieldName.strip(".")][0]) >- CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, = %s, %d / >__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% >__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));\n' % (Pcd.DatumType, >FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), >ValueSize, Pcd.DatumType, FieldName.strip(".")); >+ CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, = %s, %d / >__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% >__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0)); // From %s Line %d Value %s\n' % >(Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, >FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), >FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2], >FieldList[FieldName.strip(".")][0]); > else: > NewFieldName =3D '' >+ FieldName_ori =3D FieldName.strip('.') > while '[' in FieldName: > NewFieldName =3D NewFieldName + FieldName= .split('[', 1)[0] + >'[0]' > ArrayIndex =3D int(FieldName.split('[', 1= )[1].split(']', 1)[0]) > FieldName =3D FieldName.split(']', 1)[1] > FieldName =3D NewFieldName + FieldName > while '[' in FieldName: > FieldName =3D FieldName.rsplit('[', 1)[0] >- CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, = %s, %s, %d);\n' % >(Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1) >+ CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, = %s, %s, %d); // >>From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), >ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], >FieldList[FieldName_ori][0]) > if skuname =3D=3D SkuName: > break > > # > # Allocate and zero buffer for the PCD >-- >2.14.3.windows.1