]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
um: switch to generic kernel_thread()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 22 Sep 2012 00:32:29 +0000 (20:32 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 1 Oct 2012 02:53:32 +0000 (22:53 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/um/include/asm/processor-generic.h
arch/um/kernel/process.c
arch/x86/um/Kconfig

index 33a6a2423bd25638a2b93f20fdc77bcf6e0f1737..5d9ab0c4f4887594989273a5bd8fac1a5eb35140 100644 (file)
@@ -63,8 +63,6 @@ static inline void release_thread(struct task_struct *task)
 {
 }
 
-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-
 extern unsigned long thread_saved_pc(struct task_struct *t);
 
 static inline void mm_copy_segments(struct mm_struct *from_mm,
index c5f5afa5074571c2b5872bc157c9f199a80c9f5b..a1b50add48a299feb1b3c88b8a2d1c73ce477c85 100644 (file)
@@ -69,18 +69,6 @@ unsigned long alloc_stack(int order, int atomic)
        return page;
 }
 
-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
-{
-       int pid;
-
-       current->thread.request.u.thread.proc = fn;
-       current->thread.request.u.thread.arg = arg;
-       pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
-                     &current->thread.regs, 0, NULL, NULL);
-       return pid;
-}
-EXPORT_SYMBOL(kernel_thread);
-
 static inline void set_current(struct task_struct *task)
 {
        cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task)
@@ -177,7 +165,7 @@ void fork_handler(void)
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
-               unsigned long stack_top, struct task_struct * p,
+               unsigned long arg, struct task_struct * p,
                struct pt_regs *regs)
 {
        void (*handler)(void);
@@ -198,7 +186,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
                arch_copy_thread(&current->thread.arch, &p->thread.arch);
        } else {
                get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp);
-               p->thread.request.u.thread = current->thread.request.u.thread;
+               p->thread.request.u.thread.proc = (int (*)(void *))sp;
+               p->thread.request.u.thread.arg = (void *)arg;
                handler = new_thread_handler;
        }
 
index 9926e11a772dbe9b5417fa204407c2ec9ee58878..da85b6fc8e8e085104a9f6f14228af4bde23b529 100644 (file)
@@ -13,6 +13,7 @@ endmenu
 config UML_X86
        def_bool y
        select GENERIC_FIND_FIRST_BIT
+       select GENERIC_KERNEL_THREAD
 
 config 64BIT
        bool "64-bit kernel" if SUBARCH = "x86"