From 6a00113de8b9060a7227bcfa79b3786e3e592a33 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 13 Jul 2017 02:20:27 +0200 Subject: Rename __attribute__((packed)) --> __packed Also unify __attribute__ ((..)) to __attribute__((..)) and handle ((__packed__)) like ((packed)) Change-Id: Ie60a51c3fa92b5009724a5b7c2932e361bf3490c Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/15921 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/commonlib/fsp_relocate.c | 3 ++- src/commonlib/include/commonlib/cbfs_serialized.h | 21 +++++++++++---------- src/commonlib/include/commonlib/fmap_serialized.h | 5 +++-- src/commonlib/include/commonlib/rmodule-defs.h | 3 ++- .../include/commonlib/timestamp_serialized.h | 5 +++-- src/commonlib/lz4_wrapper.c | 5 +++-- 6 files changed, 24 insertions(+), 18 deletions(-) (limited to 'src/commonlib') diff --git a/src/commonlib/fsp_relocate.c b/src/commonlib/fsp_relocate.c index fd5a348c16..d96edd2178 100644 --- a/src/commonlib/fsp_relocate.c +++ b/src/commonlib/fsp_relocate.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -67,7 +68,7 @@ struct fsp_patch_table { uint8_t reserved; uint32_t patch_entry_num; uint32_t patch_entries[0]; -} __attribute__((packed)); +} __packed; #define FSPP_SIG 0x50505346 diff --git a/src/commonlib/include/commonlib/cbfs_serialized.h b/src/commonlib/include/commonlib/cbfs_serialized.h index 706f175268..9273b35958 100644 --- a/src/commonlib/include/commonlib/cbfs_serialized.h +++ b/src/commonlib/include/commonlib/cbfs_serialized.h @@ -48,6 +48,7 @@ #define _CBFS_SERIALIZED_H_ #include +#include /** These are standard values for the known compression algorithms that coreboot knows about for stages and @@ -101,7 +102,7 @@ struct cbfs_header { uint32_t offset; uint32_t architecture; uint32_t pad[1]; -} __attribute__((packed)); +} __packed; /* this used to be flexible, but wasn't ever set to something different. */ #define CBFS_ALIGNMENT 64 @@ -136,7 +137,7 @@ struct cbfs_file { uint32_t type; uint32_t attributes_offset; uint32_t offset; -} __attribute__((packed)); +} __packed; /* The common fields of extended cbfs file attributes. Attributes are expected to start with tag/len, then append their @@ -146,7 +147,7 @@ struct cbfs_file_attribute { /* len covers the whole structure, incl. tag and len */ uint32_t len; uint8_t data[0]; -} __attribute__((packed)); +} __packed; /* Depending on how the header was initialized, it may be backed with 0x00 or * 0xff. Support both. */ @@ -163,7 +164,7 @@ struct cbfs_file_attr_compression { /* whole file compression format. 0 if no compression. */ uint32_t compression; uint32_t decompressed_size; -} __attribute__((packed)); +} __packed; struct cbfs_file_attr_hash { uint32_t tag; @@ -171,19 +172,19 @@ struct cbfs_file_attr_hash { uint32_t hash_type; /* hash_data is len - sizeof(struct) bytes */ uint8_t hash_data[]; -} __attribute__((packed)); +} __packed; struct cbfs_file_attr_position { uint32_t tag; uint32_t len; uint32_t position; -} __attribute__((packed)); +} __packed; struct cbfs_file_attr_align { uint32_t tag; uint32_t len; uint32_t alignment; -} __attribute__((packed)); +} __packed; /* * ROMCC does not understand uint64_t, so we hide future definitions as they are @@ -205,7 +206,7 @@ struct cbfs_stage { uint64_t load; /** Where to load in memory */ uint32_t len; /** length of data to load */ uint32_t memlen; /** total length of object in memory */ -} __attribute__((packed)); +} __packed; /** this is the sub-header for payload components. Payloads are loaded by coreboot at the end of the boot process */ @@ -217,7 +218,7 @@ struct cbfs_payload_segment { uint64_t load_addr; uint32_t len; uint32_t mem_len; -} __attribute__((packed)); +} __packed; struct cbfs_payload { struct cbfs_payload_segment segments; @@ -232,7 +233,7 @@ struct cbfs_payload { struct cbfs_optionrom { uint32_t compression; uint32_t len; -} __attribute__((packed)); +} __packed; #endif /* __ROMCC__ */ diff --git a/src/commonlib/include/commonlib/fmap_serialized.h b/src/commonlib/include/commonlib/fmap_serialized.h index 3585f0bc84..cea231b2c2 100644 --- a/src/commonlib/include/commonlib/fmap_serialized.h +++ b/src/commonlib/include/commonlib/fmap_serialized.h @@ -37,6 +37,7 @@ #define FLASHMAP_SERIALIZED_H__ #include +#include #define FMAP_SIGNATURE "__FMAP__" #define FMAP_VER_MAJOR 1 /* this header's FMAP minor version */ @@ -56,7 +57,7 @@ struct fmap_area { uint32_t size; /* size in bytes */ uint8_t name[FMAP_STRLEN]; /* descriptive name */ uint16_t flags; /* flags for this area */ -} __attribute__((packed)); +} __packed; struct fmap { uint8_t signature[8]; /* "__FMAP__" (0x5F5F464D41505F5F) */ @@ -68,6 +69,6 @@ struct fmap { uint16_t nareas; /* number of areas described by fmap_areas[] below */ struct fmap_area areas[]; -} __attribute__((packed)); +} __packed; #endif /* FLASHMAP_SERIALIZED_H__ */ diff --git a/src/commonlib/include/commonlib/rmodule-defs.h b/src/commonlib/include/commonlib/rmodule-defs.h index 0922c811fd..485d6383bf 100644 --- a/src/commonlib/include/commonlib/rmodule-defs.h +++ b/src/commonlib/include/commonlib/rmodule-defs.h @@ -17,6 +17,7 @@ #include #include +#include #define RMODULE_MAGIC 0xf8fe #define RMODULE_VERSION_1 1 @@ -54,6 +55,6 @@ struct rmodule_header { uint32_t bss_end; /* Add some room for growth. */ uint32_t padding[4]; -} __attribute__ ((packed)); +} __packed; #endif /* RMODULE_DEFS_H */ diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h index ee5cd6f6e0..60feffed87 100644 --- a/src/commonlib/include/commonlib/timestamp_serialized.h +++ b/src/commonlib/include/commonlib/timestamp_serialized.h @@ -17,11 +17,12 @@ #define __TIMESTAMP_SERIALIZED_H__ #include +#include struct timestamp_entry { uint32_t entry_id; uint64_t entry_stamp; -} __attribute__((packed)); +} __packed; struct timestamp_table { uint64_t base_time; @@ -29,7 +30,7 @@ struct timestamp_table { uint16_t tick_freq_mhz; uint32_t num_entries; struct timestamp_entry entries[0]; /* Variable number of entries */ -} __attribute__((packed)); +} __packed; enum timestamp_id { TS_START_ROMSTAGE = 1, diff --git a/src/commonlib/lz4_wrapper.c b/src/commonlib/lz4_wrapper.c index 98f2533cab..4050ac9bb3 100644 --- a/src/commonlib/lz4_wrapper.c +++ b/src/commonlib/lz4_wrapper.c @@ -34,6 +34,7 @@ #include #include #include +#include /* LZ4 comes with its own supposedly portable memory access functions, but they * seem to be very inefficient in practice (at least on ARM64). Since coreboot @@ -115,7 +116,7 @@ struct lz4_frame_header { }; /* + uint64_t content_size iff has_content_size is set */ /* + uint8_t header_checksum */ -} __attribute__((packed)); +} __packed; struct lz4_block_header { union { @@ -127,7 +128,7 @@ struct lz4_block_header { }; /* + size bytes of data */ /* + uint32_t block_checksum iff has_block_checksum is set */ -} __attribute__((packed)); +} __packed; size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn) { -- cgit v1.2.3