1 1.10 matt /* $NetBSD: sigsetjmp.S,v 1.10 2013/07/16 22:12:20 matt Exp $ */ 2 1.2 thorpej 3 1.1 briggs /*- 4 1.1 briggs * Copyright (c) 1990 The Regents of the University of California. 5 1.1 briggs * All rights reserved. 6 1.1 briggs * 7 1.1 briggs * This code is derived from software contributed to Berkeley by 8 1.1 briggs * the Systems Programming Group of the University of Utah Computer 9 1.1 briggs * Science Department. 10 1.1 briggs * 11 1.1 briggs * Redistribution and use in source and binary forms, with or without 12 1.1 briggs * modification, are permitted provided that the following conditions 13 1.1 briggs * are met: 14 1.1 briggs * 1. Redistributions of source code must retain the above copyright 15 1.1 briggs * notice, this list of conditions and the following disclaimer. 16 1.1 briggs * 2. Redistributions in binary form must reproduce the above copyright 17 1.1 briggs * notice, this list of conditions and the following disclaimer in the 18 1.1 briggs * documentation and/or other materials provided with the distribution. 19 1.7 agc * 3. Neither the name of the University nor the names of its contributors 20 1.1 briggs * may be used to endorse or promote products derived from this software 21 1.1 briggs * without specific prior written permission. 22 1.1 briggs * 23 1.1 briggs * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 1.1 briggs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 1.1 briggs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 1.1 briggs * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 1.1 briggs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 1.1 briggs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 1.1 briggs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 1.1 briggs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 1.1 briggs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 1.1 briggs * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 1.1 briggs * SUCH DAMAGE. 34 1.1 briggs */ 35 1.1 briggs 36 1.3 thorpej #include <machine/asm.h> 37 1.2 thorpej 38 1.1 briggs #if defined(LIBC_SCCS) && !defined(lint) 39 1.2 thorpej #if 0 40 1.2 thorpej RCSID("from: @(#)_setjmp.s 5.1 (Berkeley) 5/12/90") 41 1.2 thorpej #else 42 1.10 matt RCSID("$NetBSD: sigsetjmp.S,v 1.10 2013/07/16 22:12:20 matt Exp $") 43 1.2 thorpej #endif 44 1.1 briggs #endif /* LIBC_SCCS and not lint */ 45 1.1 briggs 46 1.1 briggs /* 47 1.1 briggs * C library -- sigsetjmp, siglongjmp 48 1.1 briggs * 49 1.1 briggs * siglongjmp(a,v) 50 1.1 briggs * will generate a "return(v)" from 51 1.1 briggs * the last call to 52 1.1 briggs * sigsetjmp(a,m) 53 1.1 briggs * by restoring registers from the stack, 54 1.1 briggs * The previous signal state is restored if 'm' was non-zero. 55 1.1 briggs */ 56 1.1 briggs 57 1.1 briggs /* grab _JBLEN */ 58 1.1 briggs #include <m68k/setjmp.h> 59 1.1 briggs 60 1.8 christos ENTRY(__sigsetjmp14) 61 1.9 matt movl 8(%sp),%d1 /* grab the mask */ 62 1.9 matt movl 4(%sp),%a0 /* grab the area pointer */ 63 1.9 matt movl %d1,(_JBLEN * 4)(%a0) /* save at end of area */ 64 1.6 thorpej tstl %d1 65 1.1 briggs bne dosig 66 1.5 itohy jra PIC_PLT(_C_LABEL(_setjmp)) 67 1.1 briggs dosig: 68 1.8 christos jra PIC_PLT(_C_LABEL(__setjmp14)) 69 1.10 matt END(__sigsetjmp14) 70 1.1 briggs 71 1.1 briggs 72 1.8 christos ENTRY(__siglongjmp14) 73 1.9 matt movl 4(%sp),%a0 /* save area pointer */ 74 1.9 matt tstl (_JBLEN * 4)(%a0) /* check mask... */ 75 1.1 briggs bne didsig 76 1.5 itohy jra PIC_PLT(_C_LABEL(_longjmp)) 77 1.1 briggs didsig: 78 1.8 christos jra PIC_PLT(_C_LABEL(__longjmp14)) 79 1.10 matt END(__siglongjmp14) 80