diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 23:02:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 23:02:25 -0400 |
commit | 42859eea96ba6beabfb0369a1eeffa3c7d2bd9cb (patch) | |
tree | fa38aeda0d6e7a4c48a882b166b8643594a1ad50 /arch/um/kernel/process.c | |
parent | f59b51fe3d3092c08d7d554ecb40db24011b2ebc (diff) | |
parent | f322220d6159455da2b5a8a596d802c8695fed30 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull generic execve() changes from Al Viro:
"This introduces the generic kernel_thread() and kernel_execve()
functions, and switches x86, arm, alpha, um and s390 over to them."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (26 commits)
s390: convert to generic kernel_execve()
s390: switch to generic kernel_thread()
s390: fold kernel_thread_helper() into ret_from_fork()
s390: fold execve_tail() into start_thread(), convert to generic sys_execve()
um: switch to generic kernel_thread()
x86, um/x86: switch to generic sys_execve and kernel_execve
x86: split ret_from_fork
alpha: introduce ret_from_kernel_execve(), switch to generic kernel_execve()
alpha: switch to generic kernel_thread()
alpha: switch to generic sys_execve()
arm: get rid of execve wrapper, switch to generic execve() implementation
arm: optimized current_pt_regs()
arm: introduce ret_from_kernel_execve(), switch to generic kernel_execve()
arm: split ret_from_fork, simplify kernel_thread() [based on patch by rmk]
generic sys_execve()
generic kernel_execve()
new helper: current_pt_regs()
preparation for generic kernel_thread()
um: kill thread->forking
um: let signal_delivered() do SIGTRAP on singlestepping into handler
...
Diffstat (limited to 'arch/um/kernel/process.c')
-rw-r--r-- | arch/um/kernel/process.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 41f53240e794..30629783b3e0 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -69,18 +69,6 @@ unsigned long alloc_stack(int order, int atomic) | |||
69 | return page; | 69 | return page; |
70 | } | 70 | } |
71 | 71 | ||
72 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | ||
73 | { | ||
74 | int pid; | ||
75 | |||
76 | current->thread.request.u.thread.proc = fn; | ||
77 | current->thread.request.u.thread.arg = arg; | ||
78 | pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0, | ||
79 | ¤t->thread.regs, 0, NULL, NULL); | ||
80 | return pid; | ||
81 | } | ||
82 | EXPORT_SYMBOL(kernel_thread); | ||
83 | |||
84 | static inline void set_current(struct task_struct *task) | 72 | static inline void set_current(struct task_struct *task) |
85 | { | 73 | { |
86 | cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) | 74 | cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) |
@@ -177,7 +165,7 @@ void fork_handler(void) | |||
177 | } | 165 | } |
178 | 166 | ||
179 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 167 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
180 | unsigned long stack_top, struct task_struct * p, | 168 | unsigned long arg, struct task_struct * p, |
181 | struct pt_regs *regs) | 169 | struct pt_regs *regs) |
182 | { | 170 | { |
183 | void (*handler)(void); | 171 | void (*handler)(void); |
@@ -198,7 +186,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
198 | arch_copy_thread(¤t->thread.arch, &p->thread.arch); | 186 | arch_copy_thread(¤t->thread.arch, &p->thread.arch); |
199 | } else { | 187 | } else { |
200 | get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp); | 188 | get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp); |
201 | p->thread.request.u.thread = current->thread.request.u.thread; | 189 | p->thread.request.u.thread.proc = (int (*)(void *))sp; |
190 | p->thread.request.u.thread.arg = (void *)arg; | ||
202 | handler = new_thread_handler; | 191 | handler = new_thread_handler; |
203 | } | 192 | } |
204 | 193 | ||