diff options
Diffstat (limited to 'arch/alpha/kernel/signal.c')
| -rw-r--r-- | arch/alpha/kernel/signal.c | 56 |
1 files changed, 15 insertions, 41 deletions
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 0f6b51ae865a..d290845aef59 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c | |||
| @@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *, | |||
| 41 | /* | 41 | /* |
| 42 | * The OSF/1 sigprocmask calling sequence is different from the | 42 | * The OSF/1 sigprocmask calling sequence is different from the |
| 43 | * C sigprocmask() sequence.. | 43 | * C sigprocmask() sequence.. |
| 44 | * | ||
| 45 | * how: | ||
| 46 | * 1 - SIG_BLOCK | ||
| 47 | * 2 - SIG_UNBLOCK | ||
| 48 | * 3 - SIG_SETMASK | ||
| 49 | * | ||
| 50 | * We change the range to -1 .. 1 in order to let gcc easily | ||
| 51 | * use the conditional move instructions. | ||
| 52 | * | ||
| 53 | * Note that we don't need to acquire the kernel lock for SMP | ||
| 54 | * operation, as all of this is local to this thread. | ||
| 55 | */ | 44 | */ |
| 56 | SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, | 45 | SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask) |
| 57 | struct pt_regs *, regs) | ||
| 58 | { | 46 | { |
| 59 | unsigned long oldmask = -EINVAL; | 47 | sigset_t oldmask; |
| 60 | 48 | sigset_t mask; | |
| 61 | if ((unsigned long)how-1 <= 2) { | 49 | unsigned long res; |
| 62 | long sign = how-2; /* -1 .. 1 */ | 50 | |
| 63 | unsigned long block, unblock; | 51 | siginitset(&mask, newmask & ~_BLOCKABLE); |
| 64 | 52 | res = sigprocmask(how, &mask, &oldmask); | |
| 65 | newmask &= _BLOCKABLE; | 53 | if (!res) { |
| 66 | spin_lock_irq(¤t->sighand->siglock); | 54 | force_successful_syscall_return(); |
| 67 | oldmask = current->blocked.sig[0]; | 55 | res = oldmask.sig[0]; |
| 68 | |||
| 69 | unblock = oldmask & ~newmask; | ||
| 70 | block = oldmask | newmask; | ||
| 71 | if (!sign) | ||
| 72 | block = unblock; | ||
| 73 | if (sign <= 0) | ||
| 74 | newmask = block; | ||
| 75 | if (_NSIG_WORDS > 1 && sign > 0) | ||
| 76 | sigemptyset(¤t->blocked); | ||
| 77 | current->blocked.sig[0] = newmask; | ||
| 78 | recalc_sigpending(); | ||
| 79 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 80 | |||
| 81 | regs->r0 = 0; /* special no error return */ | ||
| 82 | } | 56 | } |
| 83 | return oldmask; | 57 | return res; |
| 84 | } | 58 | } |
| 85 | 59 | ||
| 86 | SYSCALL_DEFINE3(osf_sigaction, int, sig, | 60 | SYSCALL_DEFINE3(osf_sigaction, int, sig, |
| @@ -94,9 +68,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, | |||
| 94 | old_sigset_t mask; | 68 | old_sigset_t mask; |
| 95 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | 69 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || |
| 96 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | 70 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || |
| 97 | __get_user(new_ka.sa.sa_flags, &act->sa_flags)) | 71 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || |
| 72 | __get_user(mask, &act->sa_mask)) | ||
| 98 | return -EFAULT; | 73 | return -EFAULT; |
| 99 | __get_user(mask, &act->sa_mask); | ||
| 100 | siginitset(&new_ka.sa.sa_mask, mask); | 74 | siginitset(&new_ka.sa.sa_mask, mask); |
| 101 | new_ka.ka_restorer = NULL; | 75 | new_ka.ka_restorer = NULL; |
| 102 | } | 76 | } |
| @@ -106,9 +80,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, | |||
| 106 | if (!ret && oact) { | 80 | if (!ret && oact) { |
| 107 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | 81 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || |
| 108 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | 82 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || |
| 109 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags)) | 83 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || |
| 84 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
| 110 | return -EFAULT; | 85 | return -EFAULT; |
| 111 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
| 112 | } | 86 | } |
| 113 | 87 | ||
| 114 | return ret; | 88 | return ret; |
