18b121c70Smatt/* 28b121c70Smatt * Copyright (c) 1989, 1993 38b121c70Smatt * The Regents of the University of California. All rights reserved. 48b121c70Smatt * 58b121c70Smatt * Redistribution and use in source and binary forms, with or without 68b121c70Smatt * modification, are permitted provided that the following conditions 78b121c70Smatt * are met: 88b121c70Smatt * 1. Redistributions of source code must retain the above copyright 98b121c70Smatt * notice, this list of conditions and the following disclaimer. 108b121c70Smatt * 2. Redistributions in binary form must reproduce the above copyright 118b121c70Smatt * notice, this list of conditions and the following disclaimer in the 128b121c70Smatt * documentation and/or other materials provided with the distribution. 138b121c70Smatt * 3. Neither the name of the University nor the names of its contributors 148b121c70Smatt * may be used to endorse or promote products derived from this software 158b121c70Smatt * without specific prior written permission. 168b121c70Smatt * 178b121c70Smatt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 188b121c70Smatt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 198b121c70Smatt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 208b121c70Smatt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 218b121c70Smatt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 228b121c70Smatt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 238b121c70Smatt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 248b121c70Smatt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 258b121c70Smatt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 268b121c70Smatt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 278b121c70Smatt * SUCH DAMAGE. 288b121c70Smatt */ 298b121c70Smatt 30*787e823fSmatt#include "SYS.h" 31*787e823fSmatt 328b121c70Smatt#if defined(SYSLIBC_SCCS) && !defined(lint) 338b121c70Smatt /* .asciz "@(#)sigprocmask.s 8.1 (Berkeley) 6/4/93" */ 34*787e823fSmattRCSID("$NetBSD: compat_sigprocmask13.S,v 1.2 2011/01/25 02:38:16 matt Exp $") 358b121c70Smatt#endif /* SYSLIBC_SCCS and not lint */ 368b121c70Smatt 378b121c70SmattWARN_REFERENCES(sigprocmask, \ 388b121c70Smatt "warning: reference to compatibility sigprocmask(); include <signal.h> for correct reference") 398b121c70Smatt 408b121c70SmattENTRY(sigprocmask, 0) 418b121c70Smatt tstl 8(%ap) # check new sigset pointer 428b121c70Smatt bneq 1f # if not null, indirect 438b121c70Smatt/* movl $0,8(%ap) # null mask pointer: block empty set */ 448b121c70Smatt movl $1,4(%ap) # SIG_BLOCK 458b121c70Smatt jbr 2f 468b121c70Smatt1: movl *8(%ap),8(%ap) # indirect to new mask arg 478b121c70Smatt2: chmk $ SYS_compat_13_sigprocmask13 488b121c70Smatt jcc 3f 498b121c70Smatt jmp CERROR+2 508b121c70Smatt 518b121c70Smatt3: tstl 12(%ap) # test if old mask requested 528b121c70Smatt beql out 538b121c70Smatt movl %r0,*12(%ap) # store old mask 548b121c70Smattout: 558b121c70Smatt clrl %r0 568b121c70Smatt ret 57*787e823fSmattEND(sigprocmask) 58