root/include/setjmp.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   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 #if defined(__AVR__)
  10 #define _JBLEN 24
  11 #endif
  12 
  13 #ifdef __sparc__
  14 /*
  15  * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext).
  16  * All else recovered by under/over(flow) handling.
  17  */
  18 #define _JBLEN  13
  19 #endif
  20 
  21 #ifdef __BFIN__
  22 #define _JBLEN  40
  23 #endif
  24 
  25 /* necv70 was 9 as well. */
  26 
  27 #ifdef __mc68000__
  28 /*
  29  * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
  30  * fp2-fp7  for 68881.
  31  * All else recovered by under/over(flow) handling.
  32  */
  33 #define _JBLEN  34
  34 #endif
  35 
  36 #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
  37 /*
  38  * D, X, Y are not saved.
  39  * Only take into account the pseudo soft registers (max 32).
  40  */
  41 #define _JBLEN  32
  42 #endif
  43 
  44 #if defined(__Z8001__) || defined(__Z8002__)
  45 /* 16 regs + pc */
  46 #define _JBLEN 20
  47 #endif
  48 
  49 #ifdef _AM29K
  50 /*
  51  * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext).
  52  * All else recovered by under/over(flow) handling.
  53  */
  54 #define _JBLEN  9
  55 #endif
  56 
  57 #if defined(__CYGWIN__) && !defined (_JBLEN)
  58 #define _JBLEN (13 * 4)
  59 #elif defined (__i386__)
  60 #if defined(__unix__) || defined(__rtems__)
  61 # define _JBLEN 9
  62 #else
  63 #include "setjmp-dj.h"
  64 #endif
  65 #endif
  66 
  67 #ifdef __x86_64__
  68 #define _JBTYPE long long
  69 #define _JBLEN  8
  70 #endif
  71 
  72 #ifdef __i960__
  73 #define _JBLEN 35
  74 #endif
  75 
  76 #ifdef __M32R__
  77 /* Only 8 words are currently needed.  10 gives us some slop if we need
  78    to expand.  */
  79 #define _JBLEN 10
  80 #endif
  81 
  82 #ifdef __mips__
  83 #ifdef __mips64
  84 #define _JBTYPE long long
  85 #endif
  86 #ifdef __mips_soft_float
  87 #define _JBLEN 11
  88 #else
  89 #define _JBLEN 23
  90 #endif
  91 #endif
  92 
  93 #ifdef __m88000__
  94 #define _JBLEN 21
  95 #endif
  96 
  97 #ifdef __H8300__
  98 #define _JBLEN 5
  99 #define _JBTYPE int
 100 #endif
 101 
 102 #ifdef __H8300H__
 103 /* same as H8/300 but registers are twice as big */
 104 #define _JBLEN 5
 105 #define _JBTYPE long
 106 #endif
 107 
 108 #if defined (__H8300S__) || defined (__H8300SX__)
 109 /* same as H8/300 but registers are twice as big */
 110 #define _JBLEN 5
 111 #define _JBTYPE long
 112 #endif
 113 
 114 #ifdef __H8500__
 115 #define _JBLEN 4
 116 #endif
 117 
 118 #ifdef  __sh__
 119 #if __SH5__
 120 #define _JBLEN 50
 121 #define _JBTYPE long long
 122 #else
 123 #define _JBLEN 20
 124 #endif /* __SH5__ */
 125 #endif
 126 
 127 #ifdef  __v800
 128 #define _JBLEN 28
 129 #endif
 130 
 131 #ifdef __PPC__
 132 #ifdef __ALTIVEC__
 133 #define _JBLEN 64
 134 #else
 135 #define _JBLEN 32
 136 #endif
 137 #define _JBTYPE double
 138 #endif
 139 
 140 #ifdef __hppa__
 141 /* %r30, %r2-%r18, %r27, pad, %fr12-%fr15.
 142    Note space exists for the FP registers, but they are not
 143    saved.  */
 144 #define _JBLEN 28
 145 #endif
 146 
 147 #if defined(__mn10300__) || defined(__mn10200__)
 148 #ifdef __AM33_2__
 149 #define _JBLEN 26
 150 #else
 151 /* A guess */
 152 #define _JBLEN 10
 153 #endif
 154 #endif
 155 
 156 #ifdef __v850
 157 /* I think our setjmp is saving 15 regs at the moment.  Gives us one word
 158    slop if we need to expand.  */
 159 #define _JBLEN 16
 160 #endif
 161 
 162 #if defined(_C4x)
 163 #define _JBLEN 10
 164 #endif
 165 #if defined(_C3x)
 166 #define _JBLEN 9
 167 #endif
 168 
 169 #ifdef __TIC80__
 170 #define _JBLEN 13
 171 #endif
 172 
 173 #ifdef __D10V__
 174 #define _JBLEN 8
 175 #endif
 176 
 177 #ifdef __D30V__
 178 #define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2)
 179 #define _JBTYPE double
 180 #endif
 181 
 182 #ifdef __frv__
 183 #define _JBLEN (68/2)  /* room for 68 32-bit regs */
 184 #define _JBTYPE double
 185 #endif
 186 
 187 #ifdef __CRX__
 188 #define _JBLEN 9
 189 #endif
 190 
 191 #ifdef __fr30__
 192 #define _JBLEN 10
 193 #endif
 194 
 195 #ifdef __iq2000__
 196 #define _JBLEN 32
 197 #endif
 198 
 199 #ifdef __mcore__
 200 #define _JBLEN 16
 201 #endif
 202 
 203 #ifdef __MMIX__
 204 /* Using a layout compatible with GCC's built-in.  */
 205 #define _JBLEN 5
 206 #define _JBTYPE unsigned long
 207 #endif
 208 
 209 #ifdef __mt__
 210 #define _JBLEN 16
 211 #endif
 212 
 213 #ifdef __SPU__
 214 #define _JBLEN 50 
 215 #define _JBTYPE __vector signed int
 216 #endif
 217 
 218 #ifdef __xstormy16__
 219 /* 4 GPRs plus SP plus PC. */
 220 #define _JBLEN 8
 221 #endif
 222 
 223 #ifdef __mep__
 224 /* 16 GPRs, pc, hi, lo */
 225 #define _JBLEN 19
 226 #endif
 227 
 228 #ifdef __CRIS__
 229 #define _JBLEN 18
 230 #endif
 231 
 232 #ifdef __m32c__
 233 #if defined(__r8c_cpu__) || defined(__m16c_cpu__)
 234 #define _JBLEN (22/2)
 235 #else
 236 #define _JBLEN (34/2)
 237 #endif
 238 #define _JBTYPE unsigned short
 239 #endif /* __m32c__ */
 240 
 241 #ifdef _JBLEN
 242 #ifdef _JBTYPE
 243 typedef _JBTYPE jmp_buf[_JBLEN];
 244 #else
 245 typedef int jmp_buf[_JBLEN];
 246 #endif
 247 #endif
 248 
 249 void longjmp(jmp_buf __jmpb, int __retval);
 250 int setjmp(jmp_buf __jmpb);
 251 
 252 #if defined(__CYGWIN__) || defined(__rtems__)
 253 #include <signal.h>
 254 
 255 #ifdef __cplusplus
 256 extern "C" {
 257 #endif
 258 
 259 /* POSIX sigsetjmp/siglongjmp macros */
 260 typedef int sigjmp_buf[_JBLEN+2];
 261 
 262 #define _SAVEMASK       _JBLEN
 263 #define _SIGMASK        (_JBLEN+1)
 264 
 265 #ifdef __CYGWIN__
 266 # define _CYGWIN_WORKING_SIGSETJMP
 267 #endif
 268 
 269 #if defined(__GNUC__)
 270 
 271 #define sigsetjmp(env, savemask) \
 272             __extension__ \
 273             ({ \
 274               sigjmp_buf *_sjbuf = &(env); \
 275               ((*_sjbuf)[_SAVEMASK] = savemask,\
 276               sigprocmask (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\
 277               setjmp (*_sjbuf)); \
 278             })
 279 
 280 #define siglongjmp(env, val) \
 281             __extension__ \
 282             ({ \
 283               sigjmp_buf *_sjbuf = &(env); \
 284               ((((*_sjbuf)[_SAVEMASK]) ? \
 285                sigprocmask (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\
 286                : 0), \
 287                longjmp (*_sjbuf, val)); \
 288             })
 289 
 290 #else /* !__GNUC__ */
 291 
 292 #define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
 293                sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
 294                setjmp (env))
 295 
 296 #define siglongjmp(env, val) ((((env)[_SAVEMASK])?\
 297                sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
 298                longjmp (env, val))
 299 
 300 #endif
 301 
 302 #ifdef __cplusplus
 303 }
 304 #endif
 305 #endif /* __CYGWIN__ or __rtems__ */

/* [<][>][^][v][top][bottom][index][help] */