From nobody Tue May 13 16:07:45 2025 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 1528524923514776.3791963517062; Fri, 8 Jun 2018 23:15:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 50D6B21112BB3; Fri, 8 Jun 2018 23:15:15 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 EE09721109399 for ; Fri, 8 Jun 2018 23:15:12 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 23:15:12 -0700 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.116.225]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2018 23:15:12 -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=192.55.52.136; helo=mga12.intel.com; envelope-from=michael.d.kinney@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.49,493,1520924400"; d="scan'208";a="55428564" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Fri, 8 Jun 2018 23:15:03 -0700 Message-Id: <20180609061505.14380-4-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180609061505.14380-1-michael.d.kinney@intel.com> References: <20180609061505.14380-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 3/5] BaseTools/BinToPcd: --offset must be 8-byte aligned X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Yanyan Sun , 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" https://bugzilla.tianocore.org/show_bug.cgi?id=3D974 https://bugzilla.tianocore.org/show_bug.cgi?id=3D965 Update help to state that --offset must be 8-byte aligned. Verify that --offset is 8-byte aligned and print an error message if it is not 8-byte aligned. Cc: Yanyan Sun Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 --- BaseTools/Scripts/BinToPcd.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py index 7e3380190e..54cb844d68 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -89,7 +89,7 @@ if __name__ =3D=3D '__main__': parser.add_argument("-m", "--max-size", dest =3D 'MaxSize', type =3D Val= idateUnsignedInteger, help =3D "Maximum size of the PCD. Ignored with --t= ype HII.") parser.add_argument("-f", "--offset", dest =3D 'Offset', type =3D Valida= teUnsignedInteger, - help =3D "VPD offset if --type is VPD. UEFI Variabl= e offset if --type is HII.") + help =3D "VPD offset if --type is VPD. UEFI Variabl= e offset if --type is HII. Must be 8-byte aligned.") parser.add_argument("-n", "--variable-name", dest =3D 'VariableName', help =3D "UEFI variable name. Only used with --type= HII.") parser.add_argument("-g", "--variable-guid", type =3D ValidateGuidName, = dest =3D 'VariableGuid', @@ -178,6 +178,12 @@ if __name__ =3D=3D '__main__': Pcd =3D ' %s|*|%d|%s' % (args.PcdName, args.MaxSize, PcdValue) else: # + # --offset value must be 8-byte aligned + # + if (args.Offset % 8) !=3D 0: + print 'BinToPcd: error: argument --offset must be 8-byte aligned.' + sys.exit() + # # Use the --offset value provided. # Pcd =3D ' %s|%d|%d|%s' % (args.PcdName, args.Offset, args.MaxSize, = PcdValue) @@ -194,6 +200,12 @@ if __name__ =3D=3D '__main__': # Use UEFI Variable offset of 0 if --offset is not provided # args.Offset =3D 0 + # + # --offset value must be 8-byte aligned + # + if (args.Offset % 8) !=3D 0: + print 'BinToPcd: error: argument --offset must be 8-byte aligned.' + sys.exit() Pcd =3D ' %s|L"%s"|%s|%d|%s' % (args.PcdName, args.VariableName, args= .VariableGuid, args.Offset, PcdValue) if args.Verbose: print 'BinToPcd: Convert binary file to PCD statement compatible wit= h PCD sections' --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel