compiler.h: add __weak macro

Instead of writing out '__attribute__((weak))' use a shorter form.

Change-Id: If418a1d55052780077febd2d8f2089021f414b91
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/25767
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
This commit is contained in:
Aaron Durbin
2018-04-21 14:45:32 -06:00
parent 38fd6685e9
commit 6403167d29
137 changed files with 408 additions and 277 deletions

View File

@ -16,6 +16,7 @@
*/
#include <arch/cbconfig.h>
#include <compiler.h>
#include <console/console.h>
#include <console/uart.h>
#include <ip_checksum.h>
@ -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)