diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 15:22:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 15:22:13 -0500 |
commit | 9977d9b379cb77e0f67bd6f4563618106e58e11d (patch) | |
tree | 0191accfddf578edb52c69c933d64521e3dce297 /arch/microblaze/kernel/entry.S | |
parent | cf4af01221579a4e895f43dbfc47598fbfc5a731 (diff) | |
parent | 541880d9a2c7871f6370071d55aa6662d329c51e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull big execve/kernel_thread/fork unification series from Al Viro:
"All architectures are converted to new model. Quite a bit of that
stuff is actually shared with architecture trees; in such cases it's
literally shared branch pulled by both, not a cherry-pick.
A lot of ugliness and black magic is gone (-3KLoC total in this one):
- kernel_thread()/kernel_execve()/sys_execve() redesign.
We don't do syscalls from kernel anymore for either kernel_thread()
or kernel_execve():
kernel_thread() is essentially clone(2) with callback run before we
return to userland, the callbacks either never return or do
successful do_execve() before returning.
kernel_execve() is a wrapper for do_execve() - it doesn't need to
do transition to user mode anymore.
As a result kernel_thread() and kernel_execve() are
arch-independent now - they live in kernel/fork.c and fs/exec.c
resp. sys_execve() is also in fs/exec.c and it's completely
architecture-independent.
- daemonize() is gone, along with its parts in fs/*.c
- struct pt_regs * is no longer passed to do_fork/copy_process/
copy_thread/do_execve/search_binary_handler/->load_binary/do_coredump.
- sys_fork()/sys_vfork()/sys_clone() unified; some architectures
still need wrappers (ones with callee-saved registers not saved in
pt_regs on syscall entry), but the main part of those suckers is in
kernel/fork.c now."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (113 commits)
do_coredump(): get rid of pt_regs argument
print_fatal_signal(): get rid of pt_regs argument
ptrace_signal(): get rid of unused arguments
get rid of ptrace_signal_deliver() arguments
new helper: signal_pt_regs()
unify default ptrace_signal_deliver
flagday: kill pt_regs argument of do_fork()
death to idle_regs()
don't pass regs to copy_process()
flagday: don't pass regs to copy_thread()
bfin: switch to generic vfork, get rid of pointless wrappers
xtensa: switch to generic clone()
openrisc: switch to use of generic fork and clone
unicore32: switch to generic clone(2)
score: switch to generic fork/vfork/clone
c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone()
take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h
mn10300: switch to generic fork/vfork/clone
h8300: switch to generic fork/vfork/clone
tile: switch to generic clone()
...
Conflicts:
arch/microblaze/include/asm/Kbuild
Diffstat (limited to 'arch/microblaze/kernel/entry.S')
-rw-r--r-- | arch/microblaze/kernel/entry.S | 57 |
1 files changed, 9 insertions, 48 deletions
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index 03f7b8ce6b6b..c217367dfc7b 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S | |||
@@ -293,24 +293,6 @@ C_ENTRY(_user_exception): | |||
293 | swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */ | 293 | swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */ |
294 | addi r14, r14, 4 /* return address is 4 byte after call */ | 294 | addi r14, r14, 4 /* return address is 4 byte after call */ |
295 | 295 | ||
296 | mfs r1, rmsr | ||
297 | nop | ||
298 | andi r1, r1, MSR_UMS | ||
299 | bnei r1, 1f | ||
300 | |||
301 | /* Kernel-mode state save - kernel execve */ | ||
302 | lwi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)); /* Reload kernel stack-ptr*/ | ||
303 | tophys(r1,r1); | ||
304 | |||
305 | addik r1, r1, -PT_SIZE; /* Make room on the stack. */ | ||
306 | SAVE_REGS | ||
307 | |||
308 | swi r1, r1, PT_MODE; /* pt_regs -> kernel mode */ | ||
309 | brid 2f; | ||
310 | nop; /* Fill delay slot */ | ||
311 | |||
312 | /* User-mode state save. */ | ||
313 | 1: | ||
314 | lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */ | 296 | lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */ |
315 | tophys(r1,r1); | 297 | tophys(r1,r1); |
316 | lwi r1, r1, TS_THREAD_INFO; /* get stack from task_struct */ | 298 | lwi r1, r1, TS_THREAD_INFO; /* get stack from task_struct */ |
@@ -460,18 +442,6 @@ TRAP_return: /* Make global symbol for debugging */ | |||
460 | nop; | 442 | nop; |
461 | 443 | ||
462 | 444 | ||
463 | /* These syscalls need access to the struct pt_regs on the stack, so we | ||
464 | implement them in assembly (they're basically all wrappers anyway). */ | ||
465 | |||
466 | C_ENTRY(sys_fork_wrapper): | ||
467 | addi r5, r0, SIGCHLD /* Arg 0: flags */ | ||
468 | lwi r6, r1, PT_R1 /* Arg 1: child SP (use parent's) */ | ||
469 | addik r7, r1, 0 /* Arg 2: parent context */ | ||
470 | add r8, r0, r0 /* Arg 3: (unused) */ | ||
471 | add r9, r0, r0; /* Arg 4: (unused) */ | ||
472 | brid do_fork /* Do real work (tail-call) */ | ||
473 | add r10, r0, r0; /* Arg 5: (unused) */ | ||
474 | |||
475 | /* This the initial entry point for a new child thread, with an appropriate | 445 | /* This the initial entry point for a new child thread, with an appropriate |
476 | stack in place that makes it look the the child is in the middle of an | 446 | stack in place that makes it look the the child is in the middle of an |
477 | syscall. This function is actually `returned to' from switch_thread | 447 | syscall. This function is actually `returned to' from switch_thread |
@@ -479,28 +449,19 @@ C_ENTRY(sys_fork_wrapper): | |||
479 | saved context). */ | 449 | saved context). */ |
480 | C_ENTRY(ret_from_fork): | 450 | C_ENTRY(ret_from_fork): |
481 | bralid r15, schedule_tail; /* ...which is schedule_tail's arg */ | 451 | bralid r15, schedule_tail; /* ...which is schedule_tail's arg */ |
482 | add r3, r5, r0; /* switch_thread returns the prev task */ | 452 | add r5, r3, r0; /* switch_thread returns the prev task */ |
483 | /* ( in the delay slot ) */ | 453 | /* ( in the delay slot ) */ |
484 | brid ret_from_trap; /* Do normal trap return */ | 454 | brid ret_from_trap; /* Do normal trap return */ |
485 | add r3, r0, r0; /* Child's fork call should return 0. */ | 455 | add r3, r0, r0; /* Child's fork call should return 0. */ |
486 | 456 | ||
487 | C_ENTRY(sys_vfork): | 457 | C_ENTRY(ret_from_kernel_thread): |
488 | brid microblaze_vfork /* Do real work (tail-call) */ | 458 | bralid r15, schedule_tail; /* ...which is schedule_tail's arg */ |
489 | addik r5, r1, 0 | 459 | add r5, r3, r0; /* switch_thread returns the prev task */ |
490 | 460 | /* ( in the delay slot ) */ | |
491 | C_ENTRY(sys_clone): | 461 | brald r15, r20 /* fn was left in r20 */ |
492 | bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ | 462 | addk r5, r0, r19 /* ... and argument - in r19 */ |
493 | lwi r6, r1, PT_R1; /* If so, use paret's stack ptr */ | 463 | brid ret_from_trap |
494 | 1: addik r7, r1, 0; /* Arg 2: parent context */ | 464 | add r3, r0, r0 |
495 | lwi r9, r1, PT_R8; /* parent tid. */ | ||
496 | lwi r10, r1, PT_R9; /* child tid. */ | ||
497 | /* do_fork will pick up TLS from regs->r10. */ | ||
498 | brid do_fork /* Do real work (tail-call) */ | ||
499 | add r8, r0, r0; /* Arg 3: (unused) */ | ||
500 | |||
501 | C_ENTRY(sys_execve): | ||
502 | brid microblaze_execve; /* Do real work (tail-call).*/ | ||
503 | addik r8, r1, 0; /* add user context as 4th arg */ | ||
504 | 465 | ||
505 | C_ENTRY(sys_rt_sigreturn_wrapper): | 466 | C_ENTRY(sys_rt_sigreturn_wrapper): |
506 | brid sys_rt_sigreturn /* Do real work */ | 467 | brid sys_rt_sigreturn /* Do real work */ |