* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that: (1) source distributions retain this entire copyright
* notice and comment, and (2) distributions including binaries display
* the following acknowledgement: ``This product includes software
* developed by the University of California, Berkeley and its contributors''
* in the documentation or other materials provided with the distribution
* and in all advertising materials mentioning features or use of this
* software. Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#if defined(LIBC_SCCS) && !defined(lint)
.asciz "@(#)_setjmp.s 5.8 (Berkeley) 6/1/90"
#endif /* LIBC_SCCS and not lint */
* C library -- _setjmp, _longjmp
* will generate a "return(v)" from
* by restoring registers from the stack,
* The previous signal state is NOT restored.
movl 12(fp),(r0) # save frame pointer of caller
movl 16(fp),4(r0) # save pc of caller
movl 8(ap),r0 # return(v)
movl 4(ap),r1 # fetch buffer
bitw $1,6(fp) # r0 saved?
bitw $2,6(fp) # was r1 saved?
bitw $2,6(fp) # was r1 saved?
cmpb *16(fp),reiins # returning to an "rei"?
movab 3f,16(fp) # do return w/ psl-pc pop
movab 4f,16(fp) # do standard return
ret # unwind stack before signals enabled
addl2 $8,sp # compensate for PSL-PC push
jmp *4(r1) # done, return....