summaryrefslogtreecommitdiff
path: root/emulators/wine/patches/patch-af
blob: b86508709ab436930fa30c1956b57d29901632b4 (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
56
57
58
59
60
$NetBSD: patch-af,v 1.15 2006/01/20 14:58:18 adam Exp $

--- dlls/ntdll/signal_i386.c.orig	2006-01-19 15:14:04.000000000 +0100
+++ dlls/ntdll/signal_i386.c
@@ -204,7 +204,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;
 
@@ -328,7 +328,45 @@ typedef ucontext_t 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 ucontext_t SIGCONTEXT;
+
+#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_ESP]))
+
+#define TRAP_sig(context)    ((context)->uc_mcontext.__gregs[_REG_TRAPNO])
+#define ERROR_sig(context)   ((context)->uc_mcontext.__gregs[_REG_ERR])
+
+#define FAULT_ADDRESS        (__siginfo->si_addr)
+
+#define HANDLER_DEF(name) void name( int __signal, siginfo_t *__siginfo, SIGCONTEXT *__context )
+#define HANDLER_CONTEXT (__context)
+
+#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)