sigsetjmp.S revision 91662
186535Sjake/*
286535Sjake * Copyright (c) 1995 Paul Kranenburg
386535Sjake * All rights reserved.
486535Sjake *
586535Sjake * Redistribution and use in source and binary forms, with or without
686535Sjake * modification, are permitted provided that the following conditions
786535Sjake * are met:
886535Sjake * 1. Redistributions of source code must retain the above copyright
986535Sjake *    notice, this list of conditions and the following disclaimer.
1086535Sjake * 2. Redistributions in binary form must reproduce the above copyright
1186535Sjake *    notice, this list of conditions and the following disclaimer in the
1286535Sjake *    documentation and/or other materials provided with the distribution.
1386535Sjake * 3. All advertising materials mentioning features or use of this software
1486535Sjake *    must display the following acknowledgement:
1586535Sjake *      This product includes software developed by Paul Kranenburg.
1686535Sjake * 4. The name of the author may not be used to endorse or promote products
1786535Sjake *    derived from this software without specific prior written permission
1886535Sjake *
1986535Sjake * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2086535Sjake * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2186535Sjake * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2286535Sjake * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2386535Sjake * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2486535Sjake * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2586535Sjake * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2686535Sjake * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2786535Sjake * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2886535Sjake * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2986535Sjake *
3086535Sjake */
3186535Sjake
3286535Sjake#if defined(SYSLIBC_RCS) && !defined(lint)
3386535Sjake	.text
3486535Sjake	.asciz "$FreeBSD: head/lib/libc/sparc64/gen/sigsetjmp.S 91662 2002-03-05 04:02:04Z jake $"
3586535Sjake#endif /* SYSLIBC_RCS and not lint */
3686535Sjake
3786535Sjake#include <machine/asm.h>
3886535Sjake
3986535Sjake#include "assym.s"
4086535Sjake
4186535SjakeENTRY(sigsetjmp)
4286535Sjake	PIC_PROLOGUE(%o3, %o2)
4386535Sjake	SET(CNAME(setjmp), %o2, %o3)
4486535Sjake	SET(CNAME(_setjmp), %o2, %o4)
4586535Sjake	movrnz	%o1, %o3, %o4
4686535Sjake	jmp	%o4
4788613Sjake	 stx	%o1, [%o0 + _JB_SIGFLAG]
4886535SjakeEND(sigsetjmp)
4986535Sjake
5086535SjakeENTRY(siglongjmp)
5186535Sjake	PIC_PROLOGUE(%o3, %o2)
5286535Sjake	SET(CNAME(longjmp), %o2, %o3)
5386535Sjake	SET(CNAME(_longjmp), %o2, %o4)
5491662Sjake	ldx	[%o0 + _JB_SIGFLAG], %o2
5591662Sjake	movrnz	%o2, %o3, %o4
5686535Sjake	jmp	%o4
5786535Sjake	 nop
5886535SjakeEND(siglongjmp)
59