update Wed Jan 20 06:37:00 PST 2010
[pkgsrc.git] / emulators / BasiliskII / patches / patch-ag
1 $NetBSD: patch-ag,v 1.4 2007/06/12 12:51:08 joerg Exp $
2
3 --- src/Unix/sigsegv.cpp.orig   2006-03-30 22:45:49.000000000 +0000
4 +++ src/Unix/sigsegv.cpp
5 @@ -226,7 +226,7 @@ static void powerpc_decode_instruction(i
6  
7  #if HAVE_SIGINFO_T
8  // Generic extended signal handler
9 -#if defined(__FreeBSD__)
10 +#if defined(__FreeBSD__) || defined(__DragonFly__)
11  #define SIGSEGV_ALL_SIGNALS                            FAULT_HANDLER(SIGBUS)
12  #else
13  #define SIGSEGV_ALL_SIGNALS                            FAULT_HANDLER(SIGSEGV)
14 @@ -264,7 +264,7 @@ static void powerpc_decode_instruction(i
15  #define SIGSEGV_SKIP_INSTRUCTION               ix86_skip_instruction
16  #endif
17  #endif
18 -#if defined(__FreeBSD__) || defined(__OpenBSD__)
19 +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
20  #if (defined(i386) || defined(__i386__))
21  #define SIGSEGV_FAULT_INSTRUCTION              (((struct sigcontext *)scp)->sc_eip)
22  #define SIGSEGV_REGISTER_FILE                  ((unsigned long *)&(((struct sigcontext *)scp)->sc_edi)) /* EDI is the first GPR (even below EIP) in sigcontext */
23 @@ -451,7 +451,7 @@ static sigsegv_address_t get_fault_addre
24  #define SIGSEGV_ALL_SIGNALS                            FAULT_HANDLER(SIGSEGV)
25  #endif
26  #endif
27 -#if defined(__FreeBSD__)
28 +#if defined(__FreeBSD__) || defined(__DragonFly__)
29  #if (defined(i386) || defined(__i386__))
30  #define SIGSEGV_ALL_SIGNALS                            FAULT_HANDLER(SIGBUS)
31  #define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, int code, struct sigcontext *scp, char *addr
32 @@ -721,10 +721,14 @@ enum {
33  #endif
34  };
35  #endif
36 -#if defined(__FreeBSD__)
37 +#if defined(__FreeBSD__) || defined(__DragonFly__)
38  enum {
39  #if (defined(i386) || defined(__i386__))
40 +#  if (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
41         X86_REG_EIP = 10,
42 +#else
43 +       X86_REG_EIP = 11,
44 +#endif
45         X86_REG_EAX = 7,
46         X86_REG_ECX = 6,
47         X86_REG_EDX = 5,