From 692dde599f35719d3e9e9a43800b9deea50c002a Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 13 Jul 2020 23:37:06 +0200 Subject: vc/amd/fsp/picasso: replace #pragma pack(1) with __packed attribute Forgetting to add the #pragma pack() at the end of the header file can lead to hard to debug breakage, so get rid of the #pragma pack usage and add a __packed to the structs that need to be packed which has less possibly unwanted side effects. Since commit d44221f9c8f3686e040ff9481829315068b321a3 coreboot always includes commonlib/compiler.h which provides __packed. TEST=Timeless build results in identical binary. Change-Id: Icc53168f4fbc3a63a859f686b18e7023d225f8d2 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/43433 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Angel Pons --- src/vendorcode/amd/fsp/picasso/FspsUpd.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/vendorcode/amd/fsp/picasso/FspsUpd.h') diff --git a/src/vendorcode/amd/fsp/picasso/FspsUpd.h b/src/vendorcode/amd/fsp/picasso/FspsUpd.h index 2dcc617a9e..5a408316ff 100644 --- a/src/vendorcode/amd/fsp/picasso/FspsUpd.h +++ b/src/vendorcode/amd/fsp/picasso/FspsUpd.h @@ -9,10 +9,7 @@ #include -#pragma pack(1) - - -typedef struct { +typedef struct __packed { /** Offset 0x0020**/ uint32_t emmc0_mode; /** Offset 0x0024**/ uint8_t unused0[12]; /** Offset 0x0030**/ uint8_t dxio_descriptor0[16]; @@ -51,11 +48,9 @@ typedef struct { /** Fsp S UPD Configuration **/ -typedef struct { +typedef struct __packed { /** Offset 0x0000**/ FSP_UPD_HEADER FspUpdHeader; /** Offset 0x0020**/ FSP_S_CONFIG FspsConfig; } FSPS_UPD; -#pragma pack() - #endif -- cgit v1.2.3