7 #include <asm/pgalloc.h>
12 #include <linux/sched.h>
13 #include <linux/module.h>
19 #include <asm/processor.h>
20 #include <asm/spinlock.h>
32 int num_reschedules_sent = 0;
40 num_reschedules_sent++;
49 if (i == current_thread->cpu)
59 static int idle_proc(
void *cpup)
65 panic(
"CPU#%d failed to create IPI pipe, err = %d", cpu, -
err);
75 while (!
cpu_isset(cpu, smp_commenced_mask))
78 notify_cpu_starting(cpu);
88 current->thread.request.u.thread.proc = idle_proc;
89 current->thread.request.u.thread.arg = (
void *) cpu;
92 panic(
"copy_process failed in idle_thread, error = %ld",
96 { .pid = new_task->
thread.mode.tt.extern_pid,
98 idle_threads[
cpu] = new_task;
99 panic(
"skas mode doesn't support SMP");
106 unsigned long waittime;
110 for (i = 0; i <
ncpus; ++
i)
118 panic(
"CPU#0 failed to create IPI pipe, errno = %d", -err);
122 for (cpu = 1; cpu <
ncpus; cpu++) {
125 idle = idle_thread(cpu);
129 waittime = 200000000;
130 while (waittime-- && !
cpu_isset(cpu, cpu_callin_map))
134 cpu_isset(cpu, cpu_calling_map) ?
"done" :
"failed");
145 cpu_set(cpu, smp_commenced_mask);
157 void smp_call_function_slave(
int cpu);
159 void IPI_handler(
int cpu)
168 smp_call_function_slave(cpu);
200 void smp_call_function_slave(
int cpu)
218 spin_lock_bh(&call_lock);
234 spin_unlock_bh(&call_lock);