Add setjmp/longjmp for ARM and ColdFire to the codec lib, and use it in the Vorbis...
[maemo-rb.git] / apps / codecs / lib / setjmp.h
blob4bcf6af62308a73b24b0bff308a1f15b628b90bb
1 #ifndef _SETJMP_H_
2 #define _SETJMP_H_
4 /* Combined parts of include/setjmp.h and include/machine/setjmp.h in
5 * newlib 1.17.0, with minor changes for Rockbox.
6 */
8 #ifdef CPU_ARM
9 /*
10 * All callee preserved registers:
11 * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7
13 #define _JBLEN 23
14 #endif
16 /* necv70 was 9 as well. */
18 #ifdef CPU_COLDFIRE
20 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
21 * fp2-fp7 for 68881.
22 * All else recovered by under/over(flow) handling.
24 #define _JBLEN 34
25 #endif
27 #ifdef __mips__
28 #ifdef __mips64
29 #define _JBTYPE long long
30 #endif
31 #ifdef __mips_soft_float
32 #define _JBLEN 11
33 #else
34 #define _JBLEN 23
35 #endif
36 #endif
38 #ifdef __sh__
39 #if __SH5__
40 #define _JBLEN 50
41 #define _JBTYPE long long
42 #else
43 #define _JBLEN 20
44 #endif /* __SH5__ */
45 #endif
47 #ifdef _JBLEN
48 #ifdef _JBTYPE
49 typedef _JBTYPE jmp_buf[_JBLEN];
50 #else
51 typedef int jmp_buf[_JBLEN];
52 #endif
53 #endif
56 extern void longjmp(jmp_buf __jmpb, int __retval);
57 extern int setjmp(jmp_buf __jmpb);
59 #endif // _SETJMP_H_