public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Giri P Mudusuru <giri.p.mudusuru@intel.com>
To: edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>,
	Maurice Ma <maurice.ma@intel.com>,
	Satya Yarlagadda <satya.p.yarlagadda@intel.com>,
	Michael Kinney <michael.d.kinney@intel.com>
Subject: [PATCH 1/3] IntelFsp2Pkg: Remove pragma usage to align with UEFI Spec
Date: Mon, 29 Aug 2016 11:13:00 -0700	[thread overview]
Message-ID: <c29b283a7c070d43c560a35adf26d85895151f22.1472493871.git.giri.p.mudusuru@intel.com> (raw)
In-Reply-To: <cover.1472493871.git.giri.p.mudusuru@intel.com>

UEFI spec section 2.3.1 requires all data to be naturally aligned.
Remove the unnecessary pragma usage and use push and pop where needed.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
---
 IntelFsp2Pkg/Include/FspDataTable.h                  | 4 ----
 IntelFsp2Pkg/Include/FspEas/FspApi.h                 | 3 ---
 IntelFsp2Pkg/Include/FspGlobalData.h                 | 4 ----
 IntelFsp2Pkg/Include/Guid/FspHeaderFile.h            | 4 ----
 IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c | 4 ++--
 5 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/IntelFsp2Pkg/Include/FspDataTable.h b/IntelFsp2Pkg/Include/FspDataTable.h
index 3c79f34..a137feb 100644
--- a/IntelFsp2Pkg/Include/FspDataTable.h
+++ b/IntelFsp2Pkg/Include/FspDataTable.h
@@ -15,8 +15,6 @@
 #ifndef _FSP_DATA_TABLE_H_
 #define _FSP_DATA_TABLE_H_
 
-#pragma pack(1)
-
 #define FSP_DATA_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'D')
 
 typedef struct  {
@@ -27,6 +25,4 @@ typedef struct  {
   UINT32  FspsBase;
 } FSP_DATA_TABLE;
 
-#pragma pack()
-
 #endif
diff --git a/IntelFsp2Pkg/Include/FspEas/FspApi.h b/IntelFsp2Pkg/Include/FspEas/FspApi.h
index a2e4813..173b33f 100644
--- a/IntelFsp2Pkg/Include/FspEas/FspApi.h
+++ b/IntelFsp2Pkg/Include/FspEas/FspApi.h
@@ -30,7 +30,6 @@
 #define FSP_STATUS_RESET_REQUIRED_8            0x40000008
 /// @}
 
-#pragma pack(1)
 ///
 /// FSP_UPD_HEADER Configuration.
 ///
@@ -153,8 +152,6 @@ typedef struct {
   FSP_INIT_PHASE     Phase;
 } NOTIFY_PHASE_PARAMS;
 
-#pragma pack()
-
 /**
   This FSP API is called soon after coming out of reset and before memory and stack is
   available. This FSP API will load the microcode update, enable code caching for the
diff --git a/IntelFsp2Pkg/Include/FspGlobalData.h b/IntelFsp2Pkg/Include/FspGlobalData.h
index 8ac3199..605a264 100644
--- a/IntelFsp2Pkg/Include/FspGlobalData.h
+++ b/IntelFsp2Pkg/Include/FspGlobalData.h
@@ -16,8 +16,6 @@
 
 #include <FspEas.h>
 
-#pragma pack(1)
-
 typedef enum {
   TempRamInitApiIndex,
   FspInitApiIndex,
@@ -61,6 +59,4 @@ typedef struct  {
    UINT64             PerfData[32];
 } FSP_GLOBAL_DATA;
 
-#pragma pack()
-
 #endif
diff --git a/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h b/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h
index 96cac00..d36d0a6 100644
--- a/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h
+++ b/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h
@@ -30,8 +30,6 @@
 
 #define FSP_INFO_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'H')
 
-#pragma pack(1)
-
 ///
 /// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.
 ///
@@ -197,8 +195,6 @@ typedef struct {
 //UINT32  PatchData[];
 } FSP_PATCH_TABLE;
 
-#pragma pack()
-
 extern EFI_GUID gFspHeaderFileGuid;
 
 #endif
diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
index 660e9fc..58c71f5 100644
--- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
+++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
@@ -20,7 +20,7 @@
 #include <FspDataTable.h>
 #include <Library/FspSwitchStackLib.h>
 
-#pragma pack(1)
+#pragma pack(push, 1)
 
 //
 //   API Parameter                +0x34
@@ -53,7 +53,7 @@ typedef struct {
 
 #define CONTEXT_STACK_OFFSET(x)  (UINT32)&((CONTEXT_STACK *)(UINTN)0)->x
 
-#pragma pack()
+#pragma pack(pop)
 
 /**
   This function sets the FSP global data pointer.
-- 
2.9.0.windows.1



       reply	other threads:[~2016-08-29 18:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1472493871.git.giri.p.mudusuru@intel.com>
2016-08-29 18:13 ` Giri P Mudusuru [this message]
2016-08-29 18:13 ` [PATCH 2/3] IntelFsp2Pkg: Fix typo and comments Giri P Mudusuru
2016-08-29 23:29   ` Yao, Jiewen
2016-08-29 18:14 ` [PATCH 3/3] IntelFsp2WrapperPkg: Update pragma to use push and pop Giri P Mudusuru
2016-08-29 18:45   ` Kinney, Michael D
2016-08-29 23:43     ` Mudusuru, Giri P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c29b283a7c070d43c560a35adf26d85895151f22.1472493871.git.giri.p.mudusuru@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox