From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web08.6610.1664635411776486775 for ; Sat, 01 Oct 2022 07:43:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=k9oDb93r; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: bob.c.feng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664635411; x=1696171411; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xkXJ02Cuaycztkzpt7ROqegcDUGaJuTDKowOiVky8Ss=; b=k9oDb93rVWQtkCsEaJs/v5Om7jTrYiIbjwfkywVu4suT0Qe8usqrcfto XU02cxcHlpBMNK0H2GPwoW67Viv3tAxQ37kXisoxkokIs2vNZ2VPKqStc CuvLxdBsfibQFC0FE5qiWt5l29Aq1jI27IwHOnNs4pm0SgwviIb7qrHXq 9xu52ksxaXgMYdOEMcX6fCPZr72GsAp8/8BRCRputOQFiDcibuRq5DKmY IoH9M2sdsx8Y8WNEgAzDOLS8DV5SXU7cYyCKyBaHLwtlB1BGKQHv4m75j U74xagoGkQnXLykKeeQ/18Q0AUqhJVrQ/Ocx1figsNx7MV3kh7owoBNIf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10487"; a="388673850" X-IronPort-AV: E=Sophos;i="5.93,361,1654585200"; d="scan'208";a="388673850" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2022 07:43:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10487"; a="623082696" X-IronPort-AV: E=Sophos;i="5.93,361,1654585200"; d="scan'208";a="623082696" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 01 Oct 2022 07:43:22 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 1 Oct 2022 07:43:22 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Sat, 1 Oct 2022 07:43:22 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Sat, 1 Oct 2022 07:43:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GcU0/wbhGsCWMzorKDzQtLGzdALH/UhPgKg2qCSi7SDbiOrL4ycAjUzeQkrnAxM8Ch20t8+G56JEN7/Ryvgf3JYLb1dN6cMU/mpKI8yxLAa56Oi5B+ru6KYXt12JkF3/IiHDrnQ305SZzbuIzvBBkyEq8D8PuyxMpsU20sdc/uH0Yf3U8mbTy80zetJmu2f0Eyy/tOQA6VM5NIymEE4mnImM7Dlh7fwfsfwtM/XI7ZIhdUK0Z14yoUiefb7/VMUjcOfHqVJkffg1JzWinXTqlabzrzDUrc4tsAXZjJbxKgTPZkqjDKD5JHCxXVfer8aZwLm72brspTprIxlhlZLWWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DUc0xpOsExDnUOknE0bOpsB6hvIKQ6tdi9pR+UQ79Jw=; b=ku6T4D11r4vKQTh2CPlRmtqp4mN5KWIYfGcSRcZxDFom8mnNdZ/bCzQpRjeTRzIw5fNa8QRgXVS54xLdx9pvLiSHlgx5Xyw5NYRVIGKVTvC1+ZRl58MDtvWWMrvyyLG/dJT0TBmDfqcKm3oEn6tWMja48ixfgrIGiYTdSnHg9e9kEeFrg1STqUKf4JxhYF9ojsrKgYt458JynwBeOboJr8TqT972jeo6eRn9U00rKQcwHf6EfjeTWXLf5JpN06oy5pMgKtX2I+MhnVeK47VQlcyHTBFNvR0ahvt8HvAVW/WPOCKEs3szKlWtqLR0jmUX4GhgkLDpUSsZ+lfId4CbOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH7PR11MB5863.namprd11.prod.outlook.com (2603:10b6:510:135::11) by PH0PR11MB4935.namprd11.prod.outlook.com (2603:10b6:510:35::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Sat, 1 Oct 2022 14:43:19 +0000 Received: from PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::b6b:85ec:5ee0:d1]) by PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::b6b:85ec:5ee0:d1%9]) with mapi id 15.20.5676.017; Sat, 1 Oct 2022 14:43:19 +0000 From: "Bob Feng" To: Konstantin Aladyshev , "devel@edk2.groups.io" CC: "Gao, Liming" , "Chen, Christine" Subject: Re: [PATCH v2] BaseTools: Correct initialization data size check for array PCDs Thread-Topic: [PATCH v2] BaseTools: Correct initialization data size check for array PCDs Thread-Index: AQHYvFo03dySb7lnok+1c9sHruk3lq35z4zA Date: Sat, 1 Oct 2022 14:43:19 +0000 Message-ID: References: <20220830102054.18641-1-aladyshev22@gmail.com> In-Reply-To: <20220830102054.18641-1-aladyshev22@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB5863:EE_|PH0PR11MB4935:EE_ x-ms-office365-filtering-correlation-id: 4a689eb7-99f9-44f2-6728-08daa3bb487a x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QxTJufasKhZargPsAWxZuLN/vyOqKggGE5X6htXgJ/FQIdNvvbNuTOj7n9RBqpsqmihePD99J8vDmPnk5bzapG0A17SxAGcHOygHyiVncbmgDio1SEV5SV7O2mXeHBM8j21PPlTXRcKuVnCdmGkj8DpqvLkJKsDQf1Z+Mbni04HUUC86VcDOJOtpNuMQ2dDS5KkIzo4qI7Yl21LQQAkgcRb+xx9HENTwpOUhbzQ/OuUzzpMTh7OWUQht7fZ0oZhxg30pRIAqtu0/2/Q13Iq1vCVBx+kZV6eVtKqsX9FGs+UzXnz0fV9b+z3GqiYSJTYulB4oKrf6+s5V/6XevyouN+xHzi8oEN4ZvUfWzfGV3S26RXFGTB1340kuTkSpZzqopw7NpeZs0iQ5W4Ti67gLVuyoazIPu1eDnXrqpD95lidPiYL1+Ki9X+VBsea49HbWj1Z3VyuIszz+WyeyxfsJJXjyT5QqIGbiERpzap8c98lOcgb7cMUSKQgvoOKGUElVlLInv/nJv1GO4whn2NQE3z4T5jg1Zl4zstmNawRHeYEPdrNJcrDDhM6gfUCwtXsjc0BVWLVVTk60NgaTg4o4yhRTfC2MBet/bf5TK7YjOrqofKgZBbSdIaHyedEFGEecYU6iuaiR6MWy2ASTFd/grSZroQUt8KxHso7jhNrIs793gBjArLqIbB+//ILfWn2SueRSIWlbc7e/ShGIE5H5z8WCyn08X598p45UvKZmRf4qf5MG5+5NaqkMK0xTgUNE3+YvdqjMpMU9VK8aGmB1pg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB5863.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(396003)(39860400002)(346002)(366004)(136003)(451199015)(26005)(33656002)(53546011)(8936002)(9686003)(86362001)(52536014)(110136005)(8676002)(4326008)(64756008)(41300700001)(107886003)(76116006)(66946007)(66556008)(66446008)(66476007)(55016003)(2906002)(6506007)(7696005)(38070700005)(83380400001)(186003)(71200400001)(478600001)(38100700002)(316002)(122000001)(5660300002)(82960400001)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JetBMpmWgtpOC19aAItf4rJczA9V4ao8Paxtl7Zbb1EueY82RsVFVB3yknCq?= =?us-ascii?Q?QyYpajDvmSbwLUWD4GLcQBPXqnVytOyynTByBv39Dk2UB/SSBbFuZ1FcKGxw?= =?us-ascii?Q?+I9RnUqVYW2sc7ZWR6MDFKTT4FG1BFqL/xHpT7jySMpWWTGVL406ruHfEbDb?= =?us-ascii?Q?NygSujyHTWsPvtYVk+n8u+2ywIlruUdjMubIIobowBGjj9Der7TNWr9dQgAS?= =?us-ascii?Q?NplDATF2pTLgNzfX+MINmUOwGd3eyy5GTDCOnY6uQZ87PEuhWcIXc34YOTMS?= =?us-ascii?Q?TBH/5FigkZ+6dMvaHi+xsBL/9mEoU/e6JEsRtY9FRx23u4h4UspftWRnxeKu?= =?us-ascii?Q?jTE0LOReRgGw2miyi+WbFkVRSIMZGWNoIgVJPxvYFSTtgeKc4sPLbouLBGQa?= =?us-ascii?Q?cKHOJ/98Gjzx2riZo5MRVCIR+lxVHwftFCmgZwCs2FCLX51x/8yPWwZ9cNh9?= =?us-ascii?Q?TS8a8ssQX/eMAPkqGCaA3mfAzApqdwI0214Ea2EK7CLSTForEeoiSgJUeuIR?= =?us-ascii?Q?+M35RHbmftqmqYH81xQ7Wft6iGFwhXa8XoGxDkEcnfQ/V997YiOtubzZ2w8U?= =?us-ascii?Q?HejR3zxDXcaELRSQrWkpOtBy6u2ZfXIj4IZ1msVCesxRxsTVSo9bUao8XEwO?= =?us-ascii?Q?QyWa6iSmaTltWhNzITm9Ey7g6k2KPQuFPC1ZUlQxIIvBMpva6pKNr+OW7fe8?= =?us-ascii?Q?gGRAXnukTH0B/IPwIT2b4eb3QUEX7ULCmulhMCGvU/X0ppP4JMWw6iwmXAWq?= =?us-ascii?Q?I8BEZhy59RiEPxCOdPbEZv6U8blbeOv3lD5tBP48+ycuIDvEHiXkG78ukD2o?= =?us-ascii?Q?KU2/ZbosIpyb/Xa/c0gITtbmk/JUr4Yp3EM574JV4SK4WAC3eBNuVAZDk75B?= =?us-ascii?Q?xiFG8ES7kt5JW6BL4/GnFmUu/HccIsRhHDegSE8YFIoXJKRnlmN4tHPNMtOX?= =?us-ascii?Q?Zahs8olIyZY0JNz5bMFwzfhDzcu9hzIhOkx9X4pddtV5lLtWv0WMBzs5WaFF?= =?us-ascii?Q?Gt7QLUwMkDlA2CWqCkML2AEPtFnChRrp9sBmOu8MXmtRtp8juKaNR7/597KW?= =?us-ascii?Q?zccjTJMZ6ocN8ULEg51QlBWybP3b2ZUBdALklfxmbBDk0v7aBYMDpseXkyX5?= =?us-ascii?Q?tmlKj96/SfRrY8AU7E98HkS5UhRn7cbQm/tGY39BhQYWiJZIcq8JoSLWCMXM?= =?us-ascii?Q?7ljlW52v7FKMeGGnAKhgxC+RpVxtpbk2offjLtK9mtyfQo+ttScmW80lXjIU?= =?us-ascii?Q?m5/UxUApuBXory+r64YTCjzwfkoL0Fk0EPoP7pRB5RdSX1LEThbGQw7Z8Pbe?= =?us-ascii?Q?sE6F5uK0LJj8/8jOKM2sRGDgjITBwTEbSleAvn0qOVaF7U+NJ7rXpS3SIcTa?= =?us-ascii?Q?Ryt9qf92n7hsGL3rAHoGEdivbusfi+vkMwzRehnSBo2TBq5wb6DUv0F/qF7F?= =?us-ascii?Q?h2iYa+Bglu2pENPeotZWlB6ddqjpZTyhkuk1ajAkXloJmI+cO//FrxbMQvrd?= =?us-ascii?Q?kz5cN/3W1eDdFF0DMBGWNoMdNJZ4IQTdURHnxMTeGIKKwtCJ80tOUx9LCFtD?= =?us-ascii?Q?95BlW9PcPFsokG4zJL6rHeJL53FAWATsBcfxFwDW?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5863.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a689eb7-99f9-44f2-6728-08daa3bb487a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2022 14:43:19.6072 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3qedMy0shDCVhTr7onDOHZblgwbybpYPmX3GW4dQOosheoyG1uBLs3YNFu7jPc0zjQW2Ghf03+r02CTTSc9KFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4935 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Konstantin Aladyshev =20 Sent: Tuesday, August 30, 2022 6:21 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming ; Chen, Christine ; Konstantin Aladyshev Subject: [PATCH v2] BaseTools: Correct initialization data size check for a= rray PCDs Currently it is not possible to initialize all elements in the array PCD. For example, this PCD would result to a build failure: gTokenSpaceGuid.PcdArray|{0x11, 0x22}|UINT8[2]|0x4C4CB9A3 Correct logical operator in the initialization data size checks to fix the = issue. Signed-off-by: Konstantin Aladyshev --- .../Source/Python/Workspace/DscBuildData.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index e9f68384b4..73c6ee4006 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2089,12 +2089,12 @@ class DscBuildData(PlatformBuildClassObject): pcdarraysize =3D Pcd.PcdArraySize() if "{C= ODE(" in Pcd.DefaultValueFromDec: if Pcd.Capacity[-1] != =3D "-1":- CApp =3D CApp + '__STATIC_ASSERT(sizeof(%= s_%s_INIT_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dec exceed the arra= y capability %s"); // From %s Line %s \n ' % (Pcd.TokenSpaceGuidCName, Pcd= .TokenCName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, Pcd.Tok= enCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDe= cInfo[1])+ CApp =3D CApp + '__STATIC_ASSERT(sizeof(%= s_%s_INIT_Value) <=3D %d * sizeof(%s), "Pcd %s.%s Value in Dec exceed the a= rray capability %s"); // From %s Line %s \n ' % (Pcd.TokenSpaceGuidCName, = Pcd.TokenCName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, Pcd.= TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFro= mDecInfo[1]) CApp =3D CApp + ' PcdArraySize =3D sizeof(= %s_%s_INIT_Value);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) = CApp =3D CApp + ' memcpy (Pcd, %s_%s_INIT_Value,PcdArraySize);= \n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) else: = if Pcd.Capacity[-1] !=3D "-1":- CApp= =3D CApp + '__STATIC_ASSERT(%d < %d * sizeof(%s), "Pcd %s.%s Value in Dec = exceed the array capability %s"); // From %s Line %s \n' % (ValueSize,pcdar= raysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.Datum= Type,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])+ = CApp =3D CApp + '__STATIC_ASSERT(%d <=3D %d * sizeof(%s), = "Pcd %s.%s Value in Dec exceed the array capability %s"); // From %s Line %= s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, = Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValu= eFromDecInfo[1]) CApp =3D CApp + ' PcdArraySize =3D %d;= \n' % ValueSize CApp =3D CApp + ' Value =3D %s; //= From DEC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize= ), Pcd.DefaultValueFromDec) CApp =3D CApp + ' memcpy (= Pcd, Value, PcdArraySize);\n'@@ -2204,7 +2204,7 @@ class DscBuildData(Platf= ormBuildClassObject): if "{CODE(" in Value: if Pcd.I= sArray() and Pcd.Capacity[-1] !=3D "-1": pcdarr= aysize =3D Pcd.PcdArraySize()- CApp =3D CApp + '= __STATIC_ASSERT(sizeof(%s_%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Val= ue in Dsc exceed the array capability %s"); // From %s \n' % (Pcd.TokenSpac= eGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseD= atumType,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType, valuefrom)+= CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_%= s_%s_Value) <=3D %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array = capability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,= SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuid= CName, Pcd.TokenCName,Pcd.DatumType, valuefrom) CAp= p =3D CApp+ ' PcdArraySize =3D sizeof(%s_%s_%s_%s_Value);\n ' % (Pcd.TokenS= paceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_Value,PcdArraySize);\n '= % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = else:@@ -2217,12 +2217,12 @@ class DscBuildData(PlatformBui= ldClassObject): pcdarraysize =3D Pcd.PcdArraySize() = if "{CODE(" in pcddefaultvalue: if Pc= d.Capacity[-1] !=3D "-1":- CApp =3D CApp + '= __STATIC_ASSERT(sizeof(%s_%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Val= ue in Dsc exceed the array capability %s"); // From %s \n' % (Pcd.TokenSpa= ceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName,pcdarraysize,Pcd.Base= DatumType,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)+= CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_= %s_%s_%s_Value) <=3D %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the ar= ray capability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenC= Name,SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpac= eGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom) = CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_%s_%s_Value);\n ' % (P= cd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = CApp =3D CApp + ' memcpy (Pcd, %s_%s_%s_%s_Value, PcdAr= raySize);\n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultSto= reName) else: if Pcd.Ca= pacity[-1] !=3D "-1":- CApp =3D CApp + '__ST= ATIC_ASSERT(%d < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array = capability %s"); // From %s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumTyp= e,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)+ = CApp =3D CApp + '__STATIC_ASSERT(%d <=3D %d * sizeo= f(%s), "Pcd %s.%s Value in Dsc exceed the array capability %s"); // From %= s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, = Pcd.TokenCName,Pcd.DatumType,valuefrom) CApp = =3D CApp + ' PcdArraySize =3D %d;\n' % ValueSize = CApp =3D CApp + ' Value =3D %s; // From DSC Default Value %s\n' % (D= scBuildData.IntToCString(Value, ValueSize), Pcd.DefaultFromDSC.get(TAB_DEFA= ULT, {}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFr= omDSC else Pcd.DefaultValue) CApp =3D CApp + ' = memcpy (Pcd, Value, PcdArraySize);\n'@@ -2238,7 +2238,7 @@ class DscBuildD= ata(PlatformBuildClassObject): if "{CODE(" in Value: if Pcd.I= sArray() and Pcd.Capacity[-1] !=3D "-1": pcdarr= aysize =3D Pcd.PcdArraySize()- CApp =3D CApp + '= __STATIC_ASSERT(sizeof(%s_%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Val= ue in Dsc exceed the array capability %s"); // From %s \n' % (Pcd.TokenSpac= eGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseD= atumType,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)+ = CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_%s= _%s_Value) <=3D %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array c= apability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,S= kuName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName,Pcd.DatumType,valuefrom) CApp = =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_%s_%s_Value);\n '% (Pcd.TokenSpa= ceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_Value, PcdArraySize);\n' %= (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = else:@@ -2251,12 +2251,12 @@ class DscBuildData(PlatformBuild= ClassObject): pcdarraysize =3D Pcd.PcdArraySize() = if "{CODE(" in pcddefaultvalue: if Pc= d.Capacity[-1] !=3D "-1":- CApp =3D CApp + '= __STATIC_ASSERT(sizeof(%s_%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Val= ue in Dsc exceed the array capability %s"); // From %s \n' % (Pcd.TokenSpa= ceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName,pcdarraysize,Pcd.Base= DatumType,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)+= CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_= %s_%s_%s_Value) <=3D %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the ar= ray capability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenC= Name,SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpac= eGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom) = CApp + ' PcdArraySize =3D sizeof(%s_%s_%s_%s_Value);\n ' % (Pcd.TokenS= paceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = CApp =3D CApp + ' memcpy (Pcd, %s_%s_%s_%s_Value, PcdArraySize);= \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultStoreName) = else: if Pcd.Capacity[-1= ] !=3D "-1":- CApp =3D CApp + '__STATIC_ASSE= RT(%d < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array capabilit= y %s"); // From %s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.Tok= enSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)+ = CApp =3D CApp + '__STATIC_ASSERT(%d <=3D %d * sizeof(%s), "P= cd %s.%s Value in Dsc exceed the array capability %s"); // From %s \n' % (= ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, Pcd.Token= CName,Pcd.DatumType,valuefrom) CApp =3D CApp + = ' PcdArraySize =3D %d;\n' % ValueSize CApp =3D = CApp + ' Value =3D %s; // From DSC Default Value %s\n' % (DscBuildData= .IntToCString(Value, ValueSize), Pcd.DscRawValue.get(TAB_DEFAULT, {}).get(T= AB_DEFAULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd= .DefaultValue) CApp =3D CApp + ' memcpy (Pcd, = Value, PcdArraySize);\n'--=20 2.25.1