From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 84BD31A1EDE for ; Fri, 16 Sep 2016 20:25:13 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 16 Sep 2016 20:25:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,348,1470726000"; d="scan'208";a="762247817" Received: from sprasa6-mobl.gar.corp.intel.com ([10.252.89.210]) by FMSMGA003.fm.intel.com with ESMTP; 16 Sep 2016 20:25:12 -0700 From: Satya Yarlagadda To: edk2-devel@lists.01.org Cc: Maurice Ma , Jiewen Yao , Giri P Mudusuru Date: Sat, 17 Sep 2016 08:54:49 +0530 Message-Id: <20160917032449.5696-1-satya.p.yarlagadda@intel.com> X-Mailer: git-send-email 2.10.0.windows.1 Subject: [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: Sat, 17 Sep 2016 03:25:13 -0000 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. 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. 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(-) 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 = False if Length in [1,2,4,8]: Type = "UINT%d" % (Length * 8) + if Name.startswith("UnusedUpdSpace") and Length != 1: + IsArray = True + Type = "UINT8" else: IsArray = True Type = "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") Export = False for Line in IncLines: @@ -1177,7 +1180,7 @@ EndList for Item in range(len(StructStart)): if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]: HeaderFd.write (Line) - HeaderFd.write("#pragma pack(pop)\n\n") + HeaderFd.write("#pragma pack()\n\n") HeaderFd.write("#endif\n") HeaderFd.close() @@ -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") for item in range(len(UpdRegionCheck)): Index = 0 @@ -1222,7 +1225,7 @@ EndList for Item in range(len(StructStart)): if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]: HeaderFd.write (Line) - HeaderFd.write("#pragma pack(pop)\n\n") + HeaderFd.write("#pragma pack()\n\n") HeaderFd.write("#endif\n") HeaderFd.close() -- 2.10.0.windows.1