OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [include/] [machine/] [setjmp.h] - Blame information for rev 362

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.