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/cpu/x86/smm/smihandler.c | 15 ++++++++------- src/cpu/x86/smm/smm_module_handler.c | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'src/cpu/x86') diff --git a/src/cpu/x86/smm/smihandler.c b/src/cpu/x86/smm/smihandler.c index fa5658e25e..d888e4410b 100644 --- a/src/cpu/x86/smm/smihandler.c +++ b/src/cpu/x86/smm/smihandler.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -208,13 +209,13 @@ void smi_handler(u32 smm_revision) * entries in the modules make sense. Without default implementations the * weak relocations w/o a symbol have a 0 address which is where the modules * are linked at. */ -int __attribute__((weak)) mainboard_io_trap_handler(int smif) { return 0; } -void __attribute__((weak)) cpu_smi_handler(unsigned int node, +int __weak mainboard_io_trap_handler(int smif) { return 0; } +void __weak cpu_smi_handler(unsigned int node, smm_state_save_area_t *state_save) {} -void __attribute__((weak)) northbridge_smi_handler(unsigned int node, +void __weak northbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save) {} -void __attribute__((weak)) southbridge_smi_handler(unsigned int node, +void __weak southbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save) {} -void __attribute__((weak)) mainboard_smi_gpi(u32 gpi_sts) {} -int __attribute__((weak)) mainboard_smi_apmc(u8 data) { return 0; } -void __attribute__((weak)) mainboard_smi_sleep(u8 slp_typ) {} +void __weak mainboard_smi_gpi(u32 gpi_sts) {} +int __weak mainboard_smi_apmc(u8 data) { return 0; } +void __weak mainboard_smi_sleep(u8 slp_typ) {} diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index c622e45c3d..c2001ec9e2 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -182,10 +183,10 @@ RMODULE_ENTRY(smm_handler_start); * entries in the modules make sense. Without default implementations the * weak relocations w/o a symbol have a 0 address which is where the modules * are linked at. */ -int __attribute__((weak)) mainboard_io_trap_handler(int smif) { return 0; } -void __attribute__((weak)) cpu_smi_handler(void) {} -void __attribute__((weak)) northbridge_smi_handler() {} -void __attribute__((weak)) southbridge_smi_handler() {} -void __attribute__((weak)) mainboard_smi_gpi(u32 gpi_sts) {} -int __attribute__((weak)) mainboard_smi_apmc(u8 data) { return 0; } -void __attribute__((weak)) mainboard_smi_sleep(u8 slp_typ) {} +int __weak mainboard_io_trap_handler(int smif) { return 0; } +void __weak cpu_smi_handler(void) {} +void __weak northbridge_smi_handler() {} +void __weak southbridge_smi_handler() {} +void __weak mainboard_smi_gpi(u32 gpi_sts) {} +int __weak mainboard_smi_apmc(u8 data) { return 0; } +void __weak mainboard_smi_sleep(u8 slp_typ) {} -- cgit v1.2.3