This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

MIPS Patch and testresults.


Please consider the attached patch.


Tested on mipsel-linux with gcc-4.2.3:



Native configuration is mips64el-unknown-linux-gnu


=== libffi tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/ddaney/libffi-2.99.9/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /home/ddaney/libffi-2.99.9/testsuite/libffi.call/call.exp ...
Running /home/ddaney/libffi-2.99.9/testsuite/libffi.special/special.exp ...


=== libffi Summary ===

# of expected passes            1389
# of unsupported tests          15



Also built on mipsel-linux with gcc-3.3.6, but not tested due to lack of dejagnu in that environment.


Note that for the libffi home page, that Casey Marshall did the initial mips o32 closure support.



2008-02-15 David Daney <ddaney@avtrex.com>


	* src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): Define for GCC >= 4.3.
	(sys/cachectl.h): Include if not USE__BUILTIN___CLEAR_CACHE.
	(ffi_prep_closure_loc):  Use cacheflush if not
	USE__BUILTIN___CLEAR_CACHE
	* src/mips/ffitarget.h (asm/sgidefs.h): Include if linux.
	(_ABIN32, _ABI64, _ABIO32): Define if not already defined.
diff -rup libffi-2.99.9/src/mips/ffi.c libffi-2.99.9.DD/src/mips/ffi.c
--- libffi-2.99.9/src/mips/ffi.c	2008-02-14 17:17:13.000000000 -0800
+++ libffi-2.99.9.DD/src/mips/ffi.c	2008-02-15 10:07:43.000000000 -0800
@@ -29,6 +29,16 @@
 
 #include <stdlib.h>
 
+#ifdef __GNUC__
+#  if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
+#    define USE__BUILTIN___CLEAR_CACHE 1
+#  endif
+#endif
+
+#ifndef USE__BUILTIN___CLEAR_CACHE
+#include <sys/cachectl.h>>
+#endif
+
 #ifdef FFI_DEBUG
 # define FFI_MIPS_STOP_HERE() ffi_stop_here()
 #else
@@ -616,8 +626,11 @@ ffi_prep_closure_loc (ffi_closure *closu
   closure->fun = fun;
   closure->user_data = user_data;
 
+#ifdef USE__BUILTIN___CLEAR_CACHE
   __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE);
-
+#else
+  cacheflush (tramp, FFI_TRAMPOLINE_SIZE, ICACHE);
+#endif
   return FFI_OK;
 }
 
Only in libffi-2.99.9.DD/src/mips: ffi.c~
diff -rup libffi-2.99.9/src/mips/ffitarget.h libffi-2.99.9.DD/src/mips/ffitarget.h
--- libffi-2.99.9/src/mips/ffitarget.h	2008-02-14 17:15:46.000000000 -0800
+++ libffi-2.99.9.DD/src/mips/ffitarget.h	2008-02-15 09:58:48.000000000 -0800
@@ -27,6 +27,19 @@
 #ifndef LIBFFI_TARGET_H
 #define LIBFFI_TARGET_H
 
+#ifdef linux
+#include <asm/sgidefs.h>
+#  ifndef _ABIN32
+#    define _ABIN32 _MIPS_SIM_NABI32
+#  endif
+#  ifndef _ABI64
+#    define _ABI64 _MIPS_SIM_ABI64
+#  endif
+#  ifndef _ABIO32
+#    define _ABIO32 _MIPS_SIM_ABI32
+#  endif
+#endif
+
 #if !defined(_MIPS_SIM)
 -- something is very wrong --
 #else
Only in libffi-2.99.9.DD/src/mips: ffitarget.h~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]