aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-09-21 20:32:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-30 22:53:32 -0400
commit1f02ab4a237086095bd584f3446da307ac2d02e6 (patch)
treee08c0a4cc09f1385d7528a592789aef9e16be44c /arch/um
parent6783eaa2e1253fbcbe2c2f6bb4c843abf1343caf (diff)
um: switch to generic kernel_thread()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/include/asm/processor-generic.h2
-rw-r--r--arch/um/kernel/process.c17
2 files changed, 3 insertions, 16 deletions
diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h
index 33a6a2423bd2..5d9ab0c4f488 100644
--- a/arch/um/include/asm/processor-generic.h
+++ b/arch/um/include/asm/processor-generic.h
@@ -63,8 +63,6 @@ static inline void release_thread(struct task_struct *task)
63{ 63{
64} 64}
65 65
66extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
67
68extern unsigned long thread_saved_pc(struct task_struct *t); 66extern unsigned long thread_saved_pc(struct task_struct *t);
69 67
70static inline void mm_copy_segments(struct mm_struct *from_mm, 68static inline void mm_copy_segments(struct mm_struct *from_mm,
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index c5f5afa50745..a1b50add48a2 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
72int 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 &current->thread.regs, 0, NULL, NULL);
80 return pid;
81}
82EXPORT_SYMBOL(kernel_thread);
83
84static inline void set_current(struct task_struct *task) 72static 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
179int copy_thread(unsigned long clone_flags, unsigned long sp, 167int 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(&current->thread.arch, &p->thread.arch); 186 arch_copy_thread(&current->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