1 /* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */
3 #include <machine/asm.h>
7 .asciz "$NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $"
11 * C library -- _setjmp, _longjmp
14 * will generate a "return(v?v:1)" from the last call to
16 * by restoring registers from the stack.
17 * The previous signal state is NOT restored.
21 mflr %r11 /* save return address */
22 mfcr %r12 /* save condition register */
23 mr %r10,%r1 /* save stack pointer */
24 mr %r9,%r2 /* save GPR2 (not needed) */
25 stmw %r9,8(%r3) /* save r9..r31 */
26 li %r3,0 /* indicate success */
30 lmw %r9,8(%r3) /* save r9..r31 */
31 mtlr %r11 /* restore LR */
32 mtcr %r12 /* restore CR */
33 mr %r2,%r9 /* restore GPR2 (not needed) */
34 mr %r1,%r10 /* restore stack */
35 or. %r3,%r4,%r4 /* get return value */
36 bnelr /* return if not 0 */
37 li %r3,1 /* what's the point? */