]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
xtensa: switch to generic rt_sigsuspend(2)
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 Apr 2012 04:59:07 +0000 (00:59 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 22 May 2012 03:58:06 +0000 (23:58 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/xtensa/include/asm/syscall.h
arch/xtensa/include/asm/unistd.h
arch/xtensa/kernel/entry.S
arch/xtensa/kernel/signal.c

index efcf33b92e4c02e77df78a78d95c112badc60716..fc289f7e8ebc7ccfafe1e89a863813e63ca26aa6 100644 (file)
@@ -15,8 +15,6 @@ asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*);
 asmlinkage long xtensa_ptrace(long, long, long, long);
 asmlinkage long xtensa_sigreturn(struct pt_regs*);
 asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
-asmlinkage long xtensa_sigsuspend(struct pt_regs*);
-asmlinkage long xtensa_rt_sigsuspend(struct pt_regs*);
 asmlinkage long xtensa_sigaction(int, const struct old_sigaction*,
                                 struct old_sigaction*);
 asmlinkage long xtensa_sigaltstack(struct pt_regs *regs);
index 798ee6d285a10d9b350e11f1a53c212f8f72c803..bc7e005faa602f5eb61beaf886f5a83c1ea1d209 100644 (file)
@@ -507,7 +507,7 @@ __SYSCALL(229, sys_rt_sigtimedwait, 4)
 #define __NR_rt_sigqueueinfo                   230
 __SYSCALL(230, sys_rt_sigqueueinfo, 3)
 #define __NR_rt_sigsuspend                     231
-__SYSCALL(231, xtensa_rt_sigsuspend, 2)
+__SYSCALL(231, sys_rt_sigsuspend, 2)
 
 /* Message */
 
index 6223f3346b5c1015621418d7a535ada366478901..b1bb6d79d8b945681a1ab1eb259c9159bf23b88f 100644 (file)
@@ -418,7 +418,6 @@ common_exception_return:
 
        movi    a4, do_signal   # int do_signal(struct pt_regs*, sigset_t*)
        mov     a6, a1
-       movi    a7, 0
        callx4  a4
        j       1b
 
index 44e9329a64840e90d05944d54b13b45571fdf2f7..bb00cc470ca936c06e9268e6f00c2869edb7e737 100644 (file)
@@ -31,8 +31,6 @@
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
-asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
-
 extern struct task_struct *coproc_owners[];
 
 struct rt_sigframe
@@ -429,37 +427,6 @@ give_sigsegv:
        return -EFAULT;
 }
 
-/*
- * Atomically swap in the new signal mask, and wait for a signal.
- */
-
-asmlinkage long xtensa_rt_sigsuspend(sigset_t __user *unewset, 
-                                    size_t sigsetsize,
-                                    long a2, long a3, long a4, long a5, 
-                                    struct pt_regs *regs)
-{
-       sigset_t saveset, newset;
-
-       /* XXX: Don't preclude handling different sized sigset_t's.  */
-       if (sigsetsize != sizeof(sigset_t))
-               return -EINVAL;
-
-       if (copy_from_user(&newset, unewset, sizeof(newset)))
-               return -EFAULT;
-
-       sigdelsetmask(&newset, ~_BLOCKABLE);
-       saveset = current->blocked;
-       set_current_blocked(&newset);
-
-       regs->areg[2] = -EINTR;
-       while (1) {
-               current->state = TASK_INTERRUPTIBLE;
-               schedule();
-               if (do_signal(regs, &saveset))
-                       return -EINTR;
-       }
-}
-
 asmlinkage long xtensa_sigaltstack(const stack_t __user *uss, 
                                   stack_t __user *uoss,
                                   long a2, long a3, long a4, long a5,
@@ -479,19 +446,22 @@ asmlinkage long xtensa_sigaltstack(const stack_t __user *uss,
  * the kernel can handle, and then we build all the user-level signal handling
  * stack-frames in one go after that.
  */
-int do_signal(struct pt_regs *regs, sigset_t *oldset)
+void do_signal(struct pt_regs *regs)
 {
        siginfo_t info;
        int signr;
        struct k_sigaction ka;
+       sigset_t oldset;
 
        if (!user_mode(regs))
-               return 0;
+               return;
 
        if (try_to_freeze())
                goto no_signal;
 
-       if (!oldset)
+       if (test_thread_flag(TIF_RESTORE_SIGMASK))
+               oldset = &current->saved_sigmask;
+       else
                oldset = &current->blocked;
 
        task_pt_regs(current)->icountlevel = 0;
@@ -535,13 +505,14 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
                /* Set up the stack frame */
                ret = setup_frame(signr, &ka, &info, oldset, regs);
                if (ret)
-                       return ret;
+                       return;
 
+               clear_thread_flag(TIF_RESTORE_SIGMASK);
                block_sigmask(&ka, signr);
                if (current->ptrace & PT_SINGLESTEP)
                        task_pt_regs(current)->icountlevel = 1;
 
-               return 1;
+               return;
        }
 
 no_signal:
@@ -561,8 +532,13 @@ no_signal:
                        break;
                }
        }
+
+       /* If there's no signal to deliver, we just restore the saved mask.  */
+       if (test_and_clear_thread_flag(TIF_RESTORE_SIGMASK))
+               set_current_blocked(&current->saved_sigmask);
+
        if (current->ptrace & PT_SINGLESTEP)
                task_pt_regs(current)->icountlevel = 1;
-       return 0;
+       return;
 }