[HEADERS]
[reactos.git] / reactos / include / crt / setjmp.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
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 #elif defined(__ia64__)
36 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
37 __MINGW_EXTENSION __int64 LowPart;
38 __MINGW_EXTENSION __int64 HighPart;
39 } SETJMP_FLOAT128;
40
41 #define _JBLEN 33
42 typedef SETJMP_FLOAT128 _JBTYPE;
43
44 typedef struct __JUMP_BUFFER {
45
46 unsigned long iAReserved[6];
47
48 unsigned long Registration;
49 unsigned long TryLevel;
50 unsigned long Cookie;
51 unsigned long UnwindFunc;
52
53 unsigned long UnwindData[6];
54
55 SETJMP_FLOAT128 FltS0;
56 SETJMP_FLOAT128 FltS1;
57 SETJMP_FLOAT128 FltS2;
58 SETJMP_FLOAT128 FltS3;
59 SETJMP_FLOAT128 FltS4;
60 SETJMP_FLOAT128 FltS5;
61 SETJMP_FLOAT128 FltS6;
62 SETJMP_FLOAT128 FltS7;
63 SETJMP_FLOAT128 FltS8;
64 SETJMP_FLOAT128 FltS9;
65 SETJMP_FLOAT128 FltS10;
66 SETJMP_FLOAT128 FltS11;
67 SETJMP_FLOAT128 FltS12;
68 SETJMP_FLOAT128 FltS13;
69 SETJMP_FLOAT128 FltS14;
70 SETJMP_FLOAT128 FltS15;
71 SETJMP_FLOAT128 FltS16;
72 SETJMP_FLOAT128 FltS17;
73 SETJMP_FLOAT128 FltS18;
74 SETJMP_FLOAT128 FltS19;
75 __MINGW_EXTENSION __int64 FPSR;
76 __MINGW_EXTENSION __int64 StIIP;
77 __MINGW_EXTENSION __int64 BrS0;
78 __MINGW_EXTENSION __int64 BrS1;
79 __MINGW_EXTENSION __int64 BrS2;
80 __MINGW_EXTENSION __int64 BrS3;
81 __MINGW_EXTENSION __int64 BrS4;
82 __MINGW_EXTENSION __int64 IntS0;
83 __MINGW_EXTENSION __int64 IntS1;
84 __MINGW_EXTENSION __int64 IntS2;
85 __MINGW_EXTENSION __int64 IntS3;
86 __MINGW_EXTENSION __int64 RsBSP;
87 __MINGW_EXTENSION __int64 RsPFS;
88 __MINGW_EXTENSION __int64 ApUNAT;
89 __MINGW_EXTENSION __int64 ApLC;
90 __MINGW_EXTENSION __int64 IntSp;
91 __MINGW_EXTENSION __int64 IntNats;
92 __MINGW_EXTENSION __int64 Preds;
93
94 } _JUMP_BUFFER;
95 #elif defined(__x86_64)
96 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
97 __MINGW_EXTENSION unsigned __int64 Part[2];
98 } SETJMP_FLOAT128;
99
100 #define _JBLEN 16
101 typedef SETJMP_FLOAT128 _JBTYPE;
102
103 typedef struct _JUMP_BUFFER {
104 __MINGW_EXTENSION unsigned __int64 Frame;
105 __MINGW_EXTENSION unsigned __int64 Rbx;
106 __MINGW_EXTENSION unsigned __int64 Rsp;
107 __MINGW_EXTENSION unsigned __int64 Rbp;
108 __MINGW_EXTENSION unsigned __int64 Rsi;
109 __MINGW_EXTENSION unsigned __int64 Rdi;
110 __MINGW_EXTENSION unsigned __int64 R12;
111 __MINGW_EXTENSION unsigned __int64 R13;
112 __MINGW_EXTENSION unsigned __int64 R14;
113 __MINGW_EXTENSION unsigned __int64 R15;
114 __MINGW_EXTENSION unsigned __int64 Rip;
115 __MINGW_EXTENSION unsigned __int64 Spare;
116 SETJMP_FLOAT128 Xmm6;
117 SETJMP_FLOAT128 Xmm7;
118 SETJMP_FLOAT128 Xmm8;
119 SETJMP_FLOAT128 Xmm9;
120 SETJMP_FLOAT128 Xmm10;
121 SETJMP_FLOAT128 Xmm11;
122 SETJMP_FLOAT128 Xmm12;
123 SETJMP_FLOAT128 Xmm13;
124 SETJMP_FLOAT128 Xmm14;
125 SETJMP_FLOAT128 Xmm15;
126 } _JUMP_BUFFER;
127 #endif
128 #ifndef _JMP_BUF_DEFINED
129 typedef _JBTYPE jmp_buf[_JBLEN];
130 #define _JMP_BUF_DEFINED
131 #endif
132
133 void * __cdecl __MINGW_NOTHROW mingw_getsp(void);
134
135 #ifdef USE_MINGW_SETJMP_TWO_ARGS
136 #ifndef _INC_SETJMPEX
137 #define setjmp(BUF) _setjmp((BUF),mingw_getsp())
138 int __cdecl __MINGW_NOTHROW _setjmp(jmp_buf _Buf,void *_Ctx);
139 #else
140 #undef setjmp
141 #define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
142 #define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
143 int __cdecl __MINGW_NOTHROW _setjmpex(jmp_buf _Buf,void *_Ctx);
144 #endif
145 #else
146 #ifndef _INC_SETJMPEX
147 #define setjmp _setjmp
148 #endif
149 int __cdecl __MINGW_NOTHROW setjmp(jmp_buf _Buf);
150 #endif
151
152 __declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
153 __declspec(noreturn) __MINGW_NOTHROW void __cdecl longjmp(jmp_buf _Buf,int _Value);
154
155 #ifdef __cplusplus
156 }
157 #endif
158
159 #pragma pack(pop)
160 #endif