1 .global _longjmp 2 .global longjmp 3 .type _longjmp,@function 4 .type longjmp,@function 5_longjmp: 6longjmp: 7 /* 8 * void longjmp(jmp_buf env, int val); 9 * put val into return register and restore the env saved in setjmp 10 * if val(r4) is 0, put 1 there. 11 */ 12 /* 0) move old return address into r0 */ 13 lwz 0, 0(3) 14 /* 1) put it into link reg */ 15 mtlr 0 16 /* 2 ) restore stack ptr */ 17 lwz 1, 4(3) 18 /* 3) restore control reg */ 19 lwz 0, 8(3) 20 mtcr 0 21 /* 4) restore r14-r31 */ 22 lwz 14, 12(3) 23 lwz 15, 16(3) 24 lwz 16, 20(3) 25 lwz 17, 24(3) 26 lwz 18, 28(3) 27 lwz 19, 32(3) 28 lwz 20, 36(3) 29 lwz 21, 40(3) 30 lwz 22, 44(3) 31 lwz 23, 48(3) 32 lwz 24, 52(3) 33 lwz 25, 56(3) 34 lwz 26, 60(3) 35 lwz 27, 64(3) 36 lwz 28, 68(3) 37 lwz 29, 72(3) 38 lwz 30, 76(3) 39 lwz 31, 80(3) 40#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) 41 mflr 0 42 bl 1f 43 .hidden __hwcap 44 .long __hwcap-. 451: mflr 4 46 lwz 5, 0(4) 47 lwzx 4, 4, 5 48 andis. 4, 4, 0x80 49 beq 1f 50 .long 0x11c35b01 /* evldd 14,88(3) */ 51 .long 0x11e36301 /* ... */ 52 .long 0x12036b01 53 .long 0x12237301 54 .long 0x12437b01 55 .long 0x12638301 56 .long 0x12838b01 57 .long 0x12a39301 58 .long 0x12c39b01 59 .long 0x12e3a301 60 .long 0x1303ab01 61 .long 0x1323b301 62 .long 0x1343bb01 63 .long 0x1363c301 64 .long 0x1383cb01 65 .long 0x13a3d301 66 .long 0x13c3db01 67 .long 0x13e3e301 /* evldd 31,224(3) */ 68 .long 0x11a3eb01 /* evldd 13,232(3) */ 691: mtlr 0 70#else 71 lfd 14,88(3) 72 lfd 15,96(3) 73 lfd 16,104(3) 74 lfd 17,112(3) 75 lfd 18,120(3) 76 lfd 19,128(3) 77 lfd 20,136(3) 78 lfd 21,144(3) 79 lfd 22,152(3) 80 lfd 23,160(3) 81 lfd 24,168(3) 82 lfd 25,176(3) 83 lfd 26,184(3) 84 lfd 27,192(3) 85 lfd 28,200(3) 86 lfd 29,208(3) 87 lfd 30,216(3) 88 lfd 31,224(3) 89#endif 90 /* 5) put val into return reg r3 */ 91 mr 3, 4 92 93 /* 6) check if return value is 0, make it 1 in that case */ 94 cmpwi cr7, 4, 0 95 bne cr7, 1f 96 li 3, 1 971: 98 blr 99 100