2008-12-13 21:28:05 +00:00
|
|
|
/**
|
2007-09-24 11:40:54 +00:00
|
|
|
* This file has no copyright assigned and is placed in the Public Domain.
|
2008-12-13 21:28:05 +00:00
|
|
|
* This file is part of the w64 mingw-runtime package.
|
|
|
|
* No warranty is given; refer to the file DISCLAIMER within this package.
|
2007-09-24 11:40:54 +00:00
|
|
|
*/
|
2008-12-13 21:28:05 +00:00
|
|
|
#ifndef _INC_SETJMP
|
|
|
|
#define _INC_SETJMP
|
2007-09-24 11:40:54 +00:00
|
|
|
|
2008-12-21 23:33:19 +00:00
|
|
|
#include <crtdefs.h>
|
2007-09-24 11:40:54 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#pragma pack(push,_CRT_PACKING)
|
2007-09-24 11:40:54 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#if (defined(_X86_) && !defined(__x86_64))
|
|
|
|
|
2007-09-24 11:40:54 +00:00
|
|
|
#define _JBLEN 16
|
|
|
|
#define _JBTYPE int
|
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
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;
|
|
|
|
unsigned long Cookie;
|
|
|
|
unsigned long UnwindFunc;
|
|
|
|
unsigned long UnwindData[6];
|
|
|
|
} _JUMP_BUFFER;
|
2010-07-21 00:31:14 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#elif defined(__ia64__)
|
2010-07-21 00:31:14 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
|
2010-02-28 09:37:57 +00:00
|
|
|
__MINGW_EXTENSION __int64 LowPart;
|
|
|
|
__MINGW_EXTENSION __int64 HighPart;
|
2008-12-13 21:28:05 +00:00
|
|
|
} SETJMP_FLOAT128;
|
2007-09-24 11:40:54 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#define _JBLEN 33
|
|
|
|
typedef SETJMP_FLOAT128 _JBTYPE;
|
2007-09-24 11:40:54 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
typedef struct __JUMP_BUFFER {
|
2007-09-24 11:40:54 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
unsigned long iAReserved[6];
|
|
|
|
|
|
|
|
unsigned long Registration;
|
|
|
|
unsigned long TryLevel;
|
|
|
|
unsigned long Cookie;
|
|
|
|
unsigned long UnwindFunc;
|
|
|
|
|
|
|
|
unsigned long UnwindData[6];
|
|
|
|
|
|
|
|
SETJMP_FLOAT128 FltS0;
|
|
|
|
SETJMP_FLOAT128 FltS1;
|
|
|
|
SETJMP_FLOAT128 FltS2;
|
|
|
|
SETJMP_FLOAT128 FltS3;
|
|
|
|
SETJMP_FLOAT128 FltS4;
|
|
|
|
SETJMP_FLOAT128 FltS5;
|
|
|
|
SETJMP_FLOAT128 FltS6;
|
|
|
|
SETJMP_FLOAT128 FltS7;
|
|
|
|
SETJMP_FLOAT128 FltS8;
|
|
|
|
SETJMP_FLOAT128 FltS9;
|
|
|
|
SETJMP_FLOAT128 FltS10;
|
|
|
|
SETJMP_FLOAT128 FltS11;
|
|
|
|
SETJMP_FLOAT128 FltS12;
|
|
|
|
SETJMP_FLOAT128 FltS13;
|
|
|
|
SETJMP_FLOAT128 FltS14;
|
|
|
|
SETJMP_FLOAT128 FltS15;
|
|
|
|
SETJMP_FLOAT128 FltS16;
|
|
|
|
SETJMP_FLOAT128 FltS17;
|
|
|
|
SETJMP_FLOAT128 FltS18;
|
|
|
|
SETJMP_FLOAT128 FltS19;
|
2010-02-28 09:37:57 +00:00
|
|
|
__MINGW_EXTENSION __int64 FPSR;
|
|
|
|
__MINGW_EXTENSION __int64 StIIP;
|
|
|
|
__MINGW_EXTENSION __int64 BrS0;
|
|
|
|
__MINGW_EXTENSION __int64 BrS1;
|
|
|
|
__MINGW_EXTENSION __int64 BrS2;
|
|
|
|
__MINGW_EXTENSION __int64 BrS3;
|
|
|
|
__MINGW_EXTENSION __int64 BrS4;
|
|
|
|
__MINGW_EXTENSION __int64 IntS0;
|
|
|
|
__MINGW_EXTENSION __int64 IntS1;
|
|
|
|
__MINGW_EXTENSION __int64 IntS2;
|
|
|
|
__MINGW_EXTENSION __int64 IntS3;
|
|
|
|
__MINGW_EXTENSION __int64 RsBSP;
|
|
|
|
__MINGW_EXTENSION __int64 RsPFS;
|
|
|
|
__MINGW_EXTENSION __int64 ApUNAT;
|
|
|
|
__MINGW_EXTENSION __int64 ApLC;
|
|
|
|
__MINGW_EXTENSION __int64 IntSp;
|
|
|
|
__MINGW_EXTENSION __int64 IntNats;
|
|
|
|
__MINGW_EXTENSION __int64 Preds;
|
2008-12-13 21:28:05 +00:00
|
|
|
|
|
|
|
} _JUMP_BUFFER;
|
2010-07-21 00:31:14 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#elif defined(__x86_64)
|
2010-07-21 00:31:14 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
|
2010-02-28 09:37:57 +00:00
|
|
|
__MINGW_EXTENSION unsigned __int64 Part[2];
|
2008-12-13 21:28:05 +00:00
|
|
|
} SETJMP_FLOAT128;
|
|
|
|
|
|
|
|
#define _JBLEN 16
|
|
|
|
typedef SETJMP_FLOAT128 _JBTYPE;
|
|
|
|
|
|
|
|
typedef struct _JUMP_BUFFER {
|
2010-02-28 09:37:57 +00:00
|
|
|
__MINGW_EXTENSION unsigned __int64 Frame;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Rbx;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Rsp;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Rbp;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Rsi;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Rdi;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 R12;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 R13;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 R14;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 R15;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Rip;
|
|
|
|
__MINGW_EXTENSION unsigned __int64 Spare;
|
2008-12-13 21:28:05 +00:00
|
|
|
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;
|
2010-07-21 00:31:14 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#endif
|
2010-07-21 00:31:14 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#ifndef _JMP_BUF_DEFINED
|
|
|
|
typedef _JBTYPE jmp_buf[_JBLEN];
|
|
|
|
#define _JMP_BUF_DEFINED
|
2007-09-24 11:40:54 +00:00
|
|
|
#endif
|
|
|
|
|
2010-07-21 00:31:14 +00:00
|
|
|
#ifdef _MSC_VER
|
2010-09-19 00:27:24 +00:00
|
|
|
int __cdecl __MINGW_NOTHROW setjmp(jmp_buf _Buf);
|
2010-07-21 00:31:14 +00:00
|
|
|
#else
|
2008-12-13 21:28:05 +00:00
|
|
|
#ifdef USE_MINGW_SETJMP_TWO_ARGS
|
|
|
|
#ifndef _INC_SETJMPEX
|
2010-09-19 00:27:24 +00:00
|
|
|
#if defined(__x86_64)
|
|
|
|
# define mingw_getsp() \
|
|
|
|
({ void* value; __asm__ __volatile__("movq %%rsp, %[value]" : [value] "=r" (value)); value; })
|
|
|
|
#elif defined(_X86_)
|
|
|
|
# define mingw_getsp() \
|
|
|
|
({ void* value; __asm__ __volatile__("movl %%esp, %[value]" : [value] "=r" (value)); value; })
|
|
|
|
#endif
|
2008-12-13 21:28:05 +00:00
|
|
|
#define setjmp(BUF) _setjmp((BUF),mingw_getsp())
|
2009-09-17 15:47:35 +00:00
|
|
|
int __cdecl __MINGW_NOTHROW _setjmp(jmp_buf _Buf,void *_Ctx);
|
2008-12-13 21:28:05 +00:00
|
|
|
#else
|
|
|
|
#undef setjmp
|
|
|
|
#define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
|
|
|
|
#define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
|
2009-09-17 15:47:35 +00:00
|
|
|
int __cdecl __MINGW_NOTHROW _setjmpex(jmp_buf _Buf,void *_Ctx);
|
2008-12-13 21:28:05 +00:00
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifndef _INC_SETJMPEX
|
|
|
|
#define setjmp _setjmp
|
|
|
|
#endif
|
2009-09-17 15:47:35 +00:00
|
|
|
int __cdecl __MINGW_NOTHROW setjmp(jmp_buf _Buf);
|
2010-09-19 00:27:24 +00:00
|
|
|
#endif
|
2008-12-13 21:28:05 +00:00
|
|
|
#endif
|
|
|
|
|
2009-09-17 15:47:35 +00:00
|
|
|
__declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
|
|
|
|
__declspec(noreturn) __MINGW_NOTHROW void __cdecl longjmp(jmp_buf _Buf,int _Value);
|
2007-09-24 11:40:54 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2007-11-21 23:50:03 +00:00
|
|
|
|
2008-12-13 21:28:05 +00:00
|
|
|
#pragma pack(pop)
|
|
|
|
#endif
|