From 8e3bc9cf131a552a019bcb8f666c6d3e4f1ce072 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 26 Sep 2010 19:28:12 +0100 Subject: [PATCH] --- yaml --- r: 211006 b: refs/heads/master c: c52c2ddc1dfa6fe85ffd5e4c57cf91f6982639fe h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/alpha/kernel/entry.S | 9 ------ trunk/arch/alpha/kernel/signal.c | 48 +++++++------------------------ trunk/arch/alpha/kernel/systbls.S | 2 +- 4 files changed, 13 insertions(+), 48 deletions(-) diff --git a/[refs] b/[refs] index cebf1b5e5d03..b133ddf81542 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 32163f4b2cef28a5aab8b226ffecfc6379a53786 +refs/heads/master: c52c2ddc1dfa6fe85ffd5e4c57cf91f6982639fe diff --git a/trunk/arch/alpha/kernel/entry.S b/trunk/arch/alpha/kernel/entry.S index d1273c1a1364..6d159cee5f2f 100644 --- a/trunk/arch/alpha/kernel/entry.S +++ b/trunk/arch/alpha/kernel/entry.S @@ -914,15 +914,6 @@ sys_execve: jmp $31, do_sys_execve .end sys_execve - .align 4 - .globl osf_sigprocmask - .ent osf_sigprocmask -osf_sigprocmask: - .prologue 0 - mov $sp, $18 - jmp $31, sys_osf_sigprocmask -.end osf_sigprocmask - .align 4 .globl alpha_ni_syscall .ent alpha_ni_syscall diff --git a/trunk/arch/alpha/kernel/signal.c b/trunk/arch/alpha/kernel/signal.c index 0f6b51ae865a..06609aa363b6 100644 --- a/trunk/arch/alpha/kernel/signal.c +++ b/trunk/arch/alpha/kernel/signal.c @@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *, /* * The OSF/1 sigprocmask calling sequence is different from the * C sigprocmask() sequence.. - * - * how: - * 1 - SIG_BLOCK - * 2 - SIG_UNBLOCK - * 3 - SIG_SETMASK - * - * We change the range to -1 .. 1 in order to let gcc easily - * use the conditional move instructions. - * - * Note that we don't need to acquire the kernel lock for SMP - * operation, as all of this is local to this thread. */ -SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, - struct pt_regs *, regs) +SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask) { - unsigned long oldmask = -EINVAL; - - if ((unsigned long)how-1 <= 2) { - long sign = how-2; /* -1 .. 1 */ - unsigned long block, unblock; - - newmask &= _BLOCKABLE; - spin_lock_irq(¤t->sighand->siglock); - oldmask = current->blocked.sig[0]; - - unblock = oldmask & ~newmask; - block = oldmask | newmask; - if (!sign) - block = unblock; - if (sign <= 0) - newmask = block; - if (_NSIG_WORDS > 1 && sign > 0) - sigemptyset(¤t->blocked); - current->blocked.sig[0] = newmask; - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - regs->r0 = 0; /* special no error return */ + sigset_t oldmask; + sigset_t mask; + unsigned long res; + + siginitset(&mask, newmask & ~_BLOCKABLE); + res = siprocmask(how, &mask, &oldmask); + if (!res) { + force_successful_syscall_return(); + res = oldmask->sig[0]; } - return oldmask; + return res; } SYSCALL_DEFINE3(osf_sigaction, int, sig, diff --git a/trunk/arch/alpha/kernel/systbls.S b/trunk/arch/alpha/kernel/systbls.S index ce594ef533cc..a6a1de9db16f 100644 --- a/trunk/arch/alpha/kernel/systbls.S +++ b/trunk/arch/alpha/kernel/systbls.S @@ -58,7 +58,7 @@ sys_call_table: .quad sys_open /* 45 */ .quad alpha_ni_syscall .quad sys_getxgid - .quad osf_sigprocmask + .quad sys_osf_sigprocmask .quad alpha_ni_syscall .quad alpha_ni_syscall /* 50 */ .quad sys_acct