2001-12-21 20:23:30 +01:00
|
|
|
/*
|
|
|
|
* Setjmp/Longjmp definitions
|
|
|
|
*
|
|
|
|
* Copyright 2001 Francois Gouget.
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-12-21 20:23:30 +01:00
|
|
|
*/
|
|
|
|
#ifndef __WINE_SETJMP_H
|
|
|
|
#define __WINE_SETJMP_H
|
2008-12-11 22:37:34 +01:00
|
|
|
|
2019-08-09 17:32:04 +02:00
|
|
|
#include <corecrt.h>
|
2001-12-21 20:23:30 +01:00
|
|
|
|
2007-02-20 09:35:41 +01:00
|
|
|
#include <pshpack8.h>
|
|
|
|
|
2001-12-21 20:23:30 +01:00
|
|
|
#ifdef __i386__
|
|
|
|
|
|
|
|
typedef struct __JUMP_BUFFER
|
|
|
|
{
|
|
|
|
unsigned long Ebp;
|
|
|
|
unsigned long Ebx;
|
|
|
|
unsigned long Edi;
|
|
|
|
unsigned long Esi;
|
|
|
|
unsigned long Esp;
|
|
|
|
unsigned long Eip;
|
|
|
|
unsigned long Registration;
|
|
|
|
unsigned long TryLevel;
|
|
|
|
/* Start of new struct members */
|
|
|
|
unsigned long Cookie;
|
|
|
|
unsigned long UnwindFunc;
|
|
|
|
unsigned long UnwindData[6];
|
|
|
|
} _JUMP_BUFFER;
|
|
|
|
|
2010-04-10 11:47:55 +02:00
|
|
|
#define _JBLEN 16
|
|
|
|
#define _JBTYPE int
|
2001-12-21 20:23:30 +01:00
|
|
|
|
2010-04-10 11:47:55 +02:00
|
|
|
#elif defined(__x86_64__)
|
2001-12-21 20:23:30 +01:00
|
|
|
|
2019-07-06 20:05:53 +02:00
|
|
|
typedef DECLSPEC_ALIGN(16) struct _SETJMP_FLOAT128
|
2010-04-10 11:47:55 +02:00
|
|
|
{
|
2019-07-06 20:05:53 +02:00
|
|
|
unsigned __int64 Part[2];
|
2010-04-10 11:47:55 +02:00
|
|
|
} SETJMP_FLOAT128;
|
|
|
|
|
2019-07-06 20:05:53 +02:00
|
|
|
typedef DECLSPEC_ALIGN(16) struct _JUMP_BUFFER
|
2010-04-10 11:47:55 +02:00
|
|
|
{
|
|
|
|
unsigned __int64 Frame;
|
|
|
|
unsigned __int64 Rbx;
|
|
|
|
unsigned __int64 Rsp;
|
|
|
|
unsigned __int64 Rbp;
|
|
|
|
unsigned __int64 Rsi;
|
|
|
|
unsigned __int64 Rdi;
|
|
|
|
unsigned __int64 R12;
|
|
|
|
unsigned __int64 R13;
|
|
|
|
unsigned __int64 R14;
|
|
|
|
unsigned __int64 R15;
|
|
|
|
unsigned __int64 Rip;
|
|
|
|
unsigned __int64 Spare;
|
|
|
|
SETJMP_FLOAT128 Xmm6;
|
|
|
|
SETJMP_FLOAT128 Xmm7;
|
|
|
|
SETJMP_FLOAT128 Xmm8;
|
|
|
|
SETJMP_FLOAT128 Xmm9;
|
|
|
|
SETJMP_FLOAT128 Xmm10;
|
|
|
|
SETJMP_FLOAT128 Xmm11;
|
|
|
|
SETJMP_FLOAT128 Xmm12;
|
|
|
|
SETJMP_FLOAT128 Xmm13;
|
|
|
|
SETJMP_FLOAT128 Xmm14;
|
|
|
|
SETJMP_FLOAT128 Xmm15;
|
|
|
|
} _JUMP_BUFFER;
|
|
|
|
|
|
|
|
#define _JBLEN 16
|
|
|
|
typedef SETJMP_FLOAT128 _JBTYPE;
|
|
|
|
|
2013-02-26 23:42:33 +01:00
|
|
|
#elif defined(__arm__)
|
|
|
|
|
|
|
|
typedef struct _JUMP_BUFFER
|
|
|
|
{
|
|
|
|
unsigned long Frame;
|
|
|
|
unsigned long R4;
|
|
|
|
unsigned long R5;
|
|
|
|
unsigned long R6;
|
|
|
|
unsigned long R7;
|
|
|
|
unsigned long R8;
|
|
|
|
unsigned long R9;
|
|
|
|
unsigned long R10;
|
|
|
|
unsigned long R11;
|
|
|
|
unsigned long Sp;
|
|
|
|
unsigned long Pc;
|
|
|
|
unsigned long Fpscr;
|
|
|
|
unsigned long long D[8];
|
|
|
|
} _JUMP_BUFFER;
|
|
|
|
|
|
|
|
#define _JBLEN 28
|
|
|
|
#define _JBTYPE int
|
|
|
|
|
2017-09-08 08:47:33 +02:00
|
|
|
#elif defined(__aarch64__)
|
|
|
|
|
|
|
|
typedef struct _JUMP_BUFFER
|
|
|
|
{
|
|
|
|
unsigned __int64 Frame;
|
|
|
|
unsigned __int64 Reserved;
|
|
|
|
unsigned __int64 X19;
|
|
|
|
unsigned __int64 X20;
|
|
|
|
unsigned __int64 X21;
|
|
|
|
unsigned __int64 X22;
|
|
|
|
unsigned __int64 X23;
|
|
|
|
unsigned __int64 X24;
|
|
|
|
unsigned __int64 X25;
|
|
|
|
unsigned __int64 X26;
|
|
|
|
unsigned __int64 X27;
|
|
|
|
unsigned __int64 X28;
|
|
|
|
unsigned __int64 Fp;
|
|
|
|
unsigned __int64 Lr;
|
|
|
|
unsigned __int64 Sp;
|
|
|
|
unsigned long Fpcr;
|
|
|
|
unsigned long Fpsr;
|
|
|
|
double D[8];
|
|
|
|
} _JUMP_BUFFER;
|
|
|
|
|
|
|
|
#define _JBLEN 24
|
|
|
|
#define _JBTYPE unsigned __int64
|
|
|
|
|
2010-04-10 11:47:55 +02:00
|
|
|
#else
|
|
|
|
|
|
|
|
#define _JBLEN 1
|
|
|
|
#define _JBTYPE int
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef _JBTYPE jmp_buf[_JBLEN];
|
2001-12-21 20:23:30 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-02-01 16:34:42 +01:00
|
|
|
void __cdecl longjmp(jmp_buf,int);
|
2001-12-21 20:23:30 +01:00
|
|
|
|
2020-11-06 12:11:17 +01:00
|
|
|
#ifdef _WIN64
|
2020-05-27 19:13:09 +02:00
|
|
|
# ifdef _UCRT
|
|
|
|
# define _setjmpex __intrinsic_setjmpex
|
|
|
|
# endif
|
2020-11-06 12:11:17 +01:00
|
|
|
# ifdef __GNUC__
|
2019-05-30 12:48:49 +02:00
|
|
|
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf,void*);
|
|
|
|
# define setjmp(buf) _setjmpex(buf,__builtin_frame_address(0))
|
|
|
|
# define setjmpex(buf) _setjmpex(buf,__builtin_frame_address(0))
|
2020-11-06 12:11:17 +01:00
|
|
|
# endif
|
|
|
|
#else /* _WIN64 */
|
|
|
|
# ifdef _UCRT
|
|
|
|
# define _setjmp __intrinsic_setjmp
|
|
|
|
# endif
|
|
|
|
# ifdef __GNUC__
|
|
|
|
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf);
|
|
|
|
# else
|
|
|
|
int __cdecl _setjmp(jmp_buf);
|
|
|
|
# endif
|
|
|
|
#endif /* _WIN64 */
|
|
|
|
|
|
|
|
#ifndef setjmp
|
|
|
|
#define setjmp _setjmp
|
2019-05-30 12:48:49 +02:00
|
|
|
#endif
|
|
|
|
|
2001-12-21 20:23:30 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-02-20 09:35:41 +01:00
|
|
|
#include <poppack.h>
|
|
|
|
|
2001-12-21 20:23:30 +01:00
|
|
|
#endif /* __WINE_SETJMP_H */
|