From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ching.jenx.cheng@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Thu, 01 Aug 2019 00:02:16 -0700 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 00:02:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,333,1559545200"; d="dat'59?scan'59,208,59";a="172819948" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga008.fm.intel.com with ESMTP; 01 Aug 2019 00:02:07 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 1 Aug 2019 00:02:07 -0700 Received: from bgsmsx154.gar.corp.intel.com (10.224.48.47) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 1 Aug 2019 00:02:07 -0700 Received: from bgsmsx105.gar.corp.intel.com ([169.254.3.133]) by BGSMSX154.gar.corp.intel.com ([169.254.7.20]) with mapi id 14.03.0439.000; Thu, 1 Aug 2019 12:32:05 +0530 From: ching.jenx.cheng@intel.com To: "devel@edk2.groups.io" CC: "Chan, Amy" , "Chiu, Chasel" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: [PATCH] * IntelFsp2Pkg: Improve FSP Python scripts to support 3.x. Thread-Topic: [PATCH] * IntelFsp2Pkg: Improve FSP Python scripts to support 3.x. Thread-Index: AdVINwYctnADMCfmS3ay22g2Z+P6Bw== Date: Thu, 1 Aug 2019 07:02:05 +0000 Message-ID: <41C441B9D06FFF49AD23ED447CFBE8B15F3414@BGSMSX105.gar.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <41C441B9D06FFF49AD23ED447CFBE8B15F3414@BGSMSX105.gar.corp.intel.com> x-originating-ip: [10.223.10.10] MIME-Version: 1.0 Return-Path: ching.jenx.cheng@intel.com X-Groupsio-MsgNum: 44791 Content-Type: multipart/mixed; boundary="_000_41C441B9D06FFF49AD23ED447CFBE8B15F3414BGSMSX105garcorpi_" Content-Language: en-US --_000_41C441B9D06FFF49AD23ED447CFBE8B15F3414BGSMSX105garcorpi_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 Improve Python3.x support with IntelFsp2Pkg/Tools/GenCfgOpt.py, Base on <<, print('%x' % ) is only support for int, not float. Cc: Amy Chan Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Ching JenX Cheng --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt= .py index a42717caae..2fa7582d85 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -715,7 +715,7 @@ EndList if (ConfigDict['embed'].find(':END') !=3D -1): Remainder =3D Offset % (MaxAlign/8) # MaxAli= gn is either 32 or 64 if Remainder: - Diff =3D (MaxAlign/8) - Remainder + Diff =3D int((MaxAlign/8) - Remainder) Offset =3D Offset + Diff ItemOffset =3D ItemOffset + Diff MaxAlign =3D 32 # Reset = to default 32 align when struct end @@ -727,7 +727,7 @@ EndList Remainder =3D Offset % max(ItemLength/8, 4, Si= zeAlign) Offset =3D Offset + ItemLength if Remainder: - Diff =3D max(ItemLength/8, 4, SizeAlign) -= Remainder + Diff =3D int(max(ItemLength/8, 4, SizeAlig= n) - Remainder) ItemOffset =3D ItemOffset + Diff ConfigDict['offset'] =3D ItemOffset =20 @@ -1416,7 +1416,7 @@ EndList if BitsRemain: BsfFd.write(" Skip %d bits\n" % BitsRem= ain) BitsGap -=3D BitsRemain - BytesRemain =3D BitsGap / 8 + BytesRemain =3D int(BitsGap / 8) if BytesRemain: BsfFd.write(" Skip %d bytes\n" % BytesR= emain) NextOffset =3D Item['offset'] + Item['length'] --=20 2.21.0.windows.1 --_000_41C441B9D06FFF49AD23ED447CFBE8B15F3414BGSMSX105garcorpi_ Content-Disposition: attachment; filename="winmail.dat" Content-Transfer-Encoding: base64 Content-Type: application/ms-tnef; name="winmail.dat" eJ8+IuU9AQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEJgAEAIQAAADFBRkJBOUI4 ODlCQTM2NDFBMTVDMjYwMDBGN0E3NDU2ACYHAQ2ABAACAAAAAgACAAEFgAMADgAAAOMHCAABAAcA AgAFAAQABQEBIIADAA4AAADjBwgAAQAHAAIABQAEAAUBAQiABwAYAAAASVBNLk1pY3Jvc29mdCBN YWlsLk5vdGUAMQgBBIABAEMAAABbUEFUQ0hdICogSW50ZWxGc3AyUGtnOiBJbXByb3ZlIEZTUCBQ eXRob24gc2NyaXB0cyB0byBzdXBwb3J0IDMueC4AgRYBC4ABACEAAAAxQUZCQTlCODg5QkEzNjQx QTE1QzI2MDAwRjdBNzQ1NgAmBwEDkAYAeA4AAC8AAAACAX8AAQAAAEYAAAA8NDFDNDQxQjlEMDZG RkY0OUFEMjNFRDQ0N0NGQkU4QjE1RjM0MTRAQkdTTVNYMTA1Lmdhci5jb3JwLmludGVsLmNvbT4A AAALAB8OAQAAAAIBCRABAAAAEQUAAA0FAACECwAATFpGdZsz8FRhAApmYmlkBAAAY2PAcGcxMjUy AP4DQ/B0ZXh0AfcCpAPjAgAEY2gKwHNldDAg7wdtAoMAUBFNMgqABrQCgJZ9CoAIyDsJYjE5DsC/ CcMWcgoyFnEC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