diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-04-19 10:55:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-26 11:35:47 -0400 |
commit | 7c04e64a1b43b4c8fea281ce1f82df30ed9bab4e (patch) | |
tree | cf3bafc4c84ac32f45a0a2eca7d9bd3345a236ef /arch | |
parent | 877084fb1cf6167c5441b0a30c3d9ef9b7be0a3a (diff) |
x86: use cpumask function for present, possible, and online cpus
cpu_online(), cpu_present(), for_each_possible_cpu(), num_possible_cpus()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/genapic_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/tlb_64.c | 4 | ||||
-rw-r--r-- | arch/x86/mach-voyager/voyager_smp.c | 10 | ||||
-rw-r--r-- | arch/x86/xen/smp.c | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 9546ef408b92..021624c83583 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c | |||
@@ -51,7 +51,7 @@ void __init setup_apic_routing(void) | |||
51 | else | 51 | else |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | if (cpus_weight(cpu_possible_map) <= 8) | 54 | if (num_possible_cpus() <= 8) |
55 | genapic = &apic_flat; | 55 | genapic = &apic_flat; |
56 | else | 56 | else |
57 | genapic = &apic_physflat; | 57 | genapic = &apic_physflat; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index eef79e84145f..04c662ba18f1 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1058,7 +1058,7 @@ int __cpuinit native_cpu_up(unsigned int cpu) | |||
1058 | check_tsc_sync_source(cpu); | 1058 | check_tsc_sync_source(cpu); |
1059 | local_irq_restore(flags); | 1059 | local_irq_restore(flags); |
1060 | 1060 | ||
1061 | while (!cpu_isset(cpu, cpu_online_map)) { | 1061 | while (!cpu_online(cpu)) { |
1062 | cpu_relax(); | 1062 | cpu_relax(); |
1063 | touch_nmi_watchdog(); | 1063 | touch_nmi_watchdog(); |
1064 | } | 1064 | } |
@@ -1168,7 +1168,7 @@ static void __init smp_cpu_index_default(void) | |||
1168 | int i; | 1168 | int i; |
1169 | struct cpuinfo_x86 *c; | 1169 | struct cpuinfo_x86 *c; |
1170 | 1170 | ||
1171 | for_each_cpu_mask(i, cpu_possible_map) { | 1171 | for_each_possible_cpu(i) { |
1172 | c = &cpu_data(i); | 1172 | c = &cpu_data(i); |
1173 | /* mark all to hotplug */ | 1173 | /* mark all to hotplug */ |
1174 | c->cpu_index = NR_CPUS; | 1174 | c->cpu_index = NR_CPUS; |
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/kernel/tlb_64.c index df224a8774cb..a1f07d793202 100644 --- a/arch/x86/kernel/tlb_64.c +++ b/arch/x86/kernel/tlb_64.c | |||
@@ -195,9 +195,9 @@ static int __cpuinit init_smp_flush(void) | |||
195 | { | 195 | { |
196 | int i; | 196 | int i; |
197 | 197 | ||
198 | for_each_cpu_mask(i, cpu_possible_map) { | 198 | for_each_possible_cpu(i) |
199 | spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock); | 199 | spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock); |
200 | } | 200 | |
201 | return 0; | 201 | return 0; |
202 | } | 202 | } |
203 | core_initcall(init_smp_flush); | 203 | core_initcall(init_smp_flush); |
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 6e2c4efce0ef..8acbf0cdf1a5 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -113,7 +113,7 @@ static inline void send_QIC_CPI(__u32 cpuset, __u8 cpi) | |||
113 | for_each_online_cpu(cpu) { | 113 | for_each_online_cpu(cpu) { |
114 | if (cpuset & (1 << cpu)) { | 114 | if (cpuset & (1 << cpu)) { |
115 | #ifdef VOYAGER_DEBUG | 115 | #ifdef VOYAGER_DEBUG |
116 | if (!cpu_isset(cpu, cpu_online_map)) | 116 | if (!cpu_online(cpu)) |
117 | VDEBUG(("CPU%d sending cpi %d to CPU%d not in " | 117 | VDEBUG(("CPU%d sending cpi %d to CPU%d not in " |
118 | "cpu_online_map\n", | 118 | "cpu_online_map\n", |
119 | hard_smp_processor_id(), cpi, cpu)); | 119 | hard_smp_processor_id(), cpi, cpu)); |
@@ -683,9 +683,9 @@ void __init smp_boot_cpus(void) | |||
683 | * Code added from smpboot.c */ | 683 | * Code added from smpboot.c */ |
684 | { | 684 | { |
685 | unsigned long bogosum = 0; | 685 | unsigned long bogosum = 0; |
686 | for (i = 0; i < NR_CPUS; i++) | 686 | |
687 | if (cpu_isset(i, cpu_online_map)) | 687 | for_each_online_cpu(i) |
688 | bogosum += cpu_data(i).loops_per_jiffy; | 688 | bogosum += cpu_data(i).loops_per_jiffy; |
689 | printk(KERN_INFO "Total of %d processors activated " | 689 | printk(KERN_INFO "Total of %d processors activated " |
690 | "(%lu.%02lu BogoMIPS).\n", | 690 | "(%lu.%02lu BogoMIPS).\n", |
691 | cpucount + 1, bogosum / (500000 / HZ), | 691 | cpucount + 1, bogosum / (500000 / HZ), |
@@ -1838,7 +1838,7 @@ static int __cpuinit voyager_cpu_up(unsigned int cpu) | |||
1838 | return -EIO; | 1838 | return -EIO; |
1839 | /* Unleash the CPU! */ | 1839 | /* Unleash the CPU! */ |
1840 | cpu_set(cpu, smp_commenced_mask); | 1840 | cpu_set(cpu, smp_commenced_mask); |
1841 | while (!cpu_isset(cpu, cpu_online_map)) | 1841 | while (!cpu_online(cpu)) |
1842 | mb(); | 1842 | mb(); |
1843 | return 0; | 1843 | return 0; |
1844 | } | 1844 | } |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 92dd3dbf3ffb..94e69000f982 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -193,7 +193,7 @@ void __init xen_smp_prepare_cpus(unsigned int max_cpus) | |||
193 | 193 | ||
194 | /* Restrict the possible_map according to max_cpus. */ | 194 | /* Restrict the possible_map according to max_cpus. */ |
195 | while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { | 195 | while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { |
196 | for (cpu = NR_CPUS-1; !cpu_isset(cpu, cpu_possible_map); cpu--) | 196 | for (cpu = NR_CPUS - 1; !cpu_possible(cpu); cpu--) |
197 | continue; | 197 | continue; |
198 | cpu_clear(cpu, cpu_possible_map); | 198 | cpu_clear(cpu, cpu_possible_map); |
199 | } | 199 | } |