Skip to content

Commit c52c2dd

Browse files
Al Virotorvalds
authored andcommitted
alpha: switch osf_sigprocmask() to use of sigprocmask()
get rid of a useless wrapper, while we are at it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 32163f4 commit c52c2dd

File tree

3 files changed

+12
-47
lines changed

3 files changed

+12
-47
lines changed

arch/alpha/kernel/entry.S

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -914,15 +914,6 @@ sys_execve:
914914
jmp $31, do_sys_execve
915915
.end sys_execve
916916

917-
.align 4
918-
.globl osf_sigprocmask
919-
.ent osf_sigprocmask
920-
osf_sigprocmask:
921-
.prologue 0
922-
mov $sp, $18
923-
jmp $31, sys_osf_sigprocmask
924-
.end osf_sigprocmask
925-
926917
.align 4
927918
.globl alpha_ni_syscall
928919
.ent alpha_ni_syscall

arch/alpha/kernel/signal.c

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *,
4141
/*
4242
* The OSF/1 sigprocmask calling sequence is different from the
4343
* 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.
5544
*/
56-
SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,
57-
struct pt_regs *, regs)
45+
SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)
5846
{
59-
unsigned long oldmask = -EINVAL;
60-
61-
if ((unsigned long)how-1 <= 2) {
62-
long sign = how-2; /* -1 .. 1 */
63-
unsigned long block, unblock;
64-
65-
newmask &= _BLOCKABLE;
66-
spin_lock_irq(&current->sighand->siglock);
67-
oldmask = current->blocked.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(&current->blocked);
77-
current->blocked.sig[0] = newmask;
78-
recalc_sigpending();
79-
spin_unlock_irq(&current->sighand->siglock);
80-
81-
regs->r0 = 0; /* special no error return */
47+
sigset_t oldmask;
48+
sigset_t mask;
49+
unsigned long res;
50+
51+
siginitset(&mask, newmask & ~_BLOCKABLE);
52+
res = siprocmask(how, &mask, &oldmask);
53+
if (!res) {
54+
force_successful_syscall_return();
55+
res = oldmask->sig[0];
8256
}
83-
return oldmask;
57+
return res;
8458
}
8559

8660
SYSCALL_DEFINE3(osf_sigaction, int, sig,

arch/alpha/kernel/systbls.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sys_call_table:
5858
.quad sys_open /* 45 */
5959
.quad alpha_ni_syscall
6060
.quad sys_getxgid
61-
.quad osf_sigprocmask
61+
.quad sys_osf_sigprocmask
6262
.quad alpha_ni_syscall
6363
.quad alpha_ni_syscall /* 50 */
6464
.quad sys_acct

0 commit comments

Comments
 (0)