From nobody Sun May 5 18:46:35 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1532318512467116.73814770733134; Sun, 22 Jul 2018 21:01:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DC137210C0CF0; Sun, 22 Jul 2018 21:01:51 -0700 (PDT) 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 87A95210C0CED for ; Sun, 22 Jul 2018 21:01:50 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2018 21:01:49 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga003.jf.intel.com with ESMTP; 22 Jul 2018 21:01:44 -0700 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=yonghong.zhu@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.51,392,1526367600"; d="scan'208";a="69064148" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Mon, 23 Jul 2018 12:01:41 +0800 Message-Id: <1532318501-5412-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [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: , 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" 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 Reviewed-by: Liming Gao --- 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/Pyt= hon/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) LibPcdS= et%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, = PcdTokenName)) else: AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value= ))\n' % (SetModeName, DatumSizeLib, PcdTokenName)) AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, (Valu= e))\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_PA= TCHABLE_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) LibPatchPcd= SetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buffe= r))\n' % (SetModeName, TokenCName, PatchPcdSizeVariableName, PatchPcdMaxSiz= eVariable)) AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buff= er))\n' % (SetModeStatusName, TokenCName, PatchPcdSizeVariableName, PatchPc= dMaxSizeVariable)) - AutoGenH.Append('#define %s %s\n' % (GetModeMaxSizeName, Patch= PcdMaxSizeVariable)) + AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pa= tchPcdMaxSizeVariable)) AutoGenH.Append('extern const UINTN %s; \n' % PatchPcdMaxSizeV= ariable) else: AutoGenH.Append('#define %s(Value) (%s =3D (Value))\n' % (Set= ModeName, PcdVariableName)) AutoGenH.Append('#define %s(Value) ((%s =3D (Value)), RETURN_= SUCCESS)\n' % (SetModeStatusName, PcdVariableName)) AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pc= dDataSize)) --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel