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

@@ -15,6 +15,7 @@
*/
#include <arch/io.h>
#include <compiler.h>
#include <console/console.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>
@@ -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) {}