File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 28
28
#endif
29
29
#endif
30
30
31
+ #if defined(__linux__) && defined(__amd64__)
32
+ #define NEEDAMD64CONTEXT 1
33
+ #define SET setmcontext
34
+ #define GET getmcontext
35
+ #endif
36
+
31
37
#if defined(__linux__) && defined(__arm__)
32
38
#define NEEDARMCONTEXT 1
33
39
#define SET setmcontext
Original file line number Diff line number Diff line change 25
25
#define NEEDSWAPCONTEXT
26
26
#endif
27
27
28
+ #if defined(__linux__ ) && defined(__amd64__ )
29
+ #define NEEDSWAPCONTEXT
30
+ #define NEEDAMD64MAKECONTEXT
31
+ #endif
32
+
28
33
#if defined(__linux__ ) && defined(__arm__ )
29
34
#define NEEDSWAPCONTEXT
30
35
#define NEEDARMMAKECONTEXT
Original file line number Diff line number Diff line change 18
18
#define USE_UCONTEXT 0
19
19
#endif
20
20
21
+ #if defined(__linux__ ) && defined(__amd64__ )
22
+ #define _UCONTEXT_H 1
23
+ #define _SYS_UCONTEXT_H 1
24
+ #undef USE_UCONTEXT
25
+ #define USE_UCONTEXT 0
26
+ #endif
27
+
21
28
#if defined(__APPLE__ )
22
29
#include <AvailabilityMacros.h>
23
30
#if defined(MAC_OS_X_VERSION_10_5 )
@@ -97,6 +104,22 @@ extern int swapcontext(ucontext_t*, const ucontext_t*);
97
104
extern void makecontext (ucontext_t * , void (* )(), int , ...);
98
105
#endif
99
106
107
+ #if defined(__linux__ ) && defined(__amd64__ )
108
+ typedef struct mcontext mcontext_t ;
109
+ typedef struct ucontext ucontext_t ;
110
+ extern int getmcontext (mcontext_t * );
111
+ extern void setmcontext (const mcontext_t * );
112
+ #define setcontext (u ) setmcontext(&(u)->uc_mcontext)
113
+ #define getcontext (u ) getmcontext(&(u)->uc_mcontext)
114
+ extern int swapcontext (ucontext_t * , const ucontext_t * );
115
+ extern void makecontext (ucontext_t * , void (* )(), int , ...);
116
+ # if defined(__i386__ )
117
+ # include "386-ucontext.h"
118
+ # elif defined(__x86_64__ )
119
+ # include "amd64-ucontext.h"
120
+ # endif
121
+ #endif
122
+
100
123
#if defined(__APPLE__ )
101
124
# define mcontext libthread_mcontext
102
125
# define mcontext_t libthread_mcontext_t
You can’t perform that action at this time.
0 commit comments