1 /* $NetBSD: _setjmp.S,v 1.2 2006/07/05 18:06:47 ross Exp $ */
3 #include <machine/asm.h>
7 .asciz "$NetBSD: _setjmp.S,v 1.2 2006/07/05 18:06:47 ross 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) */
30 li %r3,0 /* indicate success */
39 mtlr %r11 /* restore LR */
40 mtcr %r12 /* restore CR */
41 mr %r2,%r9 /* restore GPR2 (not needed) */
42 mr %r1,%r10 /* restore stack */
43 or. %r3,%r4,%r4 /* get return value */
44 bnelr /* return if not 0 */
45 li %r3,1 /* what's the point? */