um: kill HOST_TASK_PID
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 30 Jan 2012 21:30:48 +0000 (16:30 -0500)
committerRichard Weinberger <richard@nod.at>
Sat, 24 Mar 2012 23:29:55 +0000 (00:29 +0100)
just provide get_current_pid() to the userland side of things
instead of get_current() + manual poking in its results

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/include/shared/common-offsets.h
arch/um/include/shared/kern_util.h
arch/um/kernel/process.c
arch/x86/um/bugs_32.c

index d7fe563..40db8f7 100644 (file)
@@ -2,8 +2,6 @@
 
 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
 
-OFFSET(HOST_TASK_PID, task_struct, pid);
-
 DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);
 DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK);
 DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT);
index 0f14838..00965d0 100644 (file)
@@ -48,7 +48,7 @@ extern void do_uml_exitcalls(void);
  * GFP_ATOMIC.
  */
 extern int __cant_sleep(void);
-extern void *get_current(void);
+extern int get_current_pid(void);
 extern int copy_from_user_proc(void *to, void *from, int size);
 extern int cpu(void);
 extern char *uml_strdup(const char *string);
index 69f2490..f386d04 100644 (file)
@@ -126,9 +126,9 @@ void exit_thread(void)
 {
 }
 
-void *get_current(void)
+int get_current_pid(void)
 {
-       return current;
+       return task_pid_nr(current);
 }
 
 /*
index a1fba5f..17d88cf 100644 (file)
@@ -13,8 +13,6 @@
 static int host_has_cmov = 1;
 static jmp_buf cmov_test_return;
 
-#define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID]))
-
 static void cmov_sigill_test_handler(int sig)
 {
        host_has_cmov = 0;
@@ -51,7 +49,7 @@ void arch_examine_signal(int sig, struct uml_pt_regs *regs)
         * This is testing for a cmov (0x0f 0x4x) instruction causing a
         * SIGILL in init.
         */
-       if ((sig != SIGILL) || (TASK_PID(get_current()) != 1))
+       if ((sig != SIGILL) || (get_current_pid() != 1))
                return;
 
        if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) {