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