From nobody Fri Nov 1 10:34:18 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 1517391908299831.5880090297703; Wed, 31 Jan 2018 01:45:08 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1A5082215BDBC; Wed, 31 Jan 2018 01:39:31 -0800 (PST) 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 C0ECE2215BD9C for ; Wed, 31 Jan 2018 01:39:29 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 01:45:05 -0800 Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga006.fm.intel.com with ESMTP; 31 Jan 2018 01:45:04 -0800 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.24; helo=mga09.intel.com; envelope-from=bob.c.feng@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.46,439,1511856000"; d="scan'208";a="200195359" From: BobCF To: edk2-devel@lists.01.org Date: Wed, 31 Jan 2018 17:45:02 +0800 Message-Id: <20180131094502.19484-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [edk2] [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: , 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" Add Comments for __FLEXIBLE_SIZE () statement. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao Reviewed-by: 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[FieldNa= me.strip(".")][0]) if IsArray: Value, ValueSize =3D ParseFieldValue (FieldList[Fi= eldName.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.DatumTyp= e, 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.Datum= Type, FieldName.strip("."), FieldList[FieldName.strip(".")][1], FieldList[F= ieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]); else: NewFieldName =3D '' + FieldName_ori =3D FieldName.strip('.') while '[' in FieldName: NewFieldName =3D NewFieldName + FieldName.spli= t('[', 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(DefaultStoreN= ame)]: if not FieldList: continue for FieldName in FieldList: FieldName =3D "." + FieldName IsArray =3D self.IsFieldValueAnArray(FieldList[Fie= ldName.strip(".")][0]) if IsArray: Value, ValueSize =3D ParseFieldValue (FieldLis= t[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.Datu= mType, 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.str= ip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.Dat= umType, 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.str= ip("."), ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_o= ri][2], FieldList[FieldName_ori][0]) if skuname =3D=3D SkuName: break =20 # # Allocate and zero buffer for the PCD --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel