diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/kernel/init_task.c | 35 | ||||
-rw-r--r-- | arch/mips/kernel/smp.c | 56 |
3 files changed, 3 insertions, 90 deletions
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index 0c6877ea9004..fdaf65e1a99d 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the Linux/MIPS kernel. | 2 | # Makefile for the Linux/MIPS kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | extra-y := head.o init_task.o vmlinux.lds | 5 | extra-y := head.o vmlinux.lds |
6 | 6 | ||
7 | obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ | 7 | obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ |
8 | ptrace.o reset.o setup.o signal.o syscall.o \ | 8 | ptrace.o reset.o setup.o signal.o syscall.o \ |
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c deleted file mode 100644 index 5f9a76263c9a..000000000000 --- a/arch/mips/kernel/init_task.c +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | #include <linux/mm.h> | ||
2 | #include <linux/export.h> | ||
3 | #include <linux/sched.h> | ||
4 | #include <linux/init_task.h> | ||
5 | #include <linux/fs.h> | ||
6 | #include <linux/mqueue.h> | ||
7 | |||
8 | #include <asm/thread_info.h> | ||
9 | #include <asm/uaccess.h> | ||
10 | #include <asm/pgtable.h> | ||
11 | |||
12 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
13 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
14 | /* | ||
15 | * Initial thread structure. | ||
16 | * | ||
17 | * We need to make sure that this is 8192-byte aligned due to the | ||
18 | * way process stacks are handled. This is done by making sure | ||
19 | * the linker maps this in the .text segment right after head.S, | ||
20 | * and making head.S ensure the proper alignment. | ||
21 | * | ||
22 | * The things we do for performance.. | ||
23 | */ | ||
24 | union thread_union init_thread_union __init_task_data | ||
25 | __attribute__((__aligned__(THREAD_SIZE))) = | ||
26 | { INIT_THREAD_INFO(init_task) }; | ||
27 | |||
28 | /* | ||
29 | * Initial task structure. | ||
30 | * | ||
31 | * All other task structs will be allocated on slabs in fork.c | ||
32 | */ | ||
33 | struct task_struct init_task = INIT_TASK(init_task); | ||
34 | |||
35 | EXPORT_SYMBOL(init_task); | ||
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index ba9376bf52a1..71a95f55a649 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -186,61 +186,9 @@ void __devinit smp_prepare_boot_cpu(void) | |||
186 | cpu_set(0, cpu_callin_map); | 186 | cpu_set(0, cpu_callin_map); |
187 | } | 187 | } |
188 | 188 | ||
189 | /* | 189 | int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) |
190 | * Called once for each "cpu_possible(cpu)". Needs to spin up the cpu | ||
191 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is | ||
192 | * physical, not logical. | ||
193 | */ | ||
194 | static struct task_struct *cpu_idle_thread[NR_CPUS]; | ||
195 | |||
196 | struct create_idle { | ||
197 | struct work_struct work; | ||
198 | struct task_struct *idle; | ||
199 | struct completion done; | ||
200 | int cpu; | ||
201 | }; | ||
202 | |||
203 | static void __cpuinit do_fork_idle(struct work_struct *work) | ||
204 | { | ||
205 | struct create_idle *c_idle = | ||
206 | container_of(work, struct create_idle, work); | ||
207 | |||
208 | c_idle->idle = fork_idle(c_idle->cpu); | ||
209 | complete(&c_idle->done); | ||
210 | } | ||
211 | |||
212 | int __cpuinit __cpu_up(unsigned int cpu) | ||
213 | { | 190 | { |
214 | struct task_struct *idle; | 191 | mp_ops->boot_secondary(cpu, tidle); |
215 | |||
216 | /* | ||
217 | * Processor goes to start_secondary(), sets online flag | ||
218 | * The following code is purely to make sure | ||
219 | * Linux can schedule processes on this slave. | ||
220 | */ | ||
221 | if (!cpu_idle_thread[cpu]) { | ||
222 | /* | ||
223 | * Schedule work item to avoid forking user task | ||
224 | * Ported from arch/x86/kernel/smpboot.c | ||
225 | */ | ||
226 | struct create_idle c_idle = { | ||
227 | .cpu = cpu, | ||
228 | .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done), | ||
229 | }; | ||
230 | |||
231 | INIT_WORK_ONSTACK(&c_idle.work, do_fork_idle); | ||
232 | schedule_work(&c_idle.work); | ||
233 | wait_for_completion(&c_idle.done); | ||
234 | idle = cpu_idle_thread[cpu] = c_idle.idle; | ||
235 | |||
236 | if (IS_ERR(idle)) | ||
237 | panic(KERN_ERR "Fork failed for CPU %d", cpu); | ||
238 | } else { | ||
239 | idle = cpu_idle_thread[cpu]; | ||
240 | init_idle(idle, cpu); | ||
241 | } | ||
242 | |||
243 | mp_ops->boot_secondary(cpu, idle); | ||
244 | 192 | ||
245 | /* | 193 | /* |
246 | * Trust is futile. We should really have timeouts ... | 194 | * Trust is futile. We should really have timeouts ... |