xref: /netbsd-src/lib/libc/arch/hppa/gen/__sigsetjmp14.S (revision ce099b40997c43048fb78bd578195f81d2456523)
1*ce099b40Smartin/*	$NetBSD: __sigsetjmp14.S,v 1.2 2008/04/28 20:22:55 martin Exp $	*/
202ac1ae2Sfredette
302ac1ae2Sfredette/*-
402ac1ae2Sfredette * Copyright (c) 2002 The NetBSD Foundation, Inc.
502ac1ae2Sfredette * All rights reserved.
602ac1ae2Sfredette *
702ac1ae2Sfredette * This code is derived from software contributed to The NetBSD Foundation
802ac1ae2Sfredette * by Matthew Fredette.
902ac1ae2Sfredette *
1002ac1ae2Sfredette * Redistribution and use in source and binary forms, with or without
1102ac1ae2Sfredette * modification, are permitted provided that the following conditions
1202ac1ae2Sfredette * are met:
1302ac1ae2Sfredette * 1. Redistributions of source code must retain the above copyright
1402ac1ae2Sfredette *    notice, this list of conditions and the following disclaimer.
1502ac1ae2Sfredette * 2. Redistributions in binary form must reproduce the above copyright
1602ac1ae2Sfredette *    notice, this list of conditions and the following disclaimer in the
1702ac1ae2Sfredette *    documentation and/or other materials provided with the distribution.
1802ac1ae2Sfredette *
1902ac1ae2Sfredette * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2002ac1ae2Sfredette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2102ac1ae2Sfredette * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2202ac1ae2Sfredette * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2302ac1ae2Sfredette * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2402ac1ae2Sfredette * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2502ac1ae2Sfredette * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2602ac1ae2Sfredette * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2702ac1ae2Sfredette * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2802ac1ae2Sfredette * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2902ac1ae2Sfredette * POSSIBILITY OF SUCH DAMAGE.
3002ac1ae2Sfredette */
3102ac1ae2Sfredette
3202ac1ae2Sfredette#include <machine/asm.h>
3302ac1ae2Sfredette
3402ac1ae2Sfredette#if defined(LIBC_SCCS) && !defined(lint)
35*ce099b40Smartin	RCSID("$NetBSD: __sigsetjmp14.S,v 1.2 2008/04/28 20:22:55 martin Exp $")
3602ac1ae2Sfredette#endif /* LIBC_SCCS and not lint */
3702ac1ae2Sfredette
3802ac1ae2Sfredette/*
3902ac1ae2Sfredette * C library -- sigsetjmp, siglongjmp
4002ac1ae2Sfredette *
4102ac1ae2Sfredette *	siglongjmp(a,v)
4202ac1ae2Sfredette * will generate a "return(v)" from
4302ac1ae2Sfredette * the last call to
4402ac1ae2Sfredette *	sigsetjmp(a,m)
4502ac1ae2Sfredette * by restoring registers from the stack,
4602ac1ae2Sfredette * The previous signal state is restored if 'm' was non-zero.
4702ac1ae2Sfredette */
4802ac1ae2Sfredette
4902ac1ae2Sfredette/* grab _JBLEN */
5002ac1ae2Sfredette#include <machine/setjmp.h>
5102ac1ae2Sfredette
5202ac1ae2SfredetteENTRY(__sigsetjmp14,0)
5302ac1ae2Sfredette	stw	%arg1, (_JBLEN * 4)(%arg0)	; save mask at end of area
5402ac1ae2Sfredette	add,<>	%r0, %arg0, %r0
5502ac1ae2Sfredette	b,n	_setjmp
5602ac1ae2Sfredette	b,n	__setjmp14
5702ac1ae2SfredetteEXIT(__sigsetjmp14)
5802ac1ae2Sfredette
5902ac1ae2Sfredette
6002ac1ae2SfredetteENTRY(__siglongjmp14,0)
6102ac1ae2Sfredette	ldw	(_JBLEN * 4)(%arg0), %r1
6202ac1ae2Sfredette	add,<>	%r0, %r1, %r0
6302ac1ae2Sfredette	b,n	_longjmp
6402ac1ae2Sfredette	b,n	__longjmp14
6502ac1ae2SfredetteEXIT(__siglongjmp14)
6602ac1ae2Sfredette
6702ac1ae2Sfredette	.end
68