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

Subversion Repositories altor32

[/] [altor32/] [trunk/] [gcc-x64/] [or1knd-elf/] [or1knd-elf/] [include/] [machine/] [setjmp.h] - Blame information for rev 35

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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