1*7c78a65eSmatt/* $NetBSD: compat_sigprocmask.S,v 1.4 2013/07/25 22:08:15 matt Exp $ */ 2eebf1202Schristos 3eebf1202Schristos/*- 4eebf1202Schristos * Copyright (c) 1990 The Regents of the University of California. 5eebf1202Schristos * All rights reserved. 6eebf1202Schristos * 7eebf1202Schristos * This code is derived from software contributed to Berkeley by 8eebf1202Schristos * the Systems Programming Group of the University of Utah Computer 9eebf1202Schristos * Science Department. 10eebf1202Schristos * 11eebf1202Schristos * Redistribution and use in source and binary forms, with or without 12eebf1202Schristos * modification, are permitted provided that the following conditions 13eebf1202Schristos * are met: 14eebf1202Schristos * 1. Redistributions of source code must retain the above copyright 15eebf1202Schristos * notice, this list of conditions and the following disclaimer. 16eebf1202Schristos * 2. Redistributions in binary form must reproduce the above copyright 17eebf1202Schristos * notice, this list of conditions and the following disclaimer in the 18eebf1202Schristos * documentation and/or other materials provided with the distribution. 19eebf1202Schristos * 3. Neither the name of the University nor the names of its contributors 20eebf1202Schristos * may be used to endorse or promote products derived from this software 21eebf1202Schristos * without specific prior written permission. 22eebf1202Schristos * 23eebf1202Schristos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24eebf1202Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25eebf1202Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26eebf1202Schristos * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27eebf1202Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28eebf1202Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29eebf1202Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30eebf1202Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31eebf1202Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32eebf1202Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33eebf1202Schristos * SUCH DAMAGE. 34eebf1202Schristos */ 35eebf1202Schristos 36eebf1202Schristos#include "SYS.h" 37eebf1202Schristos 38eebf1202Schristos#if defined(LIBC_SCCS) && !defined(lint) 39eebf1202Schristos#if 0 40eebf1202Schristos RCSID("from: @(#)sigprocmask.s 5.2 (Berkeley) 6/6/90") 41eebf1202Schristos#else 42*7c78a65eSmatt RCSID("$NetBSD: compat_sigprocmask.S,v 1.4 2013/07/25 22:08:15 matt Exp $") 43eebf1202Schristos#endif 44eebf1202Schristos#endif /* LIBC_SCCS and not lint */ 45eebf1202Schristos 46eebf1202SchristosWARN_REFERENCES(sigprocmask, \ 47eebf1202Schristos "warning: reference to compatibility sigprocmask(); include <signal.h> for correct reference") 48eebf1202Schristos 49eebf1202SchristosENTRY(sigprocmask) 502d913a7cSmatt tstl 8(%sp) /* check new sigset pointer */ 51eebf1202Schristos jne gotptr /* if not null, indirect */ 522d913a7cSmatt/* movl #0,8(%sp) /* null mask pointer: block empty set */ 53a4ef47e0Smatt movql #1,%d0 /* SIG_BLOCK */ 54a4ef47e0Smatt movl %d0,4(%sp) 55eebf1202Schristos jra doit 56eebf1202Schristosgotptr: 572d913a7cSmatt movl 8(%sp),%a0 582d913a7cSmatt movl (%a0),8(%sp) /* indirect to new mask arg */ 59eebf1202Schristosdoit: 602d913a7cSmatt SYSTRAP(compat_13_sigprocmask13) 61*7c78a65eSmatt jcs CERROR 622d913a7cSmatt tstl 12(%sp) /* test if old mask requested */ 63eebf1202Schristos jeq out 642d913a7cSmatt movl 12(%sp),%a0 652d913a7cSmatt movl %d0,(%a0) /* store old mask */ 66eebf1202Schristosout: 67eebf1202Schristos clrl %d0 68eebf1202Schristos rts 692d913a7cSmattEND(sigprocmask) 70