Added missing properties.
[tangerine.git] / arch / ppc-all / clib / longjmp.s
blob9433897738aaab132fb39973b305174d47e96132
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ANSI C function longjmp()
6 Lang: english
7 */
9 /******************************************************************************
11 NAME
12 #include <setjmp.h>
14 void longjmp (jmp_buf env, int val);
16 FUNCTION
17 Save the current context so that you can return to it later.
19 INPUTS
20 env - The context/environment to restore
21 val - This value is returned by setjmp() when you return to the
22 saved context. You cannot return 0. If val is 0, then
23 setjmp() returns with 1.
25 RESULT
26 This function doesn't return.
28 NOTES
30 EXAMPLE
31 jmp_buf env;
33 ... some code ...
35 if (!setjmp (env))
37 ... this code is executed after setjmp() returns ...
39 // This is no good example on how to use this function
40 // You should not do that
41 if (error)
42 longjmp (env, 5);
44 ... some code ...
46 else
48 ... this code is executed if you call longjmp(env) ...
51 BUGS
53 SEE ALSO
54 setjmp()
56 INTERNALS
58 HISTORY
59 12.10.1999 Code rewritten according to glibc
61 ******************************************************************************/
63 #include "aros/ppc/asm.h"
65 .text
66 _ALIGNMENT
67 .globl AROS_CDEFNAME(longjmp)
68 _FUNCTION(longjmp)
69 AROS_CDEFNAME(longjmp):
70 cmpi 0,1,%r4,0
71 bne okret
72 li %r4,1
73 okret:
74 lwz %r1,(0*4)(%r3)
75 lwz %r2,(1*4)(%r3)
76 lwz %r0,(2*4)(%r3)
77 lwz %r14,((3+0)*4)(%r3)
78 lfd %f14,((22+0*2)*4)(%r3)
79 lwz %r15,((3+1)*4)(%r3)
80 lfd %f15,((22+1*2)*4)(%r3)
81 lwz %r16,((3+2)*4)(%r3)
82 lfd %f16,((22+2*2)*4)(%r3)
83 lwz %r17,((3+3)*4)(%r3)
84 lfd %f17,((22+3*2)*4)(%r3)
85 lwz %r18,((3+4)*4)(%r3)
86 lfd %f18,((22+4*2)*4)(%r3)
87 lwz %r19,((3+5)*4)(%r3)
88 lfd %f19,((22+5*2)*4)(%r3)
89 lwz %r20,((3+6)*4)(%r3)
90 lfd %f20,((22+6*2)*4)(%r3)
91 mtlr %r0
92 lwz %r21,((3+7)*4)(%r3)
93 lfd %f21,((22+7*2)*4)(%r3)
94 lwz %r22,((3+8)*4)(%r3)
95 lfd %f22,((22+8*2)*4)(%r3)
96 lwz %r0,(21*4)(%r3)
97 lwz %r23,((3+9)*4)(%r3)
98 lfd %f23,((22+9*2)*4)(%r3)
99 lwz %r24,((3+10)*4)(%r3)
100 lfd %f24,((22+10*2)*4)(%r3)
101 lwz %r25,((3+11)*4)(%r3)
102 lfd %f25,((22+11*2)*4)(%r3)
103 mtcrf 0xFF,%r0
104 lwz %r26,((3+12)*4)(%r3)
105 lfd %f26,((22+12*2)*4)(%r3)
106 lwz %r27,((3+13)*4)(%r3)
107 lfd %f27,((22+13*2)*4)(%r3)
108 lwz %r28,((3+14)*4)(%r3)
109 lfd %f28,((22+14*2)*4)(%r3)
110 lwz %r29,((3+15)*4)(%r3)
111 lfd %f29,((22+15*2)*4)(%r3)
112 lwz %r30,((3+16)*4)(%r3)
113 lfd %f30,((22+16*2)*4)(%r3)
114 lwz %r31,((3+17)*4)(%r3)
115 lfd %f31,((22+17*2)*4)(%r3)
116 mr %r3,%r4