Home | History | Annotate | Line # | Download | only in gen
      1  1.5  skrll /*	$NetBSD: __setjmp14.S,v 1.5 2023/10/11 09:12:21 skrll Exp $	*/
      2  1.1   ross 
      3  1.3   matt #include "SYS.h"
      4  1.1   ross 
      5  1.1   ross #if defined(LIBC_SCCS)
      6  1.5  skrll __RCSID("$NetBSD: __setjmp14.S,v 1.5 2023/10/11 09:12:21 skrll Exp $")
      7  1.1   ross #endif
      8  1.1   ross 
      9  1.1   ross /*
     10  1.1   ross  * C library -- _setjmp, _longjmp
     11  1.1   ross  *
     12  1.1   ross  *	longjmp(a,v)
     13  1.1   ross  * will generate a "return(v?v:1)" from the last call to
     14  1.1   ross  *	setjmp(a)
     15  1.1   ross  * by restoring registers from the stack.
     16  1.1   ross  * The previous signal state is restored.
     17  1.1   ross  */
     18  1.1   ross 
     19  1.1   ross ENTRY(__setjmp14)
     20  1.1   ross 	mr	%r6,%r3
     21  1.5  skrll 	li	%r3,0
     22  1.1   ross 	li	%r4,0
     23  1.1   ross 	addi	%r5,%r6,100		# &sigmask
     24  1.3   matt 	_DOSYSCALL(__sigprocmask14)	# assume no error	XXX
     25  1.1   ross 	mflr	%r11
     26  1.1   ross 	mfcr	%r12
     27  1.1   ross 	mr	%r10,%r1
     28  1.1   ross 	mr	%r9,%r2
     29  1.2     he 
     30  1.2     he 	std	%r8,8(%r6)		# save r8-r31
     31  1.2     he 	std	%r9,16(%r6)
     32  1.2     he 	std	%r10,24(%r6)
     33  1.2     he 	std	%r11,32(%r6)
     34  1.2     he 	std	%r12,40(%r6)
     35  1.2     he 	std	%r13,48(%r6)
     36  1.2     he 	std	%r14,56(%r6)
     37  1.2     he 	std	%r15,64(%r6)
     38  1.2     he 	std	%r16,72(%r6)
     39  1.2     he 	std	%r17,80(%r6)
     40  1.2     he 	std	%r18,88(%r6)
     41  1.2     he 	std	%r19,96(%r6)
     42  1.2     he 	std	%r20,104(%r6)
     43  1.2     he 	std	%r21,112(%r6)
     44  1.2     he 	std	%r22,120(%r6)
     45  1.2     he 	std	%r23,128(%r6)
     46  1.2     he 	std	%r24,136(%r6)
     47  1.2     he 	std	%r25,144(%r6)
     48  1.2     he 	std	%r26,152(%r6)
     49  1.2     he 	std	%r27,160(%r6)
     50  1.2     he 	std	%r28,168(%r6)
     51  1.2     he 	std	%r29,176(%r6)
     52  1.2     he 	std	%r30,184(%r6)
     53  1.2     he 	std	%r31,192(%r6)
     54  1.2     he 
     55  1.1   ross 	li	%r3,0
     56  1.1   ross 	blr
     57  1.3   matt END(__setjmp14)
     58  1.1   ross 
     59  1.1   ross ENTRY(__longjmp14)
     60  1.2     he 	ld	%r8,8(%r6)		# load r8-r31
     61  1.2     he 	ld	%r9,16(%r6)
     62  1.2     he 	ld	%r10,24(%r6)
     63  1.2     he 	ld	%r11,32(%r6)
     64  1.2     he 	ld	%r12,40(%r6)
     65  1.2     he 	ld	%r13,48(%r6)
     66  1.2     he 	ld	%r14,56(%r6)
     67  1.2     he 	ld	%r15,64(%r6)
     68  1.2     he 	ld	%r16,72(%r6)
     69  1.2     he 	ld	%r17,80(%r6)
     70  1.2     he 	ld	%r18,88(%r6)
     71  1.4  skrll 	ld	%r19,96(%r6)
     72  1.2     he 	ld	%r20,104(%r6)
     73  1.2     he 	ld	%r21,112(%r6)
     74  1.2     he 	ld	%r22,120(%r6)
     75  1.2     he 	ld	%r23,128(%r6)
     76  1.2     he 	ld	%r24,136(%r6)
     77  1.2     he 	ld	%r25,144(%r6)
     78  1.2     he 	ld	%r26,152(%r6)
     79  1.2     he 	ld	%r27,160(%r6)
     80  1.2     he 	ld	%r28,168(%r6)
     81  1.2     he 	ld	%r29,176(%r6)
     82  1.2     he 	ld	%r30,184(%r6)
     83  1.2     he 	ld	%r31,192(%r6)
     84  1.2     he 
     85  1.1   ross 	mr	%r6,%r4
     86  1.1   ross 	mtlr	%r11
     87  1.1   ross 	mtcr	%r12
     88  1.1   ross 	mr	%r2,%r9
     89  1.1   ross 	mr	%r1,%r10
     90  1.1   ross 	addi	%r4,%r3,100		# &sigmask
     91  1.1   ross 	li	%r3,3			# SIG_SETMASK
     92  1.1   ross 	li	%r5,0
     93  1.3   matt 	_DOSYSCALL(__sigprocmask14)	# assume no error	XXX
     94  1.1   ross 	or.	%r3,%r6,%r6
     95  1.1   ross 	bnelr
     96  1.1   ross 	li	%r3,1
     97  1.1   ross 	blr
     98  1.3   matt END(__longjmp14)
     99