From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ACDB11A1EDC for ; Sat, 17 Sep 2016 18:11:43 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 17 Sep 2016 18:11:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,353,1470726000"; d="scan'208";a="880775712" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 17 Sep 2016 18:11:43 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 17 Sep 2016 18:11:42 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 17 Sep 2016 18:11:42 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.150]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.102]) with mapi id 14.03.0248.002; Sun, 18 Sep 2016 09:11:40 +0800 From: "Yao, Jiewen" To: "Yarlagadda, Satya P" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] IntelFsp2Pkg: Align #Pragma in UPD header files to rest of EDK2 Pkgs Thread-Index: AQHSEJMgE0I2kUXH502XHpD17Y2X7aB+cgVQ Date: Sun, 18 Sep 2016 01:11:39 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C5038687AA4@shsmsx102.ccr.corp.intel.com> References: <20160917032449.5696-1-satya.p.yarlagadda@intel.com> In-Reply-To: <20160917032449.5696-1-satya.p.yarlagadda@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelFsp2Pkg: Align #Pragma in UPD header files to rest of EDK2 Pkgs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 01:11:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: jiewen.yao@intel.com > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Satya Yarlagadda > Sent: Saturday, September 17, 2016 11:25 AM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen > Subject: [edk2] [PATCH] IntelFsp2Pkg: Align #Pragma in UPD header files t= o > rest of EDK2 Pkgs >=20 > Changed the GenCfgOpt.py script to insert pragma pack(1) instead of > pragma pack (push, 1) in the upd header files generated during fsp build. > This is to align with rest of the EDKII pkgs pragma pack usage. >=20 > Also, this scripts generates UnusedUpdSpace for UPD address gaps. > Currently it uses UIN16/UINT32/UINT64 for 2/4/8 bytes instead of UINT8[], > thus causing upd space waste to have Natural Alignment. Hence changed the > script to use UINT8[] for any unusedUpd fields above 1 byte. >=20 > Cc: Maurice Ma > Cc: Jiewen Yao > Cc: Giri P Mudusuru > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Satya Yarlagadda > --- > IntelFsp2Pkg/Tools/GenCfgOpt.py | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py > b/IntelFsp2Pkg/Tools/GenCfgOpt.py > index e8cec95..654cdfc 100644 > --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py > +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py > @@ -875,6 +875,9 @@ EndList > IsArray =3D False > if Length in [1,2,4,8]: > Type =3D "UINT%d" % (Length * 8) > + if Name.startswith("UnusedUpdSpace") and Length !=3D 1: > + IsArray =3D True > + Type =3D "UINT8" > else: > IsArray =3D True > Type =3D "UINT8" > @@ -1129,7 +1132,7 @@ EndList > HeaderFd.write("#ifndef __%s__\n" % FileName) > HeaderFd.write("#define __%s__\n\n" % FileName) > HeaderFd.write("#include <%s>\n\n" % HeaderFileName) > - HeaderFd.write("#pragma pack(push, 1)\n\n") > + HeaderFd.write("#pragma pack(1)\n\n") >=20 > Export =3D False > for Line in IncLines: > @@ -1177,7 +1180,7 @@ EndList > for Item in range(len(StructStart)): > if Index >=3D StructStartWithComment[Item] and > Index <=3D StructEnd[Item]: > HeaderFd.write (Line) > - HeaderFd.write("#pragma pack(pop)\n\n") > + HeaderFd.write("#pragma pack()\n\n") > HeaderFd.write("#endif\n") > HeaderFd.close() >=20 > @@ -1188,7 +1191,7 @@ EndList > HeaderFd.write("#ifndef __%s__\n" % FileName) > HeaderFd.write("#define __%s__\n\n" % FileName) > HeaderFd.write("#include \n\n") > - HeaderFd.write("#pragma pack(push, 1)\n\n") > + HeaderFd.write("#pragma pack(1)\n\n") >=20 > for item in range(len(UpdRegionCheck)): > Index =3D 0 > @@ -1222,7 +1225,7 @@ EndList > for Item in range(len(StructStart)): > if Index >=3D StructStartWithComment[Item] and > Index <=3D StructEnd[Item]: > HeaderFd.write (Line) > - HeaderFd.write("#pragma pack(pop)\n\n") > + HeaderFd.write("#pragma pack()\n\n") > HeaderFd.write("#endif\n") > HeaderFd.close() >=20 > -- > 2.10.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel