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.126; helo=mga18.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org 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 DE43A210C0CED for ; Sun, 22 Jul 2018 21:06:25 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2018 21:06:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,392,1526367600"; d="scan'208";a="69321739" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 22 Jul 2018 21:03:20 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 22 Jul 2018 21:03:19 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 22 Jul 2018 21:03:19 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.81]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.173]) with mapi id 14.03.0319.002; Mon, 23 Jul 2018 12:03:17 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Correct _PCD_PATCHABLE_TokenName_SIZE's value Thread-Index: AQHUIjnrslJoYqxI1UCZ+gj2/cKwe6ScL6+g Date: Mon, 23 Jul 2018 04:03:17 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2BF83B@SHSMSX104.ccr.corp.intel.com> References: <1532318501-5412-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1532318501-5412-1-git-send-email-yonghong.zhu@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: Correct _PCD_PATCHABLE_TokenName_SIZE's value X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 04:06:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Monday, July 23, 2018 12:02 PM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch] BaseTools: Correct >_PCD_PATCHABLE_TokenName_SIZE's value > >current if user use PatchPcdSetPtr in library, it will report the >_PCD_PATCHABLE_TokenName_SIZE is not defined. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/GenC.py | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/GenC.py >b/BaseTools/Source/Python/AutoGen/GenC.py >index 3b39649..f741f1c 100644 >--- a/BaseTools/Source/Python/AutoGen/GenC.py >+++ b/BaseTools/Source/Python/AutoGen/GenC.py >@@ -1291,11 +1291,10 @@ def CreateLibraryPcdCode(Info, AutoGenC, >AutoGenH, Pcd): > AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) >LibPcdSet%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, >DatumSizeLib, PcdTokenName)) > else: > AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Valu= e))\n' % >(SetModeName, DatumSizeLib, PcdTokenName)) > AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, >(Value))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName)) > if PcdItemType =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE: >- GetModeMaxSizeName =3D '_PCD_GET_MODE_MAXSIZE' + '_' + >TokenCName > PcdVariableName =3D '_gPcd_' + >gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + '_' + >TokenCName > if DatumType not in TAB_PCD_NUMERIC_TYPES: > if DatumType =3D=3D TAB_VOID and Array =3D=3D '[]': > DatumType =3D [TAB_UINT8, TAB_UINT16][Pcd.DefaultValue[0]= =3D=3D 'L'] > else: >@@ -1306,11 +1305,11 @@ def CreateLibraryPcdCode(Info, AutoGenC, >AutoGenH, Pcd): > >AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeNa >me, Type, TokenCName)) > PcdDataSize =3D Pcd.GetPcdSize() > if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES: > AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) >LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, >(SizeOfBuffer), (Buffer))\n' % (SetModeName, TokenCName, >PatchPcdSizeVariableName, PatchPcdMaxSizeVariable)) > AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) >LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, >(SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, TokenCName, >PatchPcdSizeVariableName, PatchPcdMaxSizeVariable)) >- AutoGenH.Append('#define %s %s\n' % (GetModeMaxSizeName, >PatchPcdMaxSizeVariable)) >+ AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, >PatchPcdMaxSizeVariable)) > AutoGenH.Append('extern const UINTN %s; \n' % >PatchPcdMaxSizeVariable) > else: > AutoGenH.Append('#define %s(Value) (%s =3D (Value))\n' % >(SetModeName, PcdVariableName)) > AutoGenH.Append('#define %s(Value) ((%s =3D (Value)), >RETURN_SUCCESS)\n' % (SetModeStatusName, PcdVariableName)) > AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, >PcdDataSize)) >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel