Added signal support for Darwin/i386.

This commit is contained in:
Pierre d'Herbemont 2004-08-24 02:26:59 +00:00 committed by Alexandre Julliard
parent 516caf5a54
commit ed7a2bab5f
1 changed files with 36 additions and 1 deletions

View File

@ -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? */