compat_sigprocmask.S revision 1.1
11.1Stsutsui/* $NetBSD: compat_sigprocmask.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ 21.1Stsutsui 31.1Stsutsui/*- 41.1Stsutsui * Copyright (c) 1991, 1993 51.1Stsutsui * The Regents of the University of California. All rights reserved. 61.1Stsutsui * 71.1Stsutsui * This code is derived from software contributed to Berkeley by 81.1Stsutsui * Ralph Campbell. 91.1Stsutsui * 101.1Stsutsui * Redistribution and use in source and binary forms, with or without 111.1Stsutsui * modification, are permitted provided that the following conditions 121.1Stsutsui * are met: 131.1Stsutsui * 1. Redistributions of source code must retain the above copyright 141.1Stsutsui * notice, this list of conditions and the following disclaimer. 151.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright 161.1Stsutsui * notice, this list of conditions and the following disclaimer in the 171.1Stsutsui * documentation and/or other materials provided with the distribution. 181.1Stsutsui * 3. Neither the name of the University nor the names of its contributors 191.1Stsutsui * may be used to endorse or promote products derived from this software 201.1Stsutsui * without specific prior written permission. 211.1Stsutsui * 221.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 231.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 241.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 251.1Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 261.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 271.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 281.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 291.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 301.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 311.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 321.1Stsutsui * SUCH DAMAGE. 331.1Stsutsui */ 341.1Stsutsui 351.1Stsutsui#include "SYS.h" 361.1Stsutsui 371.1Stsutsui#if defined(LIBC_SCCS) && !defined(lint) 381.1Stsutsui ASMSTR("from: @(#)sigprocmask.s 8.1 (Berkeley) 6/4/93") 391.1Stsutsui ASMSTR("$NetBSD: compat_sigprocmask.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") 401.1Stsutsui#endif /* LIBC_SCCS and not lint */ 411.1Stsutsui 421.1StsutsuiWARN_REFERENCES(sigprocmask, \ 431.1Stsutsui "warning: reference to compatibility sigprocmask(); include <signal.h> for correct reference") 441.1Stsutsui 451.1StsutsuiLEAF(sigprocmask) # sigprocmask(how, new, old) sigset_t *new, *old; 461.1Stsutsui#ifdef __ABICALLS__ 471.1Stsutsui .set noreorder 481.1Stsutsui .cpload t9 491.1Stsutsui .set reorder 501.1Stsutsui#endif 511.1Stsutsui bne a1, zero, gotptr # if new sigset pointer not null 521.1Stsutsui li a0, 1 # how = SIG_BLOCK 531.1Stsutsui b doit # mask = zero 541.1Stsutsuigotptr: 551.1Stsutsui lw a1, 0(a1) # indirect to new mask arg 561.1Stsutsuidoit: 571.1Stsutsui li v0, SYS_compat_13_sigprocmask13 581.1Stsutsui syscall 591.1Stsutsui bne a3, zero, err 601.1Stsutsui beq a2, zero, out # test if old mask requested 611.1Stsutsui sw v0, 0(a2) # store old mask 621.1Stsutsuiout: 631.1Stsutsui move v0, zero 641.1Stsutsui j ra 651.1Stsutsuierr: 661.1Stsutsui la t9, _C_LABEL(__cerror) 671.1Stsutsui jr t9 681.1StsutsuiEND(sigprocmask) 69