0d1d63fe2e
NetBSD>=2.0. Approved by wiz.
55 lines
2.3 KiB
Text
55 lines
2.3 KiB
Text
$NetBSD: patch-af,v 1.11 2005/03/11 21:18:15 rillig Exp $
|
|
|
|
--- dlls/ntdll/signal_i386.c.orig Thu Dec 2 19:19:25 2004
|
|
+++ dlls/ntdll/signal_i386.c Fri Feb 25 01:31:18 2005
|
|
@@ -206,7 +206,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;
|
|
|
|
@@ -306,7 +306,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)
|