$NetBSD: patch-af,v 1.2 2016/07/03 18:33:36 dholland Exp $

Support for NetBSD, and for NetBSD on PPC.

--- src/runtime/mach-dep/signal-sysdep.h.orig	2006-02-27 17:47:32.000000000 +0000
+++ src/runtime/mach-dep/signal-sysdep.h	2006-03-09 19:15:48.000000000 +0000
@@ -171,7 +171,7 @@
   /* disable all FP exceptions */
 #  define SIG_InitFPE()    SetFSR(0)
 
-#  if defined(OPSYS_SUNOS)
+#  if defined(OPSYS_SUNOS) || defined(OPSYS_NETBSD)
     /** SPARC, SUNOS **/
 #    define USE_ZERO_LIMIT_PTR_FN
 #    define SIG_FAULT1		SIGFPE
@@ -340,6 +340,19 @@
 #    define SIG_ResetFPE(scp)           { (scp)->regs->gpr[PT_FPSCR] = 0x0; }
      typedef void SigReturn_t;
 
+#  elif (defined(TARGET_PPC) && defined(OPSYS_NETBSD))
+    /* PPC, NetBSD */
+
+#    define SIG_FAULT1          SIGTRAP
+
+#    define INT_DIVZERO(s, c)           ((s) == SIGTRAP)
+#    define INT_OVFLW(s, c)             ((s) == SIGTRAP)
+#    define SIG_GetPC(scp)              ((scp)->sc_frame.srr0)
+#    define SIG_SetPC(scp, addr)        { (scp)->sc_frame.srr0 = (long)(addr); }
+#    define SIG_ZeroLimitPtr(scp)       { ((scp)->sc_frame.fixreg[15] = 0); } /* limitptr = 15 (see src/runtime/mach-dep/PPC.prim.asm) */
+#    define SIG_GetCode(info,scp)       (info)
+     typedef void SigReturn_t;
+
 #  endif /* HOST_RS6000/HOST_PPC */
 
 #elif defined(HOST_HPPA)
