$NetBSD: patch-af,v 1.1.2.2 2009/05/30 21:02:35 tron Exp $

Fixes to support the various NetBSD mips ports.

--- src/mips/ffi.c.orig	2008-02-26 18:34:36.000000000 +0100
+++ src/mips/ffi.c
@@ -32,12 +32,19 @@
 
 #ifdef __GNUC__
 #  if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
-#    define USE__BUILTIN___CLEAR_CACHE 1
+#    if !defined(__NetBSD__)
+#      define USE__BUILTIN___CLEAR_CACHE 1
+#    endif
 #  endif
 #endif
 
 #ifndef USE__BUILTIN___CLEAR_CACHE
-#include <sys/cachectl.h>
+#  if !defined(__NetBSD__)
+#    include <sys/cachectl.h>
+#  else
+#    include <mips/cachectl.h>
+#    define cacheflush _cacheflush
+#  endif
 #endif
 
 #ifdef FFI_DEBUG
