Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14556
-gerrit
commit b116f17c2d8f39b31a943c98f2988f5202fe4571 Author: Aaron Durbin adurbin@chromium.org Date: Fri Apr 29 23:15:12 2016 -0500
cpu/x86/mp_init: remove unused callback arguments
The BSP and AP callback declarations both had an optional argument that could be passed. In pratice that functionality was never used so drop it.
Change-Id: I47fa814a593b6c2ee164c88d255178d3fb71e8ce Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/cpu/intel/haswell/haswell_init.c | 12 ++++++------ src/cpu/x86/mp_init.c | 6 +++--- src/include/cpu/x86/mp.h | 18 +++++++----------- src/soc/intel/apollolake/cpu.c | 2 +- src/soc/intel/baytrail/cpu.c | 14 +++++++------- src/soc/intel/braswell/cpu.c | 20 ++++++++++---------- src/soc/intel/broadwell/cpu.c | 12 ++++++------ src/soc/intel/fsp_baytrail/cpu.c | 16 ++++++++-------- src/soc/intel/fsp_broadwell_de/cpu.c | 2 +- src/soc/intel/skylake/cpu.c | 12 ++++++------ 10 files changed, 55 insertions(+), 59 deletions(-)
diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c index b4bff83..f488ef6 100644 --- a/src/cpu/intel/haswell/haswell_init.c +++ b/src/cpu/intel/haswell/haswell_init.c @@ -772,7 +772,7 @@ static int adjust_apic_id_ht_disabled(int index, int apic_id) return 2 * index; }
-static void relocate_and_load_microcode(void *unused) +static void relocate_and_load_microcode(void) { /* Relocate the SMM handler. */ smm_relocate(); @@ -781,7 +781,7 @@ static void relocate_and_load_microcode(void *unused) intel_microcode_load_unlocked(microcode_patch); }
-static void enable_smis(void *unused) +static void enable_smis(void) { /* Now that all APs have been relocated as well as the BSP let SMIs * start flowing. */ @@ -792,11 +792,11 @@ static void enable_smis(void *unused) }
static struct mp_flight_record mp_steps[] = { - MP_FR_NOBLOCK_APS(relocate_and_load_microcode, NULL, - relocate_and_load_microcode, NULL), - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_NOBLOCK_APS(relocate_and_load_microcode, + relocate_and_load_microcode), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), /* Wait for APs to finish initialization before proceeding. */ - MP_FR_BLOCK_APS(NULL, NULL, enable_smis, NULL), + MP_FR_BLOCK_APS(NULL, enable_smis), };
void bsp_init_and_start_aps(struct bus *cpu_bus) diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 184dc4f..2180d98 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -129,7 +129,7 @@ static void ap_do_flight_plan(void) barrier_wait(&rec->barrier);
if (rec->ap_call != NULL) { - rec->ap_call(rec->ap_arg); + rec->ap_call(); } } } @@ -477,7 +477,7 @@ static int bsp_do_flight_plan(struct mp_params *mp_params) }
if (rec->bsp_call != NULL) { - rec->bsp_call(rec->bsp_arg); + rec->bsp_call(); }
release_barrier(&rec->barrier); @@ -563,7 +563,7 @@ int mp_init(struct bus *cpu_bus, struct mp_params *p) return bsp_do_flight_plan(p); }
-void mp_initialize_cpu(void *unused) +void mp_initialize_cpu(void) { /* Call back into driver infrastructure for the AP initialization. */ struct cpu_info *info = cpu_info(); diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h index 1feab68..3227975 100644 --- a/src/include/cpu/x86/mp.h +++ b/src/include/cpu/x86/mp.h @@ -28,7 +28,7 @@ static inline void mfence(void) __asm__ __volatile__("mfence\t\n": : :"memory"); }
-typedef void (*mp_callback_t)(void *arg); +typedef void (*mp_callback_t)(void);
/* * A mp_flight_record details a sequence of calls for the APs to perform @@ -47,26 +47,22 @@ struct mp_flight_record { atomic_t barrier; atomic_t cpus_entered; mp_callback_t ap_call; - void *ap_arg; mp_callback_t bsp_call; - void *bsp_arg; } __attribute__((aligned(CACHELINE_SIZE)));
-#define _MP_FLIGHT_RECORD(barrier_, ap_func_, ap_arg_, bsp_func_, bsp_arg_) \ +#define _MP_FLIGHT_RECORD(barrier_, ap_func_, bsp_func_) \ { \ .barrier = ATOMIC_INIT(barrier_), \ .cpus_entered = ATOMIC_INIT(0), \ .ap_call = ap_func_, \ - .ap_arg = ap_arg_, \ .bsp_call = bsp_func_, \ - .bsp_arg = bsp_arg_, \ }
-#define MP_FR_BLOCK_APS(ap_func_, ap_arg_, bsp_func_, bsp_arg_) \ - _MP_FLIGHT_RECORD(0, ap_func_, ap_arg_, bsp_func_, bsp_arg_) +#define MP_FR_BLOCK_APS(ap_func_, bsp_func_) \ + _MP_FLIGHT_RECORD(0, ap_func_, bsp_func_)
-#define MP_FR_NOBLOCK_APS(ap_func_, ap_arg_, bsp_func_, bsp_arg_) \ - _MP_FLIGHT_RECORD(1, ap_func_, ap_arg_, bsp_func_, bsp_arg_) +#define MP_FR_NOBLOCK_APS(ap_func_, bsp_func_) \ + _MP_FLIGHT_RECORD(1, ap_func_, bsp_func_)
/* The mp_params structure provides the arguments to the mp subsystem * for bringing up APs. */ @@ -108,7 +104,7 @@ int mp_init(struct bus *cpu_bus, struct mp_params *params); */
/* Calls cpu_initialize(info->index) which calls the coreboot CPU drivers. */ -void mp_initialize_cpu(void *unused); +void mp_initialize_cpu(void);
/* Returns apic id for coreboot cpu number or < 0 on failure. */ int mp_get_apic_id(int cpu_slot); diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c index 03fae0e..21cd33a 100644 --- a/src/soc/intel/apollolake/cpu.c +++ b/src/soc/intel/apollolake/cpu.c @@ -71,7 +71,7 @@ static void bsp_pre_mp_setup(void) */ static struct mp_flight_record flight_plan[] = { /* NOTE: MTRR solution must be calculated before firing up the APs */ - MP_FR_NOBLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_NOBLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), };
void apollolake_init_cpus(device_t dev) diff --git a/src/soc/intel/baytrail/cpu.c b/src/soc/intel/baytrail/cpu.c index 6188689..fd9c7fb 100644 --- a/src/soc/intel/baytrail/cpu.c +++ b/src/soc/intel/baytrail/cpu.c @@ -32,14 +32,14 @@ #include <soc/ramstage.h> #include <soc/smm.h>
-static void smm_relocate(void *unused); -static void enable_smis(void *unused); +static void smm_relocate(void); +static void enable_smis(void);
static struct mp_flight_record mp_steps[] = { - MP_FR_BLOCK_APS(smm_relocate, NULL, smm_relocate, NULL), - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_BLOCK_APS(smm_relocate, smm_relocate), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), /* Wait for APs to finish initialization before proceeding. */ - MP_FR_BLOCK_APS(NULL, NULL, enable_smis, NULL), + MP_FR_BLOCK_APS(NULL, enable_smis), };
/* The APIC id space on Bay Trail is sparse. Each id is separated by 2. */ @@ -278,7 +278,7 @@ static int smm_load_handlers(void) return 0; }
-static void smm_relocate(void *unused) +static void smm_relocate(void) { const struct pattrs *pattrs = pattrs_get();
@@ -298,7 +298,7 @@ static void smm_relocate(void *unused) intel_microcode_load_unlocked(pattrs->microcode_patch); }
-static void enable_smis(void *unused) +static void enable_smis(void) { southcluster_smm_enable_smi(); } diff --git a/src/soc/intel/braswell/cpu.c b/src/soc/intel/braswell/cpu.c index 71af487..3d682b7 100644 --- a/src/soc/intel/braswell/cpu.c +++ b/src/soc/intel/braswell/cpu.c @@ -33,16 +33,16 @@ #include <soc/smm.h> #include <stdlib.h>
-static void smm_relocate(void *unused); -static void enable_smis(void *unused); -static void pre_smm_relocation(void *unused); +static void smm_relocate(void); +static void enable_smis(void); +static void pre_smm_relocation(void);
static struct mp_flight_record mp_steps[] = { - MP_FR_BLOCK_APS(pre_smm_relocation, NULL, pre_smm_relocation, NULL), - MP_FR_BLOCK_APS(smm_relocate, NULL, smm_relocate, NULL), - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_BLOCK_APS(pre_smm_relocation, pre_smm_relocation), + MP_FR_BLOCK_APS(smm_relocate, smm_relocate), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), /* Wait for APs to finish initialization before proceeding. */ - MP_FR_BLOCK_APS(NULL, NULL, enable_smis, NULL), + MP_FR_BLOCK_APS(NULL, enable_smis), };
/* The APIC id space is sparse. Each id is separated by 2. */ @@ -299,7 +299,7 @@ static int smm_load_handlers(void) return 0; }
-static void pre_smm_relocation(void *unused) +static void pre_smm_relocation(void) { const struct pattrs *pattrs = pattrs_get(); msr_t msr_value; @@ -310,7 +310,7 @@ static void pre_smm_relocation(void *unused) intel_microcode_load_unlocked(pattrs->microcode_patch); }
-static void smm_relocate(void *unused) +static void smm_relocate(void) { const struct pattrs *pattrs = pattrs_get();
@@ -330,7 +330,7 @@ static void smm_relocate(void *unused) intel_microcode_load_unlocked(pattrs->microcode_patch); }
-static void enable_smis(void *unused) +static void enable_smis(void) { southcluster_smm_enable_smi(); } diff --git a/src/soc/intel/broadwell/cpu.c b/src/soc/intel/broadwell/cpu.c index 5f3fb15..15c003e 100644 --- a/src/soc/intel/broadwell/cpu.c +++ b/src/soc/intel/broadwell/cpu.c @@ -619,7 +619,7 @@ static int adjust_apic_id_ht_disabled(int index, int apic_id) return 2 * index; }
-static void relocate_and_load_microcode(void *unused) +static void relocate_and_load_microcode(void) { /* Relocate the SMM handler. */ smm_relocate(); @@ -628,7 +628,7 @@ static void relocate_and_load_microcode(void *unused) intel_microcode_load_unlocked(microcode_patch); }
-static void enable_smis(void *unused) +static void enable_smis(void) { /* Now that all APs have been relocated as well as the BSP let SMIs * start flowing. */ @@ -639,11 +639,11 @@ static void enable_smis(void *unused) }
static struct mp_flight_record mp_steps[] = { - MP_FR_NOBLOCK_APS(relocate_and_load_microcode, NULL, - relocate_and_load_microcode, NULL), - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_NOBLOCK_APS(relocate_and_load_microcode, + relocate_and_load_microcode), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), /* Wait for APs to finish initialization before proceeding. */ - MP_FR_BLOCK_APS(NULL, NULL, enable_smis, NULL), + MP_FR_BLOCK_APS(NULL, enable_smis), };
static struct device_operations cpu_dev_ops = { diff --git a/src/soc/intel/fsp_baytrail/cpu.c b/src/soc/intel/fsp_baytrail/cpu.c index 1fed554..3856a06 100644 --- a/src/soc/intel/fsp_baytrail/cpu.c +++ b/src/soc/intel/fsp_baytrail/cpu.c @@ -33,18 +33,18 @@ #if IS_ENABLED(CONFIG_HAVE_SMI_HANDLER) #include <soc/smm.h>
-static void smm_relocate(void *unused); -static void enable_smis(void *unused); +static void smm_relocate(void); +static void enable_smis(void);
static struct mp_flight_record mp_steps[] = { - MP_FR_BLOCK_APS(smm_relocate, NULL, smm_relocate, NULL), - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_BLOCK_APS(smm_relocate, smm_relocate), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), /* Wait for APs to finish initialization before proceeding. */ - MP_FR_BLOCK_APS(NULL, NULL, enable_smis, NULL), + MP_FR_BLOCK_APS(NULL, enable_smis), }; #else /* CONFIG_HAVE_SMI_HANDLER */ static struct mp_flight_record mp_steps[] = { - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), }; #endif
@@ -252,7 +252,7 @@ static int smm_load_handlers(void) return 0; }
-static void smm_relocate(void *unused) +static void smm_relocate(void) {
/* Load relocation and permanent handler. */ @@ -268,7 +268,7 @@ static void smm_relocate(void *unused) smm_initiate_relocation(); }
-static void enable_smis(void *unused) +static void enable_smis(void) { southcluster_smm_enable_smi(); } diff --git a/src/soc/intel/fsp_broadwell_de/cpu.c b/src/soc/intel/fsp_broadwell_de/cpu.c index 173e978..2f6487a 100644 --- a/src/soc/intel/fsp_broadwell_de/cpu.c +++ b/src/soc/intel/fsp_broadwell_de/cpu.c @@ -30,7 +30,7 @@ static void configure_mca(void);
static struct mp_flight_record mp_steps[] = { - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), };
static int adjust_apic_id(int index, int apic_id) diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c index 38c5b52..17fa0ae 100644 --- a/src/soc/intel/skylake/cpu.c +++ b/src/soc/intel/skylake/cpu.c @@ -391,7 +391,7 @@ static int adjust_apic_id_ht_disabled(int index, int apic_id) return 2 * index; }
-static void relocate_and_load_microcode(void *unused) +static void relocate_and_load_microcode(void) { /* Relocate the SMM handler. */ smm_relocate(); @@ -400,7 +400,7 @@ static void relocate_and_load_microcode(void *unused) intel_microcode_load_unlocked(microcode_patch); }
-static void enable_smis(void *unused) +static void enable_smis(void) { /* * Now that all APs have been relocated as well as the BSP let SMIs @@ -415,13 +415,13 @@ static void enable_smis(void *unused) }
static struct mp_flight_record mp_steps[] = { - MP_FR_NOBLOCK_APS(relocate_and_load_microcode, NULL, - relocate_and_load_microcode, NULL), + MP_FR_NOBLOCK_APS(relocate_and_load_microcode, + relocate_and_load_microcode), #if IS_ENABLED(CONFIG_SMP) - MP_FR_BLOCK_APS(mp_initialize_cpu, NULL, mp_initialize_cpu, NULL), + MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), /* Wait for APs to finish initialization before proceeding. */ #endif - MP_FR_BLOCK_APS(NULL, NULL, enable_smis, NULL), + MP_FR_BLOCK_APS(NULL, enable_smis), };
static struct device_operations cpu_dev_ops = {