Skip to content

Commit 1f02ab4

Browse files
author
Al Viro
committed
um: switch to generic kernel_thread()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 6783eaa commit 1f02ab4

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

arch/um/include/asm/processor-generic.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ static inline void release_thread(struct task_struct *task)
6363
{
6464
}
6565

66-
extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
67-
6866
extern unsigned long thread_saved_pc(struct task_struct *t);
6967

7068
static inline void mm_copy_segments(struct mm_struct *from_mm,

arch/um/kernel/process.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,6 @@ unsigned long alloc_stack(int order, int atomic)
6969
return page;
7070
}
7171

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-
&current->thread.regs, 0, NULL, NULL);
80-
return pid;
81-
}
82-
EXPORT_SYMBOL(kernel_thread);
83-
8472
static inline void set_current(struct task_struct *task)
8573
{
8674
cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task)
@@ -177,7 +165,7 @@ void fork_handler(void)
177165
}
178166

179167
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,
181169
struct pt_regs *regs)
182170
{
183171
void (*handler)(void);
@@ -198,7 +186,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
198186
arch_copy_thread(&current->thread.arch, &p->thread.arch);
199187
} else {
200188
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;
202191
handler = new_thread_handler;
203192
}
204193

arch/x86/um/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ endmenu
1313
config UML_X86
1414
def_bool y
1515
select GENERIC_FIND_FIRST_BIT
16+
select GENERIC_KERNEL_THREAD
1617

1718
config 64BIT
1819
bool "64-bit kernel" if SUBARCH = "x86"

0 commit comments

Comments
 (0)