11.1Schristos/*
21.1Schristos * Copyright (c) 1983, 1993, 1995
31.1Schristos *	The Regents of the University of California.  All rights reserved.
41.1Schristos *
51.1Schristos * Redistribution and use in source and binary forms, with or without
61.1Schristos * modification, are permitted provided that the following conditions
71.1Schristos * are met:
81.1Schristos * 1. Redistributions of source code must retain the above copyright
91.1Schristos *    notice, this list of conditions and the following disclaimer.
101.1Schristos * 2. Redistributions in binary form must reproduce the above copyright
111.1Schristos *    notice, this list of conditions and the following disclaimer in the
121.1Schristos *    documentation and/or other materials provided with the distribution.
131.4Sagc * 3. Neither the name of the University nor the names of its contributors
141.1Schristos *    may be used to endorse or promote products derived from this software
151.1Schristos *    without specific prior written permission.
161.1Schristos *
171.1Schristos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181.1Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191.1Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201.1Schristos * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211.1Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221.1Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231.1Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241.1Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251.1Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261.1Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271.1Schristos * SUCH DAMAGE.
281.1Schristos */
291.1Schristos
301.5Smatt#include "DEFS.h"
311.5Smatt#include <machine/setjmp.h>
321.5Smatt
331.1Schristos#if defined(LIBC_SCCS) && !defined(lint)
341.5SmattRCSID("$NetBSD: __sigsetjmp14.S,v 1.5 2011/01/25 02:38:15 matt Exp $")
351.1Schristos#endif /* LIBC_SCCS and not lint */
361.1Schristos
371.1Schristos/*
381.1Schristos * C library -- sigsetjmp, siglongjmp
391.1Schristos *
401.1Schristos *      siglongjmp(a,v)
411.1Schristos * will generate a "return(v)" from
421.1Schristos * the last call to
431.1Schristos *      sigsetjmp(a, savemask)
441.1Schristos * by restoring registers from the stack,
451.1Schristos * and dependent on savemask restores the
461.1Schristos * signal mask.
471.1Schristos */
481.1Schristos
491.1SchristosENTRY(__sigsetjmp14, R6)
501.3Smatt	movl	4(%ap),%r0		# get env pointer
511.3Smatt	movl	8(%ap),(_JBLEN*4)(%r0)	# save "savemask"
521.3Smatt	tstl	8(%ap)			# do saving of signal mask?
531.1Schristos	beql	L1
541.2Smatt	jmp	_C_LABEL(__setjmp14)+2	# yep, do full setjmp
551.2SmattL1:	jmp	_C_LABEL(_setjmp)+2	# nope, skip to _setjmp
561.5SmattEND(__sigsetjmp14)
571.1Schristos
581.1SchristosENTRY(__siglongjmp14, 0)
591.3Smatt	movl	4(%ap),%r0		# get env pointer
601.3Smatt	tstl	(_JBLEN*4)(%r0)		# test if "savemask" was set
611.1Schristos	beql	L2
621.2Smatt	jmp	_C_LABEL(__longjmp14)+2	# yep, do full longjmp
631.2SmattL2:	jmp	_C_LABEL(_longjmp)+2	# nope, skip to _longjmp
641.5SmattEND(__siglongjmp14)
651.1Schristos
66