1 #if defined(__arm__) || defined(__thumb__) 2 /* 3 * All callee preserved registers: 4 * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7 5 */ 6 #define _JBLEN 23 7 #endif 8 9 #ifdef __sparc__ 10 /* 11 * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). 12 * All else recovered by under/over(flow) handling. 13 */ 14 #define _JBLEN 13 15 #endif 16 17 /* necv70 was 9 as well. */ 18 19 #ifdef __mc68000__ 20 /* 21 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, 22 * fp2-fp7 for 68881. 23 * All else recovered by under/over(flow) handling. 24 */ 25 #define _JBLEN 34 26 #endif 27 28 #if defined(__Z8001__) || defined(__Z8002__) 29 /* 16 regs + pc */ 30 #define _JBLEN 20 31 #endif 32 33 #ifdef _AM29K 34 /* 35 * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). 36 * All else recovered by under/over(flow) handling. 37 */ 38 #define _JBLEN 9 39 #endif 40 41 #if defined(__CYGWIN__) && !defined (_JBLEN) 42 #define _JBLEN (13 * 4) 43 #elif defined (__i386__) 44 #ifdef __unix__ 45 # define _JBLEN 36 46 #else 47 #include "setjmp-dj.h" 48 #endif 49 #endif 50 51 #ifdef __i960__ 52 #define _JBLEN 35 53 #endif 54 55 #ifdef __M32R__ 56 /* Only 8 words are currently needed. 10 gives us some slop if we need 57 to expand. */ 58 #define _JBLEN 10 59 #endif 60 61 #ifdef __mips__ 62 #define _JBLEN 11 63 #endif 64 65 #ifdef __m88000__ 66 #define _JBLEN 21 67 #endif 68 69 #ifdef __H8300__ 70 #define _JBLEN 5 71 typedef int jmp_buf[_JBLEN]; 72 #endif 73 74 #ifdef __H8300H__ 75 /* same as H8/300 but registers are twice as big */ 76 #define _JBLEN 5 77 #define _JBTYPE long 78 #endif 79 80 #ifdef __H8300S__ 81 /* same as H8/300 but registers are twice as big */ 82 #define _JBLEN 5 83 #define _JBTYPE long 84 #endif 85 86 #ifdef __H8500__ 87 #define _JBLEN 4 88 #endif 89 90 #ifdef __sh__ 91 #define _JBLEN 20 92 #endif 93 94 #ifdef __v800 95 #define _JBLEN 28 96 #endif 97 98 #ifdef __PPC__ 99 #define _JBLEN 32 100 #define _JBTYPE double 101 #endif 102 103 #ifdef __hppa__ 104 /* %r30, %r2-%r18, %r27, pad, %fr12-%fr15. 105 Note space exists for the FP registers, but they are not 106 saved. */ 107 #define _JBLEN 28 108 #endif 109 110 #if defined(__mn10300__) || defined(__mn10200__) 111 /* A guess */ 112 #define _JBLEN 10 113 #endif 114 115 #ifdef __v850 116 /* I think our setjmp is saving 15 regs at the moment. Gives us one word 117 slop if we need to expand. */ 118 #define _JBLEN 16 119 #endif 120 121 #ifdef __TIC80__ 122 #define _JBLEN 13 123 #endif 124 125 #ifdef __D10V__ 126 #define _JBLEN 8 127 #endif 128 129 #ifdef __D30V__ 130 #define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2) 131 #define _JBTYPE double 132 #endif 133 134 135 #ifdef __fr30__ 136 #define _JBLEN 10 137 #endif 138 139 #ifdef __mcore__ 140 #define _JBLEN 16 141 #endif 142 143 #ifdef _JBLEN 144 #ifdef _JBTYPE 145 typedef _JBTYPE jmp_buf[_JBLEN]; 146 #else 147 typedef int jmp_buf[_JBLEN]; 148 #endif 149 150 #if defined(__CYGWIN__) || defined(__rtems__) 151 #include <signal.h> 152 153 /* POSIX sigsetjmp/siglongjmp macros */ 154 typedef int sigjmp_buf[_JBLEN+2]; 155 156 #define _SAVEMASK _JBLEN 157 #define _SIGMASK (_JBLEN+1) 158 159 #define sigsetjmp(env, savemask) (env[_SAVEMASK] = savemask,\ 160 sigprocmask (SIG_SETMASK, 0, (sigset_t *) &env[_SIGMASK]),\ 161 setjmp (env)) 162 163 #define siglongjmp(env, val) (((env[_SAVEMASK])?\ 164 sigprocmask (SIG_SETMASK, (sigset_t *) &env[_SIGMASK], 0):0),\ 165 longjmp (env, val)) 166 167 #endif /* __CYGWIN__ or __rtems__ */ 168 #endif |