summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2017-07-13 02:20:27 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2017-07-13 19:45:59 +0000
commit6a00113de8b9060a7227bcfa79b3786e3e592a33 (patch)
tree467f5653272ed2d16f6d8033ed8cd0e7391fb426 /src/lib
parent9f244a5494192707bfbb72e60f17411e9a35434a (diff)
Rename __attribute__((packed)) --> __packed
Also unify __attribute__ ((..)) to __attribute__((..)) and handle ((__packed__)) like ((packed)) Change-Id: Ie60a51c3fa92b5009724a5b7c2932e361bf3490c Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/15921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbmem_console.c3
-rw-r--r--src/lib/gcov-io.h26
-rw-r--r--src/lib/imd.c7
-rw-r--r--src/lib/libgcov.c18
-rw-r--r--src/lib/prog_ops.c6
-rw-r--r--src/lib/timestamp.c3
-rw-r--r--src/lib/tpm2_tlcl_structures.h5
7 files changed, 36 insertions, 32 deletions
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c
index 34363904b5..d9716700bb 100644
--- a/src/lib/cbmem_console.c
+++ b/src/lib/cbmem_console.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <compiler.h>
#include <console/console.h>
#include <console/cbmem_console.h>
#include <console/uart.h>
@@ -43,7 +44,7 @@ struct cbmem_console {
u32 size;
u32 cursor;
u8 body[0];
-} __attribute__ ((__packed__));
+} __packed;
#define MAX_SIZE (1 << 28) /* can't be changed without breaking readers! */
#define CURSOR_MASK (MAX_SIZE - 1) /* bits 31-28 are reserved for flags */
diff --git a/src/lib/gcov-io.h b/src/lib/gcov-io.h
index e2c0e0d756..4c0b2e4e42 100644
--- a/src/lib/gcov-io.h
+++ b/src/lib/gcov-io.h
@@ -181,29 +181,29 @@ permissions described in the GCC Runtime Library Exception, version
/* About the target */
#if BITS_PER_UNIT == 8
-typedef unsigned int gcov_unsigned_t __attribute__ ((mode(SI)));
-typedef unsigned int gcov_position_t __attribute__ ((mode(SI)));
+typedef unsigned int gcov_unsigned_t __attribute__((mode(SI)));
+typedef unsigned int gcov_position_t __attribute__((mode(SI)));
#if LONG_LONG_TYPE_SIZE > 32
-typedef signed gcov_type __attribute__ ((mode(DI)));
+typedef signed gcov_type __attribute__((mode(DI)));
#else
-typedef signed gcov_type __attribute__ ((mode(SI)));
+typedef signed gcov_type __attribute__((mode(SI)));
#endif
#else
#if BITS_PER_UNIT == 16
-typedef unsigned int gcov_unsigned_t __attribute__ ((mode(HI)));
-typedef unsigned int gcov_position_t __attribute__ ((mode(HI)));
+typedef unsigned int gcov_unsigned_t __attribute__((mode(HI)));
+typedef unsigned int gcov_position_t __attribute__((mode(HI)));
#if LONG_LONG_TYPE_SIZE > 32
-typedef signed gcov_type __attribute__ ((mode(SI)));
+typedef signed gcov_type __attribute__((mode(SI)));
#else
-typedef signed gcov_type __attribute__ ((mode(HI)));
+typedef signed gcov_type __attribute__((mode(HI)));
#endif
#else
-typedef unsigned int gcov_unsigned_t __attribute__ ((mode(QI)));
-typedef unsigned int gcov_position_t __attribute__ ((mode(QI)));
+typedef unsigned int gcov_unsigned_t __attribute__((mode(QI)));
+typedef unsigned int gcov_position_t __attribute__((mode(QI)));
#if LONG_LONG_TYPE_SIZE > 32
-typedef signed gcov_type __attribute__ ((mode(HI)));
+typedef signed gcov_type __attribute__((mode(HI)));
#else
-typedef signed gcov_type __attribute__ ((mode(QI)));
+typedef signed gcov_type __attribute__((mode(QI)));
#endif
#endif
#endif
@@ -270,7 +270,7 @@ typedef HOST_WIDEST_INT gcov_type;
#pragma GCC poison gcov_read_string gcov_sync gcov_time gcov_magic
#ifdef HAVE_GAS_HIDDEN
-#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__("hidden")))
+#define ATTRIBUTE_HIDDEN __attribute__((__visibility__("hidden")))
#else
#define ATTRIBUTE_HIDDEN
#endif
diff --git a/src/lib/imd.c b/src/lib/imd.c
index 8f65fa8285..d17cc815ce 100644
--- a/src/lib/imd.c
+++ b/src/lib/imd.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <compiler.h>
#include <assert.h>
#include <cbmem.h>
#include <console/console.h>
@@ -32,7 +33,7 @@ struct imd_root_pointer {
uint32_t magic;
/* Relative to upper limit/offset. */
int32_t root_offset;
-} __attribute__((packed));
+} __packed;
struct imd_entry {
uint32_t magic;
@@ -40,7 +41,7 @@ struct imd_entry {
int32_t start_offset;
uint32_t size;
uint32_t id;
-} __attribute__((packed));
+} __packed;
struct imd_root {
uint32_t max_entries;
@@ -50,7 +51,7 @@ struct imd_root {
/* Used for fixing the size of an imd. Relative to the root. */
int32_t max_offset;
struct imd_entry entries[0];
-} __attribute__((packed));
+} __packed;
#define IMD_FLAG_LOCKED 1
diff --git a/src/lib/libgcov.c b/src/lib/libgcov.c
index ca5021f834..70a4073253 100644
--- a/src/lib/libgcov.c
+++ b/src/lib/libgcov.c
@@ -73,23 +73,23 @@ typedef s32 pid_t;
/* If libc and its header files are not available, provide dummy functions. */
#ifdef L_gcov
-void __gcov_init(struct gcov_info *p __attribute__ ((unused))) {}
+void __gcov_init(struct gcov_info *p __attribute__((unused))) {}
void __gcov_flush(void) {}
#endif
#ifdef L_gcov_merge_add
-void __gcov_merge_add(gcov_type *counters __attribute__ ((unused)),
- unsigned int n_counters __attribute__ ((unused))) {}
+void __gcov_merge_add(gcov_type *counters __attribute__((unused)),
+ unsigned int n_counters __attribute__((unused))) {}
#endif
#ifdef L_gcov_merge_single
-void __gcov_merge_single(gcov_type *counters __attribute__ ((unused)),
- unsigned int n_counters __attribute__ ((unused))) {}
+void __gcov_merge_single(gcov_type *counters __attribute__((unused)),
+ unsigned int n_counters __attribute__((unused))) {}
#endif
#ifdef L_gcov_merge_delta
-void __gcov_merge_delta(gcov_type *counters __attribute__ ((unused)),
- unsigned int n_counters __attribute__ ((unused))) {}
+void __gcov_merge_delta(gcov_type *counters __attribute__((unused)),
+ unsigned int n_counters __attribute__((unused))) {}
#endif
#else
@@ -102,8 +102,8 @@ void __gcov_merge_delta(gcov_type *counters __attribute__ ((unused)),
#include <sys/stat.h>
#endif
#else
-void __gcov_merge_add(gcov_type *counters __attribute__ ((unused)),
- unsigned int n_counters __attribute__ ((unused))) {}
+void __gcov_merge_add(gcov_type *counters __attribute__((unused)),
+ unsigned int n_counters __attribute__((unused))) {}
#endif /* __COREBOOT__ */
#ifdef L_gcov
diff --git a/src/lib/prog_ops.c b/src/lib/prog_ops.c
index bc889fceae..44a32d19bf 100644
--- a/src/lib/prog_ops.c
+++ b/src/lib/prog_ops.c
@@ -23,13 +23,13 @@ void prog_segment_loaded(uintptr_t start, size_t size, int flags)
arch_segment_loaded(start, size, flags);
}
-void __attribute__ ((weak)) platform_segment_loaded(uintptr_t start,
+void __attribute__((weak)) platform_segment_loaded(uintptr_t start,
size_t size, int flags)
{
/* do nothing */
}
-void __attribute__ ((weak)) arch_segment_loaded(uintptr_t start, size_t size,
+void __attribute__((weak)) arch_segment_loaded(uintptr_t start, size_t size,
int flags)
{
/* do nothing */
@@ -41,7 +41,7 @@ void prog_run(struct prog *prog)
arch_prog_run(prog);
}
-void __attribute__ ((weak)) platform_prog_run(struct prog *prog)
+void __attribute__((weak)) platform_prog_run(struct prog *prog)
{
/* do nothing */
}
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 5f84cf4ac8..816f28fd85 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -16,6 +16,7 @@
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
+#include <compiler.h>
#include <console/console.h>
#include <cbmem.h>
#include <symbols.h>
@@ -30,7 +31,7 @@
/* When changing this number, adjust TIMESTAMP() size ASSERT() in memlayout.h */
#define MAX_BSS_TIMESTAMP_CACHE 16
-struct __attribute__((__packed__)) timestamp_cache {
+struct __packed timestamp_cache {
uint32_t cache_state;
struct timestamp_table table;
/* The struct timestamp_table has a 0 length array as its last field.
diff --git a/src/lib/tpm2_tlcl_structures.h b/src/lib/tpm2_tlcl_structures.h
index 4ea20783e5..2a6615df42 100644
--- a/src/lib/tpm2_tlcl_structures.h
+++ b/src/lib/tpm2_tlcl_structures.h
@@ -12,6 +12,7 @@
* constants and structures needed for functions used in coreboot.
*/
#include <stdint.h>
+#include <compiler.h>
#include <tpm_lite/tlcl.h>
#include <types.h>
@@ -56,7 +57,7 @@ struct tpm_header {
uint16_t tpm_tag;
uint32_t tpm_size;
TPM_CC tpm_code;
-} __attribute__((packed));
+} __packed;
/* TPM command codes. */
#define TPM2_Hierarchy_Control ((TPM_CC)0x00000121)
@@ -318,7 +319,7 @@ struct tpm2_session_header {
union {
struct tpm2_session_attrs session_attr_bits;
uint8_t session_attrs;
- } __attribute__((packed));
+ } __packed;
uint16_t auth_size;
uint8_t *auth;
};