ReactOS 0.4.16-dev-250-g3ecd236
setjmp.h
Go to the documentation of this file.
1
6#ifndef _INC_SETJMP
7#define _INC_SETJMP
8
9#include <vcruntime.h>
10
11#pragma pack(push,_CRT_PACKING)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if (defined(_X86_) && !defined(__x86_64))
18
19#define _JBLEN 16
20#define _JBTYPE int
21
22 typedef struct __JUMP_BUFFER {
23 unsigned long Ebp;
24 unsigned long Ebx;
25 unsigned long Edi;
26 unsigned long Esi;
27 unsigned long Esp;
28 unsigned long Eip;
29 unsigned long Registration;
30 unsigned long TryLevel;
31 unsigned long Cookie;
32 unsigned long UnwindFunc;
33 unsigned long UnwindData[6];
34 } _JUMP_BUFFER;
35
36#elif defined(__ia64__)
37
38 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
41 } SETJMP_FLOAT128;
42
43#define _JBLEN 33
44 typedef SETJMP_FLOAT128 _JBTYPE;
45
46 typedef struct __JUMP_BUFFER {
47
48 unsigned long iAReserved[6];
49
50 unsigned long Registration;
51 unsigned long TryLevel;
52 unsigned long Cookie;
53 unsigned long UnwindFunc;
54
55 unsigned long UnwindData[6];
56
57 SETJMP_FLOAT128 FltS0;
58 SETJMP_FLOAT128 FltS1;
59 SETJMP_FLOAT128 FltS2;
60 SETJMP_FLOAT128 FltS3;
61 SETJMP_FLOAT128 FltS4;
62 SETJMP_FLOAT128 FltS5;
63 SETJMP_FLOAT128 FltS6;
64 SETJMP_FLOAT128 FltS7;
65 SETJMP_FLOAT128 FltS8;
66 SETJMP_FLOAT128 FltS9;
67 SETJMP_FLOAT128 FltS10;
68 SETJMP_FLOAT128 FltS11;
69 SETJMP_FLOAT128 FltS12;
70 SETJMP_FLOAT128 FltS13;
71 SETJMP_FLOAT128 FltS14;
72 SETJMP_FLOAT128 FltS15;
73 SETJMP_FLOAT128 FltS16;
74 SETJMP_FLOAT128 FltS17;
75 SETJMP_FLOAT128 FltS18;
76 SETJMP_FLOAT128 FltS19;
95
96 } _JUMP_BUFFER;
97
98#elif defined(__x86_64)
99
100 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
101 __MINGW_EXTENSION unsigned __int64 Part[2];
102 } SETJMP_FLOAT128;
103
104#define _JBLEN 16
105 typedef SETJMP_FLOAT128 _JBTYPE;
106
107 typedef struct _JUMP_BUFFER {
108 __MINGW_EXTENSION unsigned __int64 Frame;
109 __MINGW_EXTENSION unsigned __int64 Rbx;
110 __MINGW_EXTENSION unsigned __int64 Rsp;
111 __MINGW_EXTENSION unsigned __int64 Rbp;
112 __MINGW_EXTENSION unsigned __int64 Rsi;
113 __MINGW_EXTENSION unsigned __int64 Rdi;
118 __MINGW_EXTENSION unsigned __int64 Rip;
119 __MINGW_EXTENSION unsigned __int64 Spare;
120 SETJMP_FLOAT128 Xmm6;
121 SETJMP_FLOAT128 Xmm7;
122 SETJMP_FLOAT128 Xmm8;
123 SETJMP_FLOAT128 Xmm9;
124 SETJMP_FLOAT128 Xmm10;
125 SETJMP_FLOAT128 Xmm11;
126 SETJMP_FLOAT128 Xmm12;
127 SETJMP_FLOAT128 Xmm13;
128 SETJMP_FLOAT128 Xmm14;
129 SETJMP_FLOAT128 Xmm15;
130 } _JUMP_BUFFER;
131
132#elif defined(_M_ARM)
133
134#define _JBLEN 28
135#define _JBTYPE int
136
137 typedef struct _JUMP_BUFFER {
138 unsigned long Frame;
139 unsigned long R4;
140 unsigned long R5;
141 unsigned long R6;
142 unsigned long R7;
143 unsigned long R8;
144 unsigned long R9;
145 unsigned long R10;
146 unsigned long R11;
147 unsigned long Sp;
148 unsigned long Pc;
149 unsigned long Fpscr;
150 unsigned long long D[8]; // D8-D15 VFP/NEON regs
151 } _JUMP_BUFFER;
152
153#elif defined(_M_ARM64)
154
155#define _JBLEN 24
156#define _JBTYPE unsigned __int64
157
158typedef struct __JUMP_BUFFER {
159 unsigned __int64 Frame;
160 unsigned __int64 Reserved;
161 unsigned __int64 X19;
162 unsigned __int64 X20;
163 unsigned __int64 X21;
164 unsigned __int64 X22;
165 unsigned __int64 X23;
166 unsigned __int64 X24;
167 unsigned __int64 X25;
168 unsigned __int64 X26;
169 unsigned __int64 X27;
170 unsigned __int64 X28;
171 unsigned __int64 Fp;
172 unsigned __int64 Lr;
173 unsigned __int64 Sp;
174 unsigned long Fpcr;
175 unsigned long Fpsr;
176 double D[8];
177 } _JUMP_BUFFER;
178
179#else
180
181#error Define Setjmp for this architecture!
182
183#endif
184
185#ifndef _JMP_BUF_DEFINED
186 typedef _JBTYPE jmp_buf[_JBLEN];
187#define _JMP_BUF_DEFINED
188#endif
189
190#ifdef USE_MINGW_SETJMP_TWO_ARGS
191#ifndef _INC_SETJMPEX
192#if defined(__x86_64)
193# define mingw_getsp() \
194 ({ void* value; __asm__ __volatile__("movq %%rsp, %[value]" : [value] "=r" (value)); value; })
195#elif defined(_X86_)
196# define mingw_getsp() \
197 ({ void* value; __asm__ __volatile__("movl %%esp, %[value]" : [value] "=r" (value)); value; })
198#endif
199#define setjmp(BUF) _setjmp((BUF),mingw_getsp())
200 int __MINGW_NOTHROW __cdecl _setjmp(jmp_buf _Buf,void *_Ctx);
201#else /* _INC_SETJMPEX */
202#undef setjmp
203#define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
204#define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
205 int __MINGW_NOTHROW __cdecl _setjmpex(jmp_buf _Buf,void *_Ctx);
206#endif /* _INC_SETJMPEX */
207#else /* !USE_MINGW_SETJMP_TWO_ARGS */
208#ifndef _INC_SETJMPEX
209#define setjmp _setjmp
210#endif
212#endif /* !USE_MINGW_SETJMP_TWO_ARGS */
213
214 __declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
215 __declspec(noreturn) __MINGW_NOTHROW void __cdecl longjmp(jmp_buf _Buf,int _Value);
216
217#ifdef __cplusplus
218}
219#endif
220
221#pragma pack(pop)
222#endif
#define __MINGW_NOTHROW
Definition: _mingw.h:156
#define __MINGW_EXTENSION
Definition: _mingw.h:166
#define __cdecl
Definition: accygwin.h:79
@ R15
Definition: amd64_sup.c:13
@ R13
Definition: amd64_sup.c:13
@ R12
Definition: amd64_sup.c:13
@ R9
Definition: amd64_sup.c:13
@ R14
Definition: amd64_sup.c:13
@ R8
Definition: amd64_sup.c:13
@ R11
Definition: amd64_sup.c:13
@ R10
Definition: amd64_sup.c:13
#define __int64
Definition: basetyps.h:16
#define D(d)
Definition: builtin.c:4557
_Must_inspect_result_ _In_ CONST FLT_REGISTRATION * Registration
Definition: fltkernel.h:991
ULONG Sp
Definition: kdb_expr.c:99
#define R4(v, w, x, y, z, i)
Definition: sha1.c:39
__declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf
Definition: noreturn.cpp:19
#define setjmp
Definition: setjmp.h:209
int _Value
Definition: setjmp.h:214
_JBTYPE jmp_buf[_JBLEN]
Definition: setjmp.h:186
#define _CRT_ALIGN(x)
Definition: vcruntime.h:154
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie
Definition: cmfuncs.h:14