Commit 458163b3 authored by Paul Mackerras's avatar Paul Mackerras

PPC32: Use a per-cpu variable for prof_counter and prof_multiplier.

parent 5f8a8bf5
......@@ -44,8 +44,8 @@ struct cpuinfo_PPC cpu_data[NR_CPUS];
struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 };
atomic_t ipi_recv;
atomic_t ipi_sent;
unsigned int prof_multiplier[NR_CPUS] = { [1 ... NR_CPUS-1] = 1 };
unsigned int prof_counter[NR_CPUS] = { [1 ... NR_CPUS-1] = 1 };
DEFINE_PER_CPU(unsigned int, prof_multiplier);
DEFINE_PER_CPU(unsigned int, prof_counter);
unsigned long cache_decay_ticks = HZ/100;
unsigned long cpu_online_map = 1UL;
unsigned long cpu_possible_map = 1UL;
......@@ -90,9 +90,9 @@ void smp_local_timer_interrupt(struct pt_regs * regs)
{
int cpu = smp_processor_id();
if (!--prof_counter[cpu]) {
if (!--per_cpu(prof_counter, cpu)) {
update_process_times(user_mode(regs));
prof_counter[cpu]=prof_multiplier[cpu];
per_cpu(prof_counter, cpu) = per_cpu(prof_multiplier, cpu);
}
}
......@@ -327,6 +327,8 @@ static void __devinit smp_store_cpu_info(int id)
/* assume bogomips are same for everything */
c->loops_per_jiffy = loops_per_jiffy;
c->pvr = mfspr(PVR);
per_cpu(prof_counter, id) = 1;
per_cpu(prof_multiplier, id) = 1;
}
void __init smp_prepare_cpus(unsigned int max_cpus)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment