diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-16 21:46:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-16 21:46:21 -0500 |
commit | 0c864d8b3e51bd61f43484268c9aa4eb9a199b02 (patch) | |
tree | de9fa5c3792c84fa173e6d27c856bde0254f7eeb /arch/unicore32/kernel/process.c | |
parent | 4fd24483d1de7a3c183fa862fa9ff13b49361966 (diff) | |
parent | f4a75d2eb7b1e2206094b901be09adb31ba63681 (diff) |
Merge 3.7-rc6 into usb-next.
This resolves a conflict with these files:
drivers/usb/early/ehci-dbgp.c
drivers/usb/host/ehci-ls1x.c
drivers/usb/host/ohci-xls.c
drivers/usb/musb/ux500.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/unicore32/kernel/process.c')
-rw-r--r-- | arch/unicore32/kernel/process.c | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index b008586dad75..a8fe265ce2c0 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
@@ -258,6 +258,7 @@ void release_thread(struct task_struct *dead_task) | |||
258 | } | 258 | } |
259 | 259 | ||
260 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | 260 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); |
261 | asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); | ||
261 | 262 | ||
262 | int | 263 | int |
263 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
@@ -266,17 +267,22 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
266 | struct thread_info *thread = task_thread_info(p); | 267 | struct thread_info *thread = task_thread_info(p); |
267 | struct pt_regs *childregs = task_pt_regs(p); | 268 | struct pt_regs *childregs = task_pt_regs(p); |
268 | 269 | ||
269 | *childregs = *regs; | ||
270 | childregs->UCreg_00 = 0; | ||
271 | childregs->UCreg_sp = stack_start; | ||
272 | |||
273 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); | 270 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); |
274 | thread->cpu_context.sp = (unsigned long)childregs; | 271 | thread->cpu_context.sp = (unsigned long)childregs; |
275 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | 272 | if (unlikely(!regs)) { |
276 | 273 | thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread; | |
277 | if (clone_flags & CLONE_SETTLS) | 274 | thread->cpu_context.r4 = stack_start; |
278 | childregs->UCreg_16 = regs->UCreg_03; | 275 | thread->cpu_context.r5 = stk_sz; |
276 | memset(childregs, 0, sizeof(struct pt_regs)); | ||
277 | } else { | ||
278 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | ||
279 | *childregs = *regs; | ||
280 | childregs->UCreg_00 = 0; | ||
281 | childregs->UCreg_sp = stack_start; | ||
279 | 282 | ||
283 | if (clone_flags & CLONE_SETTLS) | ||
284 | childregs->UCreg_16 = regs->UCreg_03; | ||
285 | } | ||
280 | return 0; | 286 | return 0; |
281 | } | 287 | } |
282 | 288 | ||
@@ -305,42 +311,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fp) | |||
305 | } | 311 | } |
306 | EXPORT_SYMBOL(dump_fpu); | 312 | EXPORT_SYMBOL(dump_fpu); |
307 | 313 | ||
308 | /* | ||
309 | * Shuffle the argument into the correct register before calling the | ||
310 | * thread function. r1 is the thread argument, r2 is the pointer to | ||
311 | * the thread function, and r3 points to the exit function. | ||
312 | */ | ||
313 | asm(".pushsection .text\n" | ||
314 | " .align\n" | ||
315 | " .type kernel_thread_helper, #function\n" | ||
316 | "kernel_thread_helper:\n" | ||
317 | " mov.a asr, r7\n" | ||
318 | " mov r0, r4\n" | ||
319 | " mov lr, r6\n" | ||
320 | " mov pc, r5\n" | ||
321 | " .size kernel_thread_helper, . - kernel_thread_helper\n" | ||
322 | " .popsection"); | ||
323 | |||
324 | /* | ||
325 | * Create a kernel thread. | ||
326 | */ | ||
327 | pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | ||
328 | { | ||
329 | struct pt_regs regs; | ||
330 | |||
331 | memset(®s, 0, sizeof(regs)); | ||
332 | |||
333 | regs.UCreg_04 = (unsigned long)arg; | ||
334 | regs.UCreg_05 = (unsigned long)fn; | ||
335 | regs.UCreg_06 = (unsigned long)do_exit; | ||
336 | regs.UCreg_07 = PRIV_MODE; | ||
337 | regs.UCreg_pc = (unsigned long)kernel_thread_helper; | ||
338 | regs.UCreg_asr = regs.UCreg_07 | PSR_I_BIT; | ||
339 | |||
340 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | ||
341 | } | ||
342 | EXPORT_SYMBOL(kernel_thread); | ||
343 | |||
344 | unsigned long get_wchan(struct task_struct *p) | 314 | unsigned long get_wchan(struct task_struct *p) |
345 | { | 315 | { |
346 | struct stackframe frame; | 316 | struct stackframe frame; |