ReactOS 0.4.16-dev-2104-gb84fa49
setjmp.h
Go to the documentation of this file.
1/*
2 * Setjmp/Longjmp definitions
3 *
4 * Copyright 2001 Francois Gouget.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20#ifndef __WINE_SETJMP_H
21#define __WINE_SETJMP_H
22
23#include <corecrt.h>
24
25#include <pshpack8.h>
26
27#ifdef __i386__
28
29typedef struct __JUMP_BUFFER
30{
31 unsigned long Ebp;
32 unsigned long Ebx;
33 unsigned long Edi;
34 unsigned long Esi;
35 unsigned long Esp;
36 unsigned long Eip;
37 unsigned long Registration;
38 unsigned long TryLevel;
39 /* Start of new struct members */
40 unsigned long Cookie;
41 unsigned long UnwindFunc;
42 unsigned long UnwindData[6];
43} _JUMP_BUFFER;
44
45#define _JBLEN 16
46#define _JBTYPE int
47
48#elif defined(__x86_64__)
49
50typedef DECLSPEC_ALIGN(16) struct _SETJMP_FLOAT128
51{
52 unsigned __int64 Part[2];
53} SETJMP_FLOAT128;
54
55typedef DECLSPEC_ALIGN(16) struct _JUMP_BUFFER
56{
57 unsigned __int64 Frame;
58 unsigned __int64 Rbx;
59 unsigned __int64 Rsp;
60 unsigned __int64 Rbp;
61 unsigned __int64 Rsi;
62 unsigned __int64 Rdi;
63 unsigned __int64 R12;
64 unsigned __int64 R13;
65 unsigned __int64 R14;
66 unsigned __int64 R15;
67 unsigned __int64 Rip;
68 unsigned long MxCsr;
69 unsigned short FpCsr;
70 unsigned short Spare;
71 SETJMP_FLOAT128 Xmm6;
72 SETJMP_FLOAT128 Xmm7;
73 SETJMP_FLOAT128 Xmm8;
74 SETJMP_FLOAT128 Xmm9;
75 SETJMP_FLOAT128 Xmm10;
76 SETJMP_FLOAT128 Xmm11;
77 SETJMP_FLOAT128 Xmm12;
78 SETJMP_FLOAT128 Xmm13;
79 SETJMP_FLOAT128 Xmm14;
80 SETJMP_FLOAT128 Xmm15;
81} _JUMP_BUFFER;
82
83#define _JBLEN 16
84typedef SETJMP_FLOAT128 _JBTYPE;
85
86#elif defined(__arm__)
87
88typedef struct _JUMP_BUFFER
89{
90 unsigned long Frame;
91 unsigned long R4;
92 unsigned long R5;
93 unsigned long R6;
94 unsigned long R7;
95 unsigned long R8;
96 unsigned long R9;
97 unsigned long R10;
98 unsigned long R11;
99 unsigned long Sp;
100 unsigned long Pc;
101 unsigned long Fpscr;
102 unsigned long long D[8];
103} _JUMP_BUFFER;
104
105#define _JBLEN 28
106#define _JBTYPE int
107
108#elif defined(__aarch64__)
109
110typedef struct _JUMP_BUFFER
111{
112 unsigned __int64 Frame;
113 unsigned __int64 Reserved;
114 unsigned __int64 X19;
115 unsigned __int64 X20;
116 unsigned __int64 X21;
117 unsigned __int64 X22;
118 unsigned __int64 X23;
119 unsigned __int64 X24;
120 unsigned __int64 X25;
121 unsigned __int64 X26;
122 unsigned __int64 X27;
123 unsigned __int64 X28;
124 unsigned __int64 Fp;
125 unsigned __int64 Lr;
126 unsigned __int64 Sp;
127 unsigned long Fpcr;
128 unsigned long Fpsr;
129 double D[8];
130} _JUMP_BUFFER;
131
132#define _JBLEN 24
133#define _JBTYPE unsigned __int64
134
135#else
136
137#define _JBLEN 1
138#define _JBTYPE int
139
140#endif
141
143
144#ifdef __cplusplus
145extern "C" {
146#endif
147
149
150#ifndef __has_builtin
151# define __has_builtin(x) 0
152#endif
153
154#ifdef _UCRT
155# ifdef __i386__
156# define _setjmp __intrinsic_setjmp
157# else
158# define _setjmpex __intrinsic_setjmpex
159# endif
160#endif
161
162#ifdef __i386__
163_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmp(jmp_buf);
164# define setjmp(buf) _setjmp((buf))
165#elif !defined(_setjmpex) && __has_builtin(_setjmpex)
166_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf);
167# define setjmp(buf) _setjmpex(buf)
168#else
169_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf,void*);
170# if __has_builtin(__builtin_sponentry)
171# define setjmp(buf) _setjmpex((buf), __builtin_sponentry())
172# elif __has_builtin(__builtin_frame_address)
173# define setjmp(buf) _setjmpex((buf), __builtin_frame_address(0))
174# else
175# define setjmp(buf) _setjmpex((buf), NULL)
176# endif
177#endif /* __i386__ */
178
179#ifdef __cplusplus
180}
181#endif
182
183#include <poppack.h>
184
185#endif /* __WINE_SETJMP_H */
@ 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 D(d)
Definition: builtin.c:4557
#define __attribute__(x)
Definition: wpp_private.h:207
#define DECLSPEC_ALIGN(x)
Definition: corecrt.h:141
#define __cdecl
Definition: corecrt.h:121
#define _ACRTIMP
Definition: corecrt.h:153
#define __int64
Definition: corecrt.h:72
#define _JBTYPE
Definition: setjmp.h:138
_ACRTIMP void __cdecl longjmp(jmp_buf, int)
#define _JBLEN
Definition: setjmp.h:137
_JBTYPE jmp_buf[_JBLEN]
Definition: setjmp.h:142
_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
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie
Definition: cmfuncs.h:14