From 6403167d290da235a732bd2d6157aa2124fb403a Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sat, 21 Apr 2018 14:45:32 -0600 Subject: compiler.h: add __weak macro Instead of writing out '__attribute__((weak))' use a shorter form. Change-Id: If418a1d55052780077febd2d8f2089021f414b91 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25767 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Justin TerAvest --- src/lib/coreboot_table.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/lib/coreboot_table.c') diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index e786443cf6..2970215034 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -244,9 +245,9 @@ static inline void lb_vboot_handoff(struct lb_header *header) {} #endif /* CONFIG_VBOOT */ #endif /* CONFIG_CHROMEOS */ -__attribute__((weak)) uint32_t board_id(void) { return UNDEFINED_STRAPPING_ID; } -__attribute__((weak)) uint32_t ram_code(void) { return UNDEFINED_STRAPPING_ID; } -__attribute__((weak)) uint32_t sku_id(void) { return UNDEFINED_STRAPPING_ID; } +__weak uint32_t board_id(void) { return UNDEFINED_STRAPPING_ID; } +__weak uint32_t ram_code(void) { return UNDEFINED_STRAPPING_ID; } +__weak uint32_t sku_id(void) { return UNDEFINED_STRAPPING_ID; } static void lb_board_id(struct lb_header *header) { @@ -441,7 +442,7 @@ static void lb_record_version_timestamp(struct lb_header *header) rec->timestamp = coreboot_version_timestamp; } -void __attribute__((weak)) lb_board(struct lb_header *header) { /* NOOP */ } +void __weak lb_board(struct lb_header *header) { /* NOOP */ } /* * It's possible that the system is using a SPI flash as the boot device, @@ -449,7 +450,7 @@ void __attribute__((weak)) lb_board(struct lb_header *header) { /* NOOP */ } * case don't provide any information as the correct information is * not known. */ -void __attribute__((weak)) lb_spi_flash(struct lb_header *header) { /* NOOP */ } +void __weak lb_spi_flash(struct lb_header *header) { /* NOOP */ } static struct lb_forward *lb_forward(struct lb_header *header, struct lb_header *next_header) -- cgit v1.2.3