#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>
int __cpu_up(unsigned int cpu)
{
struct task_struct *tsk;
- struct pt_regs regs;
- memset(®s, 0, sizeof(struct pt_regs));
- tsk = copy_process(CLONE_VM | CLONE_IDLETASK, 0, ®s, 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);
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);