ReactOS  0.4.14-dev-614-gbfd8a84
setjmp.h
Go to the documentation of this file.
1 
6 #ifndef _INC_SETJMP
7 #define _INC_SETJMP
8 
9 #include <crtdefs.h>
10 
11 #pragma pack(push,_CRT_PACKING)
12 
13 #ifdef __cplusplus
14 extern "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 {
39  __MINGW_EXTENSION __int64 LowPart;
40  __MINGW_EXTENSION __int64 HighPart;
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;
93  __MINGW_EXTENSION __int64 IntNats;
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;
114  __MINGW_EXTENSION unsigned __int64 R12;
115  __MINGW_EXTENSION unsigned __int64 R13;
116  __MINGW_EXTENSION unsigned __int64 R14;
117  __MINGW_EXTENSION unsigned __int64 R15;
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 #else
154 
155 #error Define Setjmp for this architecture!
156 
157 #endif
158 
159 #ifndef _JMP_BUF_DEFINED
160  typedef _JBTYPE jmp_buf[_JBLEN];
161 #define _JMP_BUF_DEFINED
162 #endif
163 
164 #ifdef USE_MINGW_SETJMP_TWO_ARGS
165 #ifndef _INC_SETJMPEX
166 #if defined(__x86_64)
167 # define mingw_getsp() \
168  ({ void* value; __asm__ __volatile__("movq %%rsp, %[value]" : [value] "=r" (value)); value; })
169 #elif defined(_X86_)
170 # define mingw_getsp() \
171  ({ void* value; __asm__ __volatile__("movl %%esp, %[value]" : [value] "=r" (value)); value; })
172 #endif
173 #define setjmp(BUF) _setjmp((BUF),mingw_getsp())
174  int __MINGW_NOTHROW __cdecl _setjmp(jmp_buf _Buf,void *_Ctx);
175 #else /* _INC_SETJMPEX */
176 #undef setjmp
177 #define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
178 #define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
179  int __MINGW_NOTHROW __cdecl _setjmpex(jmp_buf _Buf,void *_Ctx);
180 #endif /* _INC_SETJMPEX */
181 #else /* !USE_MINGW_SETJMP_TWO_ARGS */
182 #ifndef _INC_SETJMPEX
183 #define setjmp _setjmp
184 #endif
186 #endif /* !USE_MINGW_SETJMP_TWO_ARGS */
187 
188  __declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
189  __declspec(noreturn) __MINGW_NOTHROW void __cdecl longjmp(jmp_buf _Buf,int _Value);
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #pragma pack(pop)
196 #endif
#define __cdecl
Definition: accygwin.h:79
__declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf
Definition: thread.c:53
#define __MINGW_EXTENSION
Definition: _mingw.h:164
int longjmp(jmp_buf buf, int retval)
_Must_inspect_result_ _In_ CONST FLT_REGISTRATION * Registration
Definition: fltkernel.h:991
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie
Definition: cmfuncs.h:13
#define D(d)
Definition: builtin.c:4543
ULONG Sp
Definition: kdb_expr.c:97
#define _CRT_ALIGN(x)
Definition: crtdefs.h:142
#define __MINGW_NOTHROW
Definition: _mingw.h:154
_JBTYPE jmp_buf[_JBLEN]
Definition: setjmp.h:160
#define R4(v, w, x, y, z, i)
Definition: sha1.c:39
#define setjmp
Definition: setjmp.h:183
int _Value
Definition: setjmp.h:188
#define __int64
Definition: basetyps.h:16