summaryrefslogtreecommitdiff
path: root/src/commonlib/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/commonlib/include')
-rw-r--r--src/commonlib/include/commonlib/cbfs_serialized.h21
-rw-r--r--src/commonlib/include/commonlib/fmap_serialized.h5
-rw-r--r--src/commonlib/include/commonlib/rmodule-defs.h3
-rw-r--r--src/commonlib/include/commonlib/timestamp_serialized.h5
4 files changed, 19 insertions, 15 deletions
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 <stdint.h>
+#include <compiler.h>
/** 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 <stdint.h>
+#include <compiler.h>
#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 <stdint.h>
#include <stddef.h>
+#include <compiler.h>
#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 <stdint.h>
+#include <compiler.h>
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,