Commit ed7a2bab authored by Pierre d'Herbemont's avatar Pierre d'Herbemont Committed by Alexandre Julliard

Added signal support for Darwin/i386.

parent 516caf5a
......@@ -213,7 +213,7 @@ typedef struct sigcontext SIGCONTEXT;
#define HANDLER_DEF(name) void name( int __signal, int code, SIGCONTEXT *__context )
#define HANDLER_CONTEXT __context
#endif /* FreeBSD */
#endif /* *BSD */
#if defined(__svr4__) || defined(_SCO_DS) || defined(__sun)
......@@ -293,6 +293,19 @@ typedef struct
#endif /* __CYGWIN__ */
#ifdef __APPLE__
# include <sys/ucontext.h>
# include <sys/types.h>
# include <signal.h>
typedef siginfo_t siginfo;
typedef struct ucontext SIGCONTEXT;
# define HANDLER_DEF(name) void name( int __signal, siginfo *__siginfo, SIGCONTEXT *__context )
# define HANDLER_CONTEXT (__context)
#endif /* __APPLE__ */
#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) ||\
defined(__OpenBSD__) || defined(__EMX__) || defined(__CYGWIN__)
......@@ -376,6 +389,28 @@ typedef struct
#endif /* svr4 || SCO_DS */
#ifdef __APPLE__
#define EAX_sig(context) ((context)->uc_mcontext.sc_eax)
#define EBX_sig(context) ((context)->uc_mcontext.sc_ebx)
#define ECX_sig(context) ((context)->uc_mcontext.sc_ecx)
#define EDX_sig(context) ((context)->uc_mcontext.sc_edx)
#define ESI_sig(context) ((context)->uc_mcontext.sc_esi)
#define EDI_sig(context) ((context)->uc_mcontext.sc_edi)
#define EBP_sig(context) ((context)->uc_mcontext.sc_ebp)
#define CS_sig(context) ((context)->uc_mcontext.sc_cs)
#define DS_sig(context) ((context)->uc_mcontext.sc_ds)
#define ES_sig(context) ((context)->uc_mcontext.sc_es)
#define FS_sig(context) ((context)->uc_mcontext.sc_fs)
#define GS_sig(context) ((context)->uc_mcontext.sc_gs)
#define SS_sig(context) ((context)->uc_mcontext.sc_ss)
#define EFL_sig(context) ((context)->uc_mcontext.sc_eflags)
#define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.sc_eip))
#define ESP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.sc_esp))
#endif /* __APPLE__ */
/* exception code definitions (already defined by FreeBSD/NetBSD) */
#if !defined(__FreeBSD__) && !defined(__NetBSD__) /* FIXME: other BSDs? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment