patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / mips / kernel / irixsig.c
index 223ca36..b15f3b0 100644 (file)
 #include <linux/smp_lock.h>
 #include <linux/time.h>
 #include <linux/ptrace.h>
+#include <linux/suspend.h>
 
 #include <asm/ptrace.h>
 #include <asm/uaccess.h>
 
-extern asmlinkage void do_syscall_trace(void);
-
 #undef DEBUG_SIG
 
 #define _S(nr) (1<<((nr)-1))
@@ -177,6 +176,19 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
        siginfo_t info;
        int signr;
 
+       /*
+        * We want the common case to go fast, which is why we may in certain
+        * cases get here from kernel mode. Just return without doing anything
+        * if so.
+        */
+       if (!user_mode(regs))
+               return 1;
+
+       if (current->flags & PF_FREEZE) {
+               refrigerator(0);
+               goto no_signal;
+       }
+
        if (!oldset)
                oldset = &current->blocked;
 
@@ -186,6 +198,7 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
                return 1;
        }
 
+no_signal:
        /*
         * Who's code doesn't conform to the restartable syscall convention
         * dies here!!!  The li instruction, a single machine instruction,
@@ -263,7 +276,7 @@ irix_sigreturn(struct pt_regs *regs)
         * Don't let your children do this ...
         */
        if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
-               do_syscall_trace();
+               do_syscall_trace(regs, 1);
        __asm__ __volatile__(
                "move\t$29,%0\n\t"
                "j\tsyscall_exit"
@@ -536,7 +549,7 @@ out:
 #define P_PGID   2
 #define P_ALL    7
 
-extern int getrusage(struct task_struct *, int, struct rusage *);
+extern int getrusage(struct task_struct *, int, struct rusage __user *);
 
 #define W_EXITED     1
 #define W_TRAPPED    2