* Copyright (c) 1988 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not 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 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* This code is derived from software contributed to Berkeley by
#if defined(LIBC_SCCS) && !defined(lint)
.asciz "@(#)setjmp.s 1.4 (Berkeley) %G%"
#endif /* LIBC_SCCS and not lint */
* C library -- setjmp, longjmp
* will generate a "return(v)" from
* by restoring registers from the stack,
* previous signal mask, and doing a return.
movl 4(fp),r6 # construct sigcontext
movab -8(sp),sp # space for current struct sigstack
pushal (sp) # get current values
callf $16,_sigstack # pop args plus signal stack value
movl (sp)+,(r6) # save onsigstack status of caller
callf $8,_sigblock # get signal mask
movl r0,4(r6) # save signal mask of caller
addl3 $8,fp,8(r6) # save stack pointer of caller
movl (fp),12(r6) # save frame pointer of caller
movl -8(fp),20(r6) # save pc of caller
movpsl 24(r6) # save psl of caller
movl 8(fp),r0 # return(v)
movl 4(fp),r1 # fetch buffer
cmpb *-8(fp),reiins # returning to an "rei"?
movab 3f,-8(fp) # do return w/ psl-pc pop
movab 4f,-8(fp) # do standard return
ret # unwind stack before signals enabled
addl2 $8,sp # compensate for PSL-PC push
pushl r1 # pointer to sigcontext
callf $4,_sigreturn # restore previous context