Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69504 )
Change subject: cpu/cpu.h: Change the function signature ......................................................................
cpu/cpu.h: Change the function signature
There is no need to pass the CPU index around.
Change-Id: Iad8e3cb318e6520ac5877118dbf43597dedb75b9 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/x86/cpu.c M src/cpu/x86/mp_init.c M src/include/cpu/cpu.h 3 files changed, 17 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/69504/1
diff --git a/src/arch/x86/cpu.c b/src/arch/x86/cpu.c index f4cb83a..ed1c15c 100644 --- a/src/arch/x86/cpu.c +++ b/src/arch/x86/cpu.c @@ -228,7 +228,7 @@ return cpus_default_apic_id[logical_cpu]; }
-void cpu_initialize(unsigned int index) +void cpu_initialize(void) { /* Because we busy wait at the printk spinlock. * It is important to keep the number of printed messages @@ -241,7 +241,7 @@
info = cpu_info();
- printk(BIOS_INFO, "Initializing CPU #%d\n", index); + printk(BIOS_INFO, "Initializing CPU #%zd\n", info->index);
cpu = info->cpu; if (!cpu) @@ -283,7 +283,7 @@ } post_log_clear();
- printk(BIOS_INFO, "CPU #%d initialized\n", index); + printk(BIOS_INFO, "CPU #%zd initialized\n", info->index); }
void lb_arch_add_records(struct lb_header *header) diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 0e4a571..87c3fa2 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -628,14 +628,6 @@ return bsp_do_flight_plan(p); }
-/* Calls cpu_initialize(info->index) which calls the coreboot CPU drivers. */ -static void mp_initialize_cpu(void) -{ - /* Call back into driver infrastructure for the AP initialization. */ - struct cpu_info *info = cpu_info(); - cpu_initialize(info->index); -} - void smm_initiate_relocation_parallel(void) { if (lapic_busy()) { @@ -1078,7 +1070,7 @@ /* Perform SMM relocation. */ MP_FR_NOBLOCK_APS(trigger_smm_relocation, trigger_smm_relocation), /* Initialize each CPU through the driver framework. */ - MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), + MP_FR_BLOCK_APS(cpu_initialize, cpu_initialize), /* Wait for APs to finish then optionally start looking for work. */ MP_FR_BLOCK_APS(ap_wait_for_instruction, NULL), }; diff --git a/src/include/cpu/cpu.h b/src/include/cpu/cpu.h index 955bd73..a77cb33 100644 --- a/src/include/cpu/cpu.h +++ b/src/include/cpu/cpu.h @@ -6,7 +6,7 @@ #include <arch/cpu.h> /* IWYU pragma: export */ #include <stdint.h>
-void cpu_initialize(unsigned int cpu_index); +void cpu_initialize(void); /* Returns default APIC id based on logical_cpu number or < 0 on failure. */ int cpu_get_apic_id(int logical_cpu); uintptr_t cpu_get_lapic_addr(void);