X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc%2Fkernel%2Fsmp.c;h=7ed8a3bb81df4a5985d3a1d2233fa1d2b8cfeaa9;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=5805707ed2674f53ffab493dbe7504b3338b110a;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c index 5805707ed..7ed8a3bb8 100644 --- a/arch/ppc/kernel/smp.c +++ b/arch/ppc/kernel/smp.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -43,8 +42,6 @@ struct cpuinfo_PPC cpu_data[NR_CPUS]; struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 }; atomic_t ipi_recv; atomic_t ipi_sent; -DEFINE_PER_CPU(unsigned int, prof_multiplier); -DEFINE_PER_CPU(unsigned int, prof_counter); unsigned long cache_decay_ticks = HZ/100; cpumask_t cpu_online_map; cpumask_t cpu_possible_map; @@ -61,7 +58,6 @@ static struct smp_ops_t *smp_ops; volatile unsigned long cpu_callin_map[NR_CPUS]; int start_secondary(void *); -extern int cpu_idle(void *unused); void smp_call_function_interrupt(void); static int __smp_call_function(void (*func) (void *info), void *info, int wait, int target); @@ -90,16 +86,6 @@ smp_message_pass(int target, int msg, unsigned long data, int wait) /* * Common functions */ -void smp_local_timer_interrupt(struct pt_regs * regs) -{ - int cpu = smp_processor_id(); - - if (!--per_cpu(prof_counter, cpu)) { - update_process_times(user_mode(regs)); - per_cpu(prof_counter, cpu) = per_cpu(prof_multiplier, cpu); - } -} - void smp_message_recv(int msg, struct pt_regs *regs) { atomic_inc(&ipi_recv); @@ -177,7 +163,7 @@ void smp_send_stop(void) * static memory requirements. It also looks cleaner. * Stolen from the i386 version. */ -static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(call_lock); static struct call_data_struct { void (*func) (void *info); @@ -211,6 +197,8 @@ int smp_call_function(void (*func) (void *info), void *info, int nonatomic, bitmask. --RR */ if (num_online_cpus() <= 1) return 0; + /* Can deadlock when called with interrupts disabled */ + WARN_ON(irqs_disabled()); return __smp_call_function(func, info, wait, MSG_ALL_BUT_SELF); } @@ -296,8 +284,6 @@ 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) @@ -357,27 +343,21 @@ int __devinit start_secondary(void *unused) smp_ops->take_timebase(); printk("CPU %i done timebase take...\n", cpu); - return cpu_idle(NULL); + cpu_idle(); + return 0; } int __cpu_up(unsigned int cpu) { - struct pt_regs regs; struct task_struct *p; char buf[32]; int c; /* create a process for the processor */ /* only regs.msr is actually used, and 0 is OK for it */ - memset(®s, 0, sizeof(struct pt_regs)); - p = copy_process(CLONE_VM|CLONE_IDLETASK, 0, ®s, 0, NULL, NULL); + p = fork_idle(cpu); if (IS_ERR(p)) panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); - wake_up_forked_process(p); - - init_idle(p, cpu); - unhash_process(p); - secondary_ti = p->thread_info; p->thread_info->cpu = cpu;