xref: /csrg-svn/lib/libc/mips/sys/sigprocmask.s (revision 52733)
1*52733Sbostic/*-
2*52733Sbostic * Copyright (c) 1991 The Regents of the University of California.
3*52733Sbostic * All rights reserved.
4*52733Sbostic *
5*52733Sbostic * This code is derived from software contributed to Berkeley by
6*52733Sbostic * Ralph Campbell.
7*52733Sbostic *
8*52733Sbostic * %sccs.include.redist.c%
9*52733Sbostic */
10*52733Sbostic
11*52733Sbostic#include "SYS.h"
12*52733Sbostic
13*52733Sbostic#if defined(LIBC_SCCS) && !defined(lint)
14*52733Sbostic	ASMSTR("@(#)sigprocmask.s	5.1 (Berkeley) 02/29/92")
15*52733Sbostic#endif /* LIBC_SCCS and not lint */
16*52733Sbostic
17*52733SbosticLEAF(sigprocmask)	# sigprocmask(how, new, old) sigset_t *new, *old;
18*52733Sbostic	bne	a1, zero, gotptr	# if new sigset pointer not null
19*52733Sbostic	li	a0, 1			# how = SIG_BLOCK
20*52733Sbostic	b	doit			# mask = zero
21*52733Sbosticgotptr:
22*52733Sbostic	lw	a1, 0(a1)		# indirect to new mask arg
23*52733Sbosticdoit:
24*52733Sbostic	li	v0, SYS_sigprocmask
25*52733Sbostic	syscall
26*52733Sbostic	bne	a3, zero, err
27*52733Sbostic	beq	a2, zero, out		# test if old mask requested
28*52733Sbostic	sw	v0, 0(a2)		# store old mask
29*52733Sbosticout:
30*52733Sbostic	move	v0, zero
31*52733Sbostic	j	ra
32*52733Sbosticerr:
33*52733Sbostic	j	_cerror
34*52733SbosticEND(sigprocmask)
35