From e09cd1b787c4dbb8e90dcdbc3e053fca927a8483 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Fri, 18 Aug 2017 20:58:33 +0300 Subject: arch/x86: Sanity checking on HAVE_SMI_HANDLER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fail at build-time if one of the following happens: Platform includes SMI handler setup function smm_init() in the build when configuration has HAVE_SMI_HANDLER=n. Platform does not implement smm_init_completion() when HAVE_SMI_HANDLER=y. Change-Id: I7d61c155d2b7c2d71987980db4c25d520452dabf Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21097 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Arthur Heymans --- src/cpu/x86/lapic/lapic_cpu_init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/cpu/x86') diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c index c2ac51374d..898a5c476a 100644 --- a/src/cpu/x86/lapic/lapic_cpu_init.c +++ b/src/cpu/x86/lapic/lapic_cpu_init.c @@ -593,11 +593,13 @@ void initialize_cpus(struct bus *cpu_bus) recover_lowest_1M(); } -/* Platform-specific code for SMI handler overrides this. */ -__attribute__((weak)) void smm_init(void) +#if !IS_ENABLED(CONFIG_HAVE_SMI_HANDLER) +/* Empty stubs for platforms without SMI handlers. */ +void smm_init(void) { } -__attribute__((weak)) void smm_init_completion(void) +void smm_init_completion(void) { } +#endif -- cgit v1.2.3