x86: make voyager_phys_cpu_present_map static unsigned long.
PATCH 1/2 x86: make voyager_phys_cpu_present_map static unsigned long.
Impact: cleanup, remove cpumask_t
Instead of replacing voyager_phys_cpu_present_map with a cpumask_var_t, let's make it an unsigned long as assumed in various places anyway.
Also delete incorrect comment on external usage.
Signed-off-by Rusty Russell <[email protected]>
--- arch/x86/mach-voyager/voyager_smp.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-)
arch/x86/mach-voyager/voyager_smp.c +18 -14
@@ -63,9 +63,8 @@ static int voyager_extended_cpus = 1;/* Used for the invalidate map that's also checked in the spinlock */ static volatile unsigned long smp_invalidate_needed; -/* Bitmask of CPUs present in the system - exported by i386_syms.c, used -* by scheduler but indexed physically */ -static cpumask_t voyager_phys_cpu_present_map =CPU_MASK_NONE ; +/* Set from extended CMOS in find_smp_config */ +static unsigned long voyager_phys_cpu_present_map;/* The internal functions */ static void send_CPI (__u32 cpuset,__u8 cpi);
@@ -349,6 +348,7 @@ void __init find_smp_config(void)void __init find_smp_config (void ) {int i; +unsigned long present; boot_cpu_id =hard_smp_processor_id ();
@@ -366,19 +366,24 @@ void __init find_smp_config(void)/* set up everything for just this CPU, we can alter * this as we start the other CPUs later */ /* now get the CPU disposition from the extended CMOS */ -cpus_addr (voyager_phys_cpu_present_map)[0 ] = + voyager_phys_cpu_present_map =voyager_extended_cmos_read (VOYAGER_PROCESSOR_PRESENT_MASK ); -cpus_addr (voyager_phys_cpu_present_map)[0 ] |= + voyager_phys_cpu_present_map |=voyager_extended_cmos_read (VOYAGER_PROCESSOR_PRESENT_MASK +1 ) <<8 ; -cpus_addr (voyager_phys_cpu_present_map)[0 ] |= + voyager_phys_cpu_present_map |=voyager_extended_cmos_read (VOYAGER_PROCESSOR_PRESENT_MASK +2 ) <<16 ; -cpus_addr (voyager_phys_cpu_present_map)[0 ] |= + voyager_phys_cpu_present_map |=voyager_extended_cmos_read (VOYAGER_PROCESSOR_PRESENT_MASK +3 ) <<24 ; -init_cpu_possible (&voyager_phys_cpu_present_map); +for (i =0 ; i <32 ; i++) { +if (test_bit (i, &voyager_phys_cpu_present_map)) +set_cpu_possible (i, true); + } +printk ("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n" , -cpus_addr (voyager_phys_cpu_present_map)[0 ]); + voyager_phys_cpu_present_map); +/* Here we set up the VIC to enable SMP */ /* enable the CPIs by writing the base vector to their register */ outb (VIC_DEFAULT_CPI_BASE ,VIC_CPI_BASE_REGISTER );
@@ -628,15 +633,14 @@ void __init smp_boot_cpus(void)/* now that the cat has probed the Voyager System Bus, sanity * check the cpu map */ if (((voyager_quad_processors | voyager_extended_vic_processors) - &cpus_addr (voyager_phys_cpu_present_map)[0 ]) != -cpus_addr (voyager_phys_cpu_present_map)[0 ]) { + & voyager_phys_cpu_present_map) != + voyager_phys_cpu_present_map) {/* should panic */ printk ("\n\n***WARNING*** " "Sanity check of CPU present map FAILED\n" ); } }else if (voyager_level ==4 ) - voyager_extended_vic_processors = -cpus_addr (voyager_phys_cpu_present_map)[0 ]; + voyager_extended_vic_processors = voyager_phys_cpu_present_map;/* this sets up the idle task to run on the current cpu */ voyager_extended_cpus =1 ;
@@ -670,7 +674,7 @@ void __init smp_boot_cpus(void)/* loop over all the extended VIC CPUs and boot them. The * Quad CPUs must be bootstrapped by their extended VIC cpu */ for (i =0 ; i < nr_cpu_ids; i++) { -if (i == boot_cpu_id || !cpu_isset (i, voyager_phys_cpu_present_map)) +if (i == boot_cpu_id || !test_bit (i, &voyager_phys_cpu_present_map))continue ;do_boot_cpu (i);/* This udelay seems to be needed for the Quad boots
Quoted 6 lines · Rusty Russell
Impact: cleanup, remove
cpumask_tInstead of replacing
voyager_phys_cpu_present_mapwith acpumask_var_t, let's make it an unsigned long as assumed in various places anyway.Also delete incorrect comment on external usage.
Yes, this looks good. Having it as a cpumask_t was really a historical artifact from the time when phys_cpu_present_map was an expected subarchitecture export.
James