sigsetjmp.S revision 1.6
11.6Sagc/*	$NetBSD: sigsetjmp.S,v 1.6 2003/08/07 16:42:19 agc 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.6Sagc * 3. Neither the name of the University nor the names of its contributors
191.1Smsaitoh *    may be used to endorse or promote products derived from this software
201.1Smsaitoh *    without specific prior written permission.
211.1Smsaitoh *
221.1Smsaitoh * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
231.1Smsaitoh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
241.1Smsaitoh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
251.1Smsaitoh * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
261.1Smsaitoh * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
271.1Smsaitoh * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
281.1Smsaitoh * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
291.1Smsaitoh * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
301.1Smsaitoh * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
311.1Smsaitoh * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
321.1Smsaitoh * SUCH DAMAGE.
331.1Smsaitoh *
341.1Smsaitoh *	from: @(#)setjmp.s	5.1 (Berkeley) 4/23/90"
351.1Smsaitoh */
361.1Smsaitoh
371.1Smsaitoh#include <machine/asm.h>
381.1Smsaitoh#if defined(LIBC_SCCS)
391.6Sagc	RCSID("$NetBSD: sigsetjmp.S,v 1.6 2003/08/07 16:42:19 agc Exp $")
401.1Smsaitoh#endif
411.1Smsaitoh
421.1SmsaitohENTRY(sigsetjmp)
431.1Smsaitoh	mov	r4, r0
441.2Stsubai	add	#4*9, r0	! &savemask
451.1Smsaitoh	mov.l	r5, @r0
461.1Smsaitoh	tst	r5, r5
471.1Smsaitoh	bt	1f
481.4Smsaitoh
491.1Smsaitoh	sts.l	pr, @-r15
501.1Smsaitoh	mov.l	r4, @-r15
511.1Smsaitoh	mov	#0, r4
521.1Smsaitoh	mov.l	Lsigblock, r0
531.5Smarcus#ifdef PIC
541.5Smarcus	bsrf	r0
551.5Smarcus	nop
561.5Smarcus2:
571.5Smarcus#else
581.1Smsaitoh	jsr	@r0
591.1Smsaitoh	nop
601.5Smarcus#endif
611.1Smsaitoh	mov.l	@r15+, r4
621.1Smsaitoh	lds.l	@r15+, pr
631.1Smsaitoh
641.1Smsaitoh	mov	r4, r1
651.1Smsaitoh	add	#4*10, r1
661.1Smsaitoh	mov.l	r0, @r1
671.4Smsaitoh
681.1Smsaitoh1:
691.1Smsaitoh	add	#4*9, r4
701.1Smsaitoh	mov.l	r15, @-r4
711.1Smsaitoh	mov.l	r14, @-r4
721.1Smsaitoh	mov.l	r13, @-r4
731.1Smsaitoh	mov.l	r12, @-r4
741.1Smsaitoh	mov.l	r11, @-r4
751.1Smsaitoh	mov.l	r10, @-r4
761.1Smsaitoh	mov.l	r9, @-r4
771.1Smsaitoh	mov.l	r8, @-r4
781.1Smsaitoh	sts.l	pr, @-r4
791.1Smsaitoh	rts
801.1Smsaitoh	xor	r0, r0
811.1Smsaitoh
821.1Smsaitoh	.align	2
831.1SmsaitohLsigblock:
841.5Smarcus#ifdef PIC
851.5Smarcus	.long	_C_LABEL(sigblock)-2b
861.5Smarcus#else
871.3Smsaitoh	.long	_C_LABEL(sigblock)
881.5Smarcus#endif
891.1Smsaitoh
901.1SmsaitohENTRY(siglongjmp)
911.1Smsaitoh	mov	r4, r0
921.1Smsaitoh	add	#4*9, r0
931.1Smsaitoh	mov.l	@r0, r0
941.1Smsaitoh	tst	r0, r0
951.1Smsaitoh	bt	1f
961.1Smsaitoh
971.1Smsaitoh	mov.l	r4, @-r15
981.1Smsaitoh	mov.l	r5, @-r15
991.1Smsaitoh	mov	r4, r0
1001.1Smsaitoh	add	#4*10, r0
1011.1Smsaitoh	mov.l	@r0, r4
1021.1Smsaitoh	mov.l	Lsigsetmask, r0
1031.5Smarcus#ifdef PIC
1041.5Smarcus	bsrf	r0
1051.5Smarcus	nop
1061.5Smarcus2:
1071.5Smarcus#else
1081.1Smsaitoh	jsr	@r0
1091.1Smsaitoh	nop
1101.5Smarcus#endif
1111.1Smsaitoh	mov.l	@r15+, r5
1121.1Smsaitoh	mov.l	@r15+, r4
1131.1Smsaitoh
1141.4Smsaitoh1:
1151.1Smsaitoh	mov	r5, r0
1161.1Smsaitoh	lds.l	@r4+, pr
1171.1Smsaitoh	mov.l	@r4+, r8
1181.1Smsaitoh	mov.l	@r4+, r9
1191.1Smsaitoh	mov.l	@r4+, r10
1201.1Smsaitoh	mov.l	@r4+, r11
1211.1Smsaitoh	mov.l	@r4+, r12
1221.1Smsaitoh	mov.l	@r4+, r13
1231.1Smsaitoh	mov.l	@r4+, r14
1241.1Smsaitoh	mov.l	@r4+, r15
1251.1Smsaitoh	tst	r0, r0
1261.1Smsaitoh	bf	.L0
1271.1Smsaitoh	add	#1, r0
1281.1Smsaitoh.L0:
1291.1Smsaitoh	rts
1301.1Smsaitoh	nop
1311.1Smsaitoh
1321.4Smsaitoh	.align	2
1331.1SmsaitohLsigsetmask :
1341.5Smarcus#ifdef PIC
1351.5Smarcus	.long	_C_LABEL(sigsetmask)-2b
1361.5Smarcus#else
1371.3Smsaitoh	.long	_C_LABEL(sigsetmask)
1381.5Smarcus#endif
139