diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2020-07-13 23:37:06 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-07-15 08:32:18 +0000 |
commit | 692dde599f35719d3e9e9a43800b9deea50c002a (patch) | |
tree | fa27b2b338b75880f1aaf0c5fafe23cf72c1e045 /src/vendorcode | |
parent | de3fe84ca970068f0a077631bbdafc1266edf0aa (diff) |
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 <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43433
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/vendorcode')
-rw-r--r-- | src/vendorcode/amd/fsp/picasso/FspmUpd.h | 9 | ||||
-rw-r--r-- | src/vendorcode/amd/fsp/picasso/FspsUpd.h | 9 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/vendorcode/amd/fsp/picasso/FspmUpd.h b/src/vendorcode/amd/fsp/picasso/FspmUpd.h index 276b2fcd46..3be69c3360 100644 --- a/src/vendorcode/amd/fsp/picasso/FspmUpd.h +++ b/src/vendorcode/amd/fsp/picasso/FspmUpd.h @@ -9,12 +9,9 @@ #include <FspUpd.h> -#pragma pack(1) - - /** Fsp M Configuration **/ -typedef struct { +typedef struct __packed { /** Offset 0x0040**/ uint32_t pci_express_base_addr; /** Offset 0x0044**/ uint32_t serial_port_base; /** Offset 0x0048**/ uint32_t serial_port_use_mmio; @@ -71,12 +68,10 @@ typedef struct { /** Fsp M UPD Configuration **/ -typedef struct { +typedef struct __packed { /** Offset 0x0000**/ FSP_UPD_HEADER FspUpdHeader; /** Offset 0x0020**/ FSPM_ARCH_UPD FspmArchUpd; /** Offset 0x0040**/ FSP_M_CONFIG FspmConfig; } FSPM_UPD; -#pragma pack() - #endif 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 <FspUpd.h> -#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 |