summaryrefslogtreecommitdiff
path: root/emulators/wine/patches/patch-af
blob: 4893934f30d490c39174bbe5a25d6d6a6acce845 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$NetBSD: patch-af,v 1.12 2005/05/25 08:23:43 adam Exp $

--- dlls/ntdll/signal_i386.c.orig	2005-05-16 17:52:10.000000000 +0000
+++ dlls/ntdll/signal_i386.c
@@ -205,7 +205,7 @@ typedef struct trapframe SIGCONTEXT;
 
 #endif /* bsdi */
 
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+#if (defined(__NetBSD__) && (__NetBSD_Version__ < 200000000)) || defined(__FreeBSD__) || defined(__OpenBSD__)
 
 typedef struct sigcontext SIGCONTEXT;
 
@@ -305,7 +305,40 @@ typedef struct ucontext SIGCONTEXT;
 
 #endif /* __APPLE__ */
 
-#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) ||\
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 200000000)
+# include <sys/ucontext.h>
+# include <sys/types.h>
+# include <signal.h>
+
+typedef struct __ucontext SIGCONTEXT;
+
+#define HANDLER_DEF(name) void name( int __signal, int code, SIGCONTEXT *__context )
+#define HANDLER_CONTEXT __context
+
+#define EAX_sig(context)     ((context)->uc_mcontext.__gregs[_REG_EAX])
+#define EBX_sig(context)     ((context)->uc_mcontext.__gregs[_REG_EBX])
+#define ECX_sig(context)     ((context)->uc_mcontext.__gregs[_REG_ECX])
+#define EDX_sig(context)     ((context)->uc_mcontext.__gregs[_REG_EDX])
+#define ESI_sig(context)     ((context)->uc_mcontext.__gregs[_REG_ESI])
+#define EDI_sig(context)     ((context)->uc_mcontext.__gregs[_REG_EDI])
+#define EBP_sig(context)     ((context)->uc_mcontext.__gregs[_REG_EBP])
+
+#define CS_sig(context)      ((context)->uc_mcontext.__gregs[_REG_CS])
+#define DS_sig(context)      ((context)->uc_mcontext.__gregs[_REG_DS])
+#define ES_sig(context)      ((context)->uc_mcontext.__gregs[_REG_ES])
+#define FS_sig(context)      ((context)->uc_mcontext.__gregs[_REG_FS])
+#define GS_sig(context)      ((context)->uc_mcontext.__gregs[_REG_GS])
+#define SS_sig(context)      ((context)->uc_mcontext.__gregs[_REG_SS])
+
+#define EFL_sig(context)     ((context)->uc_mcontext.__gregs[_REG_EFL])
+
+#define EIP_sig(context)     (*((unsigned long*)&(context)->uc_mcontext.__gregs[_REG_EIP]))
+#define ESP_sig(context)     (*((unsigned long*)&(context)->uc_mcontext.__gregs[_REG_EIP]))
+
+#endif	/* NetBSD */
+
+
+#if defined(linux) || (defined(__NetBSD__) && (__NetBSD_Version__ < 200000000)) || defined(__FreeBSD__) ||\
     defined(__OpenBSD__) || defined(__EMX__) || defined(__CYGWIN__)
 
 #define EAX_sig(context)     ((context)->sc_eax)