]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/um/os-Linux/skas/trap.c
Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
[linux-2.6-omap-h63xx.git] / arch / um / os-Linux / skas / trap.c
index 6a20d08caf91bb45f3a8671b1262cdf416e1771d..3b600c2e63b85ed81ba89b6bd990f664dc97bb37 100644 (file)
@@ -15,6 +15,8 @@
 #include "sysdep/ptrace_user.h"
 #include "os.h"
 
+static union uml_pt_regs ksig_regs[UM_NR_CPUS];
+
 void sig_handler_common_skas(int sig, void *sc_ptr)
 {
        struct sigcontext *sc = sc_ptr;
@@ -27,10 +29,19 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
         * the process will die.
         * XXX Figure out why this is better than SA_NODEFER
         */
-       if(sig == SIGSEGV)
+       if(sig == SIGSEGV) {
                change_sig(SIGSEGV, 1);
+               /* For segfaults, we want the data from the
+                * sigcontext.  In this case, we don't want to mangle
+                * the process registers, so use a static set of
+                * registers.  For other signals, the process
+                * registers are OK.
+                */
+               r = &ksig_regs[cpu()];
+               copy_sc(r, sc_ptr);
+       }
+       else r = TASK_REGS(get_current());
 
-       r = TASK_REGS(get_current());
        save_user = r->skas.is_user;
        r->skas.is_user = 0;
        if ( sig == SIGFPE || sig == SIGSEGV ||
@@ -53,20 +64,3 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
        errno = save_errno;
        r->skas.is_user = save_user;
 }
-
-extern int ptrace_faultinfo;
-
-void user_signal(int sig, union uml_pt_regs *regs, int pid)
-{
-       void (*handler)(int, union uml_pt_regs *);
-       int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) ||
-                   (sig == SIGILL) || (sig == SIGTRAP));
-
-       if (segv)
-               get_skas_faultinfo(pid, &regs->skas.faultinfo);
-
-       handler = sig_info[sig];
-       handler(sig, (union uml_pt_regs *) regs);
-
-       unblock_signals();
-}