vserver 1.9.3
[linux-2.6.git] / arch / sh / kernel / smp.c
index 97ed434..6ff83ed 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/atomic.h>
 #include <asm/processor.h>
 #include <asm/system.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/smp.h>
 
@@ -98,19 +97,12 @@ void __devinit smp_prepare_boot_cpu(void)
 int __cpu_up(unsigned int cpu)
 {
        struct task_struct *tsk;
-       struct pt_regs regs;
 
-       memset(&regs, 0, sizeof(struct pt_regs));
-       tsk = copy_process(CLONE_VM | CLONE_IDLETASK, 0, &regs, 0, 0, 0);
+       tsk = fork_idle(cpu);
 
        if (IS_ERR(tsk))
                panic("Failed forking idle task for cpu %d\n", cpu);
        
-       wake_up_forked_process(tsk);
-
-       init_idle(tsk, cpu);
-       unhash_process(tsk);
-       
        tsk->thread_info->cpu = cpu;
 
        cpu_set(cpu, cpu_online_map);
@@ -181,6 +173,9 @@ int smp_call_function(void (*func)(void *info), void *info, int retry, int wait)
        if (nr_cpus < 2)
                return 0;
 
+       /* Can deadlock when called with interrupts disabled */
+       WARN_ON(irqs_disabled());
+
        spin_lock(&smp_fn_call.lock);
 
        atomic_set(&smp_fn_call.finished, 0);