Skip to content

Commit

Permalink
cpumask: Use accessors for cpu_*_mask: powerpc
Browse files Browse the repository at this point in the history
Use the accessors rather than frobbing bits directly (the new versions
are const).

Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Mike Travis <[email protected]>
  • Loading branch information
rustyrussell committed Sep 24, 2009
1 parent 4037ac6 commit ea0f1ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ void __init smp_setup_cpu_maps(void)
for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
DBG(" thread %d -> cpu %d (hard id %d)\n",
j, cpu, intserv[j]);
cpu_set(cpu, cpu_present_map);
set_cpu_present(cpu, true);
set_hard_smp_processor_id(cpu, intserv[j]);
cpu_set(cpu, cpu_possible_map);
set_cpu_possible(cpu, true);
cpu++;
}
}
Expand Down Expand Up @@ -480,7 +480,7 @@ void __init smp_setup_cpu_maps(void)
maxcpus);

for (cpu = 0; cpu < maxcpus; cpu++)
cpu_set(cpu, cpu_possible_map);
set_cpu_possible(cpu, true);
out:
of_node_put(dn);
}
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void __devinit smp_prepare_boot_cpu(void)
{
BUG_ON(smp_processor_id() != boot_cpuid);

cpu_set(boot_cpuid, cpu_online_map);
set_cpu_online(boot_cpuid, true);
cpu_set(boot_cpuid, per_cpu(cpu_sibling_map, boot_cpuid));
cpu_set(boot_cpuid, per_cpu(cpu_core_map, boot_cpuid));
#ifdef CONFIG_PPC64
Expand All @@ -307,7 +307,7 @@ int generic_cpu_disable(void)
if (cpu == boot_cpuid)
return -EBUSY;

cpu_clear(cpu, cpu_online_map);
set_cpu_online(cpu, false);
#ifdef CONFIG_PPC64
vdso_data->processorCount--;
fixup_irqs(cpu_online_map);
Expand Down Expand Up @@ -361,7 +361,7 @@ void generic_mach_cpu_die(void)
smp_wmb();
while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
cpu_relax();
cpu_set(cpu, cpu_online_map);
set_cpu_online(cpu, true);
local_irq_enable();
}
#endif
Expand Down Expand Up @@ -508,7 +508,7 @@ int __devinit start_secondary(void *unused)

ipi_call_lock();
notify_cpu_starting(cpu);
cpu_set(cpu, cpu_online_map);
set_cpu_online(cpu, true);
/* Update sibling maps */
base = cpu_first_thread_in_core(cpu);
for (i = 0; i < threads_per_core; i++) {
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/powermac/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static int __init smp_psurge_probe(void)
if (ncpus > NR_CPUS)
ncpus = NR_CPUS;
for (i = 1; i < ncpus ; ++i)
cpu_set(i, cpu_present_map);
set_cpu_present(i, true);

if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352);

Expand Down Expand Up @@ -867,7 +867,7 @@ static void __devinit smp_core99_setup_cpu(int cpu_nr)

int smp_core99_cpu_disable(void)
{
cpu_clear(smp_processor_id(), cpu_online_map);
set_cpu_online(smp_processor_id(), false);

/* XXX reset cpu affinity here */
mpic_cpu_set_priority(0xf);
Expand Down Expand Up @@ -952,7 +952,7 @@ void __init pmac_setup_smp(void)
int cpu;

for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu)
cpu_set(cpu, cpu_possible_map);
set_cpu_possible(cpu, true);
smp_ops = &psurge_smp_ops;
}
#endif /* CONFIG_PPC32 */
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/pseries/hotplug-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int pseries_cpu_disable(void)
{
int cpu = smp_processor_id();

cpu_clear(cpu, cpu_online_map);
set_cpu_online(cpu, false);
vdso_data->processorCount--;

/*fix boot_cpuid here*/
Expand Down Expand Up @@ -185,7 +185,7 @@ static int pseries_add_processor(struct device_node *np)

for_each_cpu_mask(cpu, tmp) {
BUG_ON(cpu_isset(cpu, cpu_present_map));
cpu_set(cpu, cpu_present_map);
set_cpu_present(cpu, true);
set_hard_smp_processor_id(cpu, *intserv++);
}
err = 0;
Expand Down Expand Up @@ -217,7 +217,7 @@ static void pseries_remove_processor(struct device_node *np)
if (get_hard_smp_processor_id(cpu) != intserv[i])
continue;
BUG_ON(cpu_online(cpu));
cpu_clear(cpu, cpu_present_map);
set_cpu_present(cpu, false);
set_hard_smp_processor_id(cpu, -1);
break;
}
Expand Down

0 comments on commit ea0f1ca

Please sign in to comment.