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>
This commit is contained in:
Stefan Reinauer
2017-07-13 02:20:27 +02:00
parent 9f244a5494
commit 6a00113de8
229 changed files with 1020 additions and 704 deletions

View File

@@ -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 */

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 */
}

View File

@@ -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.

View File

@@ -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;
};