Home | History | Annotate | Line # | Download | only in gen
sigsetjmp.S revision 1.7
      1  1.7      agc /*	$NetBSD: sigsetjmp.S,v 1.7 2003/08/07 16:42:11 agc 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.7      agc 	RCSID("$NetBSD: sigsetjmp.S,v 1.7 2003/08/07 16:42:11 agc 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.1   briggs ENTRY(sigsetjmp)
     61  1.6  thorpej 	movl	%sp@(8),%d1	/* grab the mask */
     62  1.6  thorpej         movl	%sp@(4),%a0	/* grab the area pointer */
     63  1.6  thorpej 	movl	%d1,%a0@(_JBLEN * 4 )	/* 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.5    itohy 	jra	PIC_PLT(_C_LABEL(setjmp))
     69  1.1   briggs 
     70  1.1   briggs 
     71  1.1   briggs ENTRY(siglongjmp)
     72  1.6  thorpej 	movl	%sp@(4),%a0	/* save area pointer */
     73  1.6  thorpej 	tstl	%a0@(_JBLEN * 4) /* check mask... */
     74  1.1   briggs 	bne	didsig
     75  1.5    itohy 	jra	PIC_PLT(_C_LABEL(_longjmp))
     76  1.1   briggs didsig:
     77  1.5    itohy 	jra	PIC_PLT(_C_LABEL(longjmp))
     78