From 48b3dbc7483f5404a2dfb3b8bb5f4bcf7d3c4b09 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Mon, 29 Dec 2014 19:36:50 +0200 Subject: x86 SMM: Replace weak prototypes with weak function stub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I682617cd2f4310d3e2e2ab6ffec51def28a4779c Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/7961 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Patrick Georgi --- src/cpu/x86/smm/smihandler.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/cpu/x86/smm') diff --git a/src/cpu/x86/smm/smihandler.c b/src/cpu/x86/smm/smihandler.c index bd03030c4c..cbd6d44bc7 100644 --- a/src/cpu/x86/smm/smihandler.c +++ b/src/cpu/x86/smm/smihandler.c @@ -199,12 +199,9 @@ void smi_handler(u32 smm_revision) } /* Call chipset specific SMI handlers. */ - if (cpu_smi_handler) - cpu_smi_handler(node, &state_save); - if (northbridge_smi_handler) - northbridge_smi_handler(node, &state_save); - if (southbridge_smi_handler) - southbridge_smi_handler(node, &state_save); + cpu_smi_handler(node, &state_save); + northbridge_smi_handler(node, &state_save); + southbridge_smi_handler(node, &state_save); smi_restore_pci_address(); @@ -215,3 +212,15 @@ void smi_handler(u32 smm_revision) /* De-assert SMI# signal to allow another SMI */ smi_set_eos(); } + +/* Provide a default implementation for all weak handlers so that relocation + * 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, smm_state_save_area_t *state_save) {} +void __attribute__((weak)) northbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save) {} +void __attribute__((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) {} -- cgit v1.2.3