167117Sdfr/*	$NetBSD: sigsetjmp.S,v 1.2 1996/10/17 03:08:07 cgd Exp $	*/
267117Sdfr
367117Sdfr/*
467117Sdfr * Copyright (c) 1994, 1995 Carnegie-Mellon University.
567117Sdfr * All rights reserved.
667117Sdfr *
767117Sdfr * Author: Chris G. Demetriou
867117Sdfr *
967117Sdfr * Permission to use, copy, modify and distribute this software and
1067117Sdfr * its documentation is hereby granted, provided that both the copyright
1167117Sdfr * notice and this permission notice appear in all copies of the
1267117Sdfr * software, derivative works or modified versions, and any portions
1367117Sdfr * thereof, and that both notices appear in supporting documentation.
1467117Sdfr *
1567117Sdfr * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
1667117Sdfr * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
1767117Sdfr * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1867117Sdfr *
1967117Sdfr * Carnegie Mellon requests users of this software to return to
2067117Sdfr *
2167117Sdfr *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
2267117Sdfr *  School of Computer Science
2367117Sdfr *  Carnegie Mellon University
2467117Sdfr *  Pittsburgh PA 15213-3890
2567117Sdfr *
2667117Sdfr * any improvements or extensions that they make and grant Carnegie the
2767117Sdfr * rights to redistribute these changes.
2867117Sdfr */
2967117Sdfr
30111777Sobrien#include <machine/asm.h>
31111777Sobrien__FBSDID("$FreeBSD: releng/10.3/lib/libc/ia64/gen/sigsetjmp.S 111777 2003-03-03 01:09:46Z obrien $");
32111777Sobrien
3385229Sdfr#define LOCORE
3485229Sdfr#include <machine/setjmp.h>
3567117Sdfr
3667117Sdfr/*
3767117Sdfr * C library -- sigsetjmp, siglongjmp
3867117Sdfr *
3967117Sdfr *	siglongjmp(a,v)
4067117Sdfr * will generate a "return(v)" from
4167117Sdfr * the last call to
4267117Sdfr *	sigsetjmp(a, mask)
4367117Sdfr * by restoring registers from the stack.
4467117Sdfr * If `mask' is non-zero, the previous signal
4567117Sdfr * state will be restored.
4667117Sdfr */
4767117Sdfr
4867117SdfrENTRY(sigsetjmp, 2)
49106755Smarcel	add	r14=J_SIGMASK,in0		// place to save mask
50106755Smarcel	cmp.ne	p6,p7=0,in1			// save signal state?
5185229Sdfr	;;
5285229Sdfr	st8	[r14]=in1			// save mask value
5385229Sdfr(p6)	br.cond.dptk.many setjmp
5485229Sdfr(p7)	br.cond.dpnt.many _setjmp
5567117SdfrEND(sigsetjmp)
5667117Sdfr
5785229Sdfr	WEAK_ALIAS(siglongjmp,__siglongjmp)
5867117SdfrENTRY(__siglongjmp, 2)
59106755Smarcel	add	r14=J_SIGMASK,in0		// address of mask value
6085229Sdfr	;;
6185229Sdfr	ld8	r14=[r14]
6285229Sdfr	;;
6385229Sdfr	cmp.ne	p6,p7=0,r14			// did we save signals?
6485229Sdfr(p6)	br.cond.dptk.many longjmp
6585229Sdfr(p7)	br.cond.dpnt.many _longjmp
6667117SdfrEND(__siglongjmp)
67