sigsetjmp.S revision 1.5
11.5Smarcus/*	$NetBSD: sigsetjmp.S,v 1.5 2003/07/01 14:35:44 marcus Exp $	*/
21.1Smsaitoh
31.1Smsaitoh/*-
41.1Smsaitoh * Copyright (c) 1990 The Regents of the University of California.
51.1Smsaitoh * All rights reserved.
61.1Smsaitoh *
71.1Smsaitoh * This code is derived from software contributed to Berkeley by
81.1Smsaitoh * William Jolitz.
91.1Smsaitoh *
101.1Smsaitoh * Redistribution and use in source and binary forms, with or without
111.1Smsaitoh * modification, are permitted provided that the following conditions
121.1Smsaitoh * are met:
131.1Smsaitoh * 1. Redistributions of source code must retain the above copyright
141.1Smsaitoh *    notice, this list of conditions and the following disclaimer.
151.1Smsaitoh * 2. Redistributions in binary form must reproduce the above copyright
161.1Smsaitoh *    notice, this list of conditions and the following disclaimer in the
171.1Smsaitoh *    documentation and/or other materials provided with the distribution.
181.1Smsaitoh * 3. All advertising materials mentioning features or use of this software
191.1Smsaitoh *    must display the following acknowledgement:
201.1Smsaitoh *	This product includes software developed by the University of
211.1Smsaitoh *	California, Berkeley and its contributors.
221.1Smsaitoh * 4. Neither the name of the University nor the names of its contributors
231.1Smsaitoh *    may be used to endorse or promote products derived from this software
241.1Smsaitoh *    without specific prior written permission.
251.1Smsaitoh *
261.1Smsaitoh * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271.1Smsaitoh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281.1Smsaitoh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291.1Smsaitoh * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301.1Smsaitoh * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311.1Smsaitoh * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321.1Smsaitoh * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331.1Smsaitoh * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341.1Smsaitoh * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351.1Smsaitoh * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361.1Smsaitoh * SUCH DAMAGE.
371.1Smsaitoh *
381.1Smsaitoh *	from: @(#)setjmp.s	5.1 (Berkeley) 4/23/90"
391.1Smsaitoh */
401.1Smsaitoh
411.1Smsaitoh#include <machine/asm.h>
421.1Smsaitoh#if defined(LIBC_SCCS)
431.5Smarcus	RCSID("$NetBSD: sigsetjmp.S,v 1.5 2003/07/01 14:35:44 marcus Exp $")
441.1Smsaitoh#endif
451.1Smsaitoh
461.1SmsaitohENTRY(sigsetjmp)
471.1Smsaitoh	mov	r4, r0
481.2Stsubai	add	#4*9, r0	! &savemask
491.1Smsaitoh	mov.l	r5, @r0
501.1Smsaitoh	tst	r5, r5
511.1Smsaitoh	bt	1f
521.4Smsaitoh
531.1Smsaitoh	sts.l	pr, @-r15
541.1Smsaitoh	mov.l	r4, @-r15
551.1Smsaitoh	mov	#0, r4
561.1Smsaitoh	mov.l	Lsigblock, r0
571.5Smarcus#ifdef PIC
581.5Smarcus	bsrf	r0
591.5Smarcus	nop
601.5Smarcus2:
611.5Smarcus#else
621.1Smsaitoh	jsr	@r0
631.1Smsaitoh	nop
641.5Smarcus#endif
651.1Smsaitoh	mov.l	@r15+, r4
661.1Smsaitoh	lds.l	@r15+, pr
671.1Smsaitoh
681.1Smsaitoh	mov	r4, r1
691.1Smsaitoh	add	#4*10, r1
701.1Smsaitoh	mov.l	r0, @r1
711.4Smsaitoh
721.1Smsaitoh1:
731.1Smsaitoh	add	#4*9, r4
741.1Smsaitoh	mov.l	r15, @-r4
751.1Smsaitoh	mov.l	r14, @-r4
761.1Smsaitoh	mov.l	r13, @-r4
771.1Smsaitoh	mov.l	r12, @-r4
781.1Smsaitoh	mov.l	r11, @-r4
791.1Smsaitoh	mov.l	r10, @-r4
801.1Smsaitoh	mov.l	r9, @-r4
811.1Smsaitoh	mov.l	r8, @-r4
821.1Smsaitoh	sts.l	pr, @-r4
831.1Smsaitoh	rts
841.1Smsaitoh	xor	r0, r0
851.1Smsaitoh
861.1Smsaitoh	.align	2
871.1SmsaitohLsigblock:
881.5Smarcus#ifdef PIC
891.5Smarcus	.long	_C_LABEL(sigblock)-2b
901.5Smarcus#else
911.3Smsaitoh	.long	_C_LABEL(sigblock)
921.5Smarcus#endif
931.1Smsaitoh
941.1SmsaitohENTRY(siglongjmp)
951.1Smsaitoh	mov	r4, r0
961.1Smsaitoh	add	#4*9, r0
971.1Smsaitoh	mov.l	@r0, r0
981.1Smsaitoh	tst	r0, r0
991.1Smsaitoh	bt	1f
1001.1Smsaitoh
1011.1Smsaitoh	mov.l	r4, @-r15
1021.1Smsaitoh	mov.l	r5, @-r15
1031.1Smsaitoh	mov	r4, r0
1041.1Smsaitoh	add	#4*10, r0
1051.1Smsaitoh	mov.l	@r0, r4
1061.1Smsaitoh	mov.l	Lsigsetmask, r0
1071.5Smarcus#ifdef PIC
1081.5Smarcus	bsrf	r0
1091.5Smarcus	nop
1101.5Smarcus2:
1111.5Smarcus#else
1121.1Smsaitoh	jsr	@r0
1131.1Smsaitoh	nop
1141.5Smarcus#endif
1151.1Smsaitoh	mov.l	@r15+, r5
1161.1Smsaitoh	mov.l	@r15+, r4
1171.1Smsaitoh
1181.4Smsaitoh1:
1191.1Smsaitoh	mov	r5, r0
1201.1Smsaitoh	lds.l	@r4+, pr
1211.1Smsaitoh	mov.l	@r4+, r8
1221.1Smsaitoh	mov.l	@r4+, r9
1231.1Smsaitoh	mov.l	@r4+, r10
1241.1Smsaitoh	mov.l	@r4+, r11
1251.1Smsaitoh	mov.l	@r4+, r12
1261.1Smsaitoh	mov.l	@r4+, r13
1271.1Smsaitoh	mov.l	@r4+, r14
1281.1Smsaitoh	mov.l	@r4+, r15
1291.1Smsaitoh	tst	r0, r0
1301.1Smsaitoh	bf	.L0
1311.1Smsaitoh	add	#1, r0
1321.1Smsaitoh.L0:
1331.1Smsaitoh	rts
1341.1Smsaitoh	nop
1351.1Smsaitoh
1361.4Smsaitoh	.align	2
1371.1SmsaitohLsigsetmask :
1381.5Smarcus#ifdef PIC
1391.5Smarcus	.long	_C_LABEL(sigsetmask)-2b
1401.5Smarcus#else
1411.3Smsaitoh	.long	_C_LABEL(sigsetmask)
1421.5Smarcus#endif
143