]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
uml: get rid of do_longjmp
authorJeff Dike <jdike@addtoit.com>
Tue, 16 Oct 2007 08:27:05 +0000 (01:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:05 +0000 (09:43 -0700)
do_longjmp used to be needed when UML didn't have its own implementation of
setjmp and longjmp.  They came from libc, and couldn't be called directly from
kernel code, as the libc jmp_buf couldn't be imported there.  do_longjmp was a
userspace function which served to provide longjmp access to kernel code.

This is gone, and a number of void * pointers can now be jmp_buf *.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/include/os.h
arch/um/include/um_uaccess.h
arch/um/include/uml_uaccess.h [deleted file]
arch/um/kernel/exec.c
arch/um/kernel/mem.c
arch/um/kernel/trap.c
arch/um/kernel/uaccess.c
arch/um/os-Linux/process.c
arch/um/os-Linux/trap.c
arch/um/os-Linux/uaccess.c
include/asm-um/processor-generic.h

index 96f333cd560da5db167a924ceed4e499bf20c9c0..c704851d68b79022a41db88d7adb5e12f2d1293f 100644 (file)
@@ -193,7 +193,7 @@ extern int os_getpid(void);
 extern int os_getpgrp(void);
 
 extern void init_new_thread_signals(void);
-extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
+extern int run_kernel_thread(int (*fn)(void *), void *arg, jmp_buf **jmp_ptr);
 
 extern int os_map_memory(void *virt, int fd, unsigned long long off,
                         unsigned long len, int r, int w, int x);
@@ -206,7 +206,7 @@ extern void os_flush_stdout(void);
 
 /* uaccess.c */
 extern unsigned long __do_user_copy(void *to, const void *from, int n,
-                                   void **fault_addr, void **fault_catcher,
+                                   void **fault_addr, jmp_buf **fault_catcher,
                                    void (*op)(void *to, const void *from,
                                               int n), int *faulted_out);
 
@@ -240,7 +240,6 @@ extern int set_signals(int enable);
 
 /* trap.c */
 extern void os_fill_handlinfo(struct kern_handlers h);
-extern void do_longjmp(void *p, int val);
 
 /* util.c */
 extern void stack_protections(unsigned long address);
index 5ef311a1a394db18365498340cfec34b2e147c8c..fdfc06b85605a5bf709a3b7e3b369b49c766626c 100644 (file)
 extern int copy_from_user(void *to, const void __user *from, int n);
 extern int copy_to_user(void __user *to, const void *from, int n);
 
+extern int __do_copy_to_user(void *to, const void *from, int n,
+                            void **fault_addr, jmp_buf **fault_catcher);
+extern void __do_copy(void *to, const void *from, int n);
+
 /*
  * strncpy_from_user: - Copy a NUL terminated string from userspace.
  * @dst:   Destination address, in kernel space.  This buffer must be at
diff --git a/arch/um/include/uml_uaccess.h b/arch/um/include/uml_uaccess.h
deleted file mode 100644 (file)
index c0df11d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __UML_UACCESS_H__
-#define __UML_UACCESS_H__
-
-extern int __do_copy_to_user(void *to, const void *from, int n,
-                            void **fault_addr, void **fault_catcher);
-void __do_copy(void *to, const void *from, int n);
-
-#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
index 0d260567fd159786872a9668dca8727aea4353fe..25c502617553eb257f70f32bcb4ef6e051753312 100644 (file)
@@ -75,7 +75,7 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
 
        err = execve1(file, argv, env);
        if (!err)
-               do_longjmp(current->thread.exec_buf, 1);
+               UML_LONGJMP(current->thread.exec_buf, 1);
        return err;
 }
 
index d2b11f242698ea617de8fa086b299beda2169c10..8456397f5f4d614e3df04dc728c2ae79f08f6675 100644 (file)
@@ -17,7 +17,7 @@
 #include "as-layout.h"
 #include "kern.h"
 #include "mem_user.h"
-#include "uml_uaccess.h"
+#include "um_uaccess.h"
 #include "os.h"
 #include "linux/types.h"
 #include "linux/string.h"
index eac63fb6183c16df3b12140b90e33a7c0db264b5..bd060551e6190d6fc92b2148840f94c9e71098c9 100644 (file)
@@ -149,7 +149,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
                   struct uml_pt_regs *regs)
 {
        struct siginfo si;
-       void *catcher;
+       jmp_buf *catcher;
        int err;
        int is_write = FAULT_WRITE(fi);
        unsigned long address = FAULT_ADDRESS(fi);
@@ -181,7 +181,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
                return 0;
        else if (catcher != NULL) {
                current->thread.fault_addr = (void *) address;
-               do_longjmp(catcher, 1);
+               UML_LONGJMP(catcher, 1);
        }
        else if (current->thread.fault_addr != NULL)
                panic("fault_addr set but no fault catcher");
@@ -233,7 +233,7 @@ void relay_signal(int sig, struct uml_pt_regs *regs)
 static void bus_handler(int sig, struct uml_pt_regs *regs)
 {
        if (current->thread.fault_catcher != NULL)
-               do_longjmp(current->thread.fault_catcher, 1);
+               UML_LONGJMP(current->thread.fault_catcher, 1);
        else relay_signal(sig, regs);
 }
 
index 054e3de0784e3607ed4e74b032bae7f511f13198..d7436aacd26f0feeb88600770474912c9220522e 100644 (file)
@@ -18,7 +18,7 @@ void __do_copy(void *to, const void *from, int n)
 
 
 int __do_copy_to_user(void *to, const void *from, int n,
-                     void **fault_addr, void **fault_catcher)
+                     void **fault_addr, jmp_buf **fault_catcher)
 {
        unsigned long fault;
        int faulted;
index b2e0d8c4258c1497d8d724b0cf26f7da6aa0670a..8b57eb3647f5c8bc58a8cab50d20c382eb47b354 100644 (file)
@@ -249,7 +249,7 @@ void init_new_thread_signals(void)
        init_irq_signals(1);
 }
 
-int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
+int run_kernel_thread(int (*fn)(void *), void *arg, jmp_buf **jmp_ptr)
 {
        jmp_buf buf;
        int n;
index be8e029f58b4b1dba08eed1176b2c5325e977479..d3a34ca8a89197bfa7730c6ad11be7e214203016 100644 (file)
@@ -22,10 +22,3 @@ void os_fill_handlinfo(struct kern_handlers h)
        sig_info[SIGVTALRM] = h.timer_handler;
        sig_info[SIGALRM] = h.timer_handler;
 }
-
-void do_longjmp(void *b, int val)
-{
-       jmp_buf *buf = b;
-
-       UML_LONGJMP(buf, val);
-}
index bbb73a6503706d931dacf6b43bcc23d9e86e3fff..8d27b6d1df91c58b69685fce86c2f4ae4ea9134e 100644 (file)
@@ -8,7 +8,7 @@
 #include "longjmp.h"
 
 unsigned long __do_user_copy(void *to, const void *from, int n,
-                            void **fault_addr, void **fault_catcher,
+                            void **fault_addr, jmp_buf **fault_catcher,
                             void (*op)(void *to, const void *from,
                                        int n), int *faulted_out)
 {
index d40eae9ec9a26dc6c5527dd783140755d91d321f..78c0599cc80c4da8e21d8c897a801560edbcb5e1 100644 (file)
@@ -30,10 +30,10 @@ struct thread_struct {
        struct pt_regs regs;
        int singlestep_syscall;
        void *fault_addr;
-       void *fault_catcher;
+       jmp_buf *fault_catcher;
        struct task_struct *prev_sched;
        unsigned long temp_stack;
-       void *exec_buf;
+       jmp_buf *exec_buf;
        struct arch_thread arch;
        jmp_buf switch_buf;
        int mm_count;