Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51185 )
Change subject: cpu/x86/mp_init.c: Use C code instead of CPP ......................................................................
cpu/x86/mp_init.c: Use C code instead of CPP
Change-Id: If67bcbf0c8ffbd041e2e4cab8496f4634de26552 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/mp_init.c M src/include/cpu/x86/smm.h 2 files changed, 9 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/51185/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 4d533e6..be26d3d 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -730,16 +730,16 @@ * the location of the new SMBASE. If using SMM modules then this * calculation needs to match that of the module loader. */ -#if CONFIG(X86_SMM_LOADER_VERSION2) - perm_smbase = smm_get_cpu_smbase(cpu); - if (!perm_smbase) { - printk(BIOS_ERR, "%s: bad SMBASE for CPU %d\n", __func__, cpu); - return; + if (CONFIG(X86_SMM_LOADER_VERSION2)) { + perm_smbase = smm_get_cpu_smbase(cpu); + if (!perm_smbase) { + printk(BIOS_ERR, "%s: bad SMBASE for CPU %d\n", __func__, cpu); + return; + } + } else { + perm_smbase = mp_state.perm_smbase; + perm_smbase -= cpu * mp_state.smm_save_state_size; } -#else - perm_smbase = mp_state.perm_smbase; - perm_smbase -= cpu * mp_state.smm_save_state_size; -#endif
/* Setup code checks this callback for validity. */ printk(BIOS_INFO, "%s : curr_smbase 0x%x perm_smbase 0x%x, cpu = %d\n", diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index 72769bc..35b3da1 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -163,9 +163,7 @@ int smm_setup_relocation_handler(struct smm_loader_params *params); int smm_load_module(void *smram, size_t size, struct smm_loader_params *params);
-#if CONFIG(X86_SMM_LOADER_VERSION2) u32 smm_get_cpu_smbase(unsigned int cpu_num); -#endif
/* Backup and restore default SMM region. */ void *backup_default_smm_area(void);