sparc v9 fixes for sun tools
authorAnthony Green <green@moxielogic.com>
Fri, 8 Feb 2013 17:25:18 +0000 (12:25 -0500)
committerAnthony Green <green@moxielogic.com>
Fri, 8 Feb 2013 17:25:18 +0000 (12:25 -0500)
ChangeLog
configure
configure.ac
doc/stamp-vti
doc/version.texi
src/sparc/ffi.c
src/sparc/v8.S

index 824d30a0e430c0551e2ba26c738e7246e2291501..072eba47a167eb1305af7695d7fde1fc82c7b4e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-02-08  Anthony Green <green@moxielogic.com>
+
+       * configure.ac: Move sparc asm config checks to within functions
+       for compatibility with sun tools.
+       * configure: Rebuilt.
+       * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9
+       systems.
+       * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache
+       flusher.
+
 2013-02-08  Nathan Rossi <nathan.rossi@xilinx.com>
 
        * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of
index 2908c45aed67565e626ab00e70e64c813ec969e4..771398ad5061dd782da47f4e66ab6156e38ca479 100755 (executable)
--- a/configure
+++ b/configure
@@ -14450,11 +14450,11 @@ else
        # Check if we have .register
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-asm (".register %g2, #scratch");
+
 int
 main ()
 {
-
+asm (".register %g2, #scratch");
   ;
   return 0;
 }
@@ -14508,11 +14508,11 @@ else
        # Check if we have .ascii
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-asm (".ascii \\"string\\"");
+
 int
 main ()
 {
-
+asm (".ascii \\"string\\"");
   ;
   return 0;
 }
@@ -14543,11 +14543,11 @@ else
        # Check if we have .string
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-asm (".string \\"string\\"");
+
 int
 main ()
 {
-
+asm (".string \\"string\\"");
   ;
   return 0;
 }
index 1d1eed2eba1910e290839ecd59fc261f751a1392..c3cd132f6c67ac0b892b00573db46ee4b0f70bf9 100644 (file)
@@ -338,7 +338,7 @@ if test x$TARGET = xSPARC; then
        libffi_cv_as_register_pseudo_op, [
        libffi_cv_as_register_pseudo_op=unknown
        # Check if we have .register
-       AC_TRY_COMPILE([asm (".register %g2, #scratch");],,
+       AC_TRY_COMPILE(,[asm (".register %g2, #scratch");],
                       [libffi_cv_as_register_pseudo_op=yes],
                       [libffi_cv_as_register_pseudo_op=no])
     ])
@@ -366,7 +366,7 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64
        libffi_cv_as_ascii_pseudo_op, [
        libffi_cv_as_ascii_pseudo_op=unknown
        # Check if we have .ascii
-       AC_TRY_COMPILE([asm (".ascii \\"string\\"");],,
+       AC_TRY_COMPILE(,[asm (".ascii \\"string\\"");],
                       [libffi_cv_as_ascii_pseudo_op=yes],
                       [libffi_cv_as_ascii_pseudo_op=no])
     ])
@@ -379,7 +379,7 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64
        libffi_cv_as_string_pseudo_op, [
        libffi_cv_as_string_pseudo_op=unknown
        # Check if we have .string
-       AC_TRY_COMPILE([asm (".string \\"string\\"");],,
+       AC_TRY_COMPILE(,[asm (".string \\"string\\"");],
                       [libffi_cv_as_string_pseudo_op=yes],
                       [libffi_cv_as_string_pseudo_op=no])
     ])
index 38f07d713b992b8e300ea696493aefb5729ff3b7..883a8fffdd1ba8c723f002ab070dd157043b776c 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 6 February 2013
 @set UPDATED-MONTH February 2013
-@set EDITION 3.0.12-rc2
-@set VERSION 3.0.12-rc2
+@set EDITION 3.0.12-rc3
+@set VERSION 3.0.12-rc3
index 38f07d713b992b8e300ea696493aefb5729ff3b7..883a8fffdd1ba8c723f002ab070dd157043b776c 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 6 February 2013
 @set UPDATED-MONTH February 2013
-@set EDITION 3.0.12-rc2
-@set VERSION 3.0.12-rc2
+@set EDITION 3.0.12-rc3
+@set VERSION 3.0.12-rc3
index 7c384ef90bbfc4aac16431c17c7293f412e143b8..564be132f0bc0c16e2c86c2697522b52412d33c9 100644 (file)
@@ -521,16 +521,15 @@ ffi_prep_closure_loc (ffi_closure* closure,
   closure->user_data = user_data;
 
   /* Flush the Icache.  closure is 8 bytes aligned.  */
+#ifdef __GNUC__
 #ifdef SPARC64
   asm volatile ("flush %0; flush %0+8" : : "r" (closure) : "memory");
 #else
-#ifdef __GNUC__
   asm volatile ("iflush        %0; iflush %0+8" : : "r" (closure) : "memory");
   /* SPARC v8 requires 5 instructions for flush to be visible */
   asm volatile ("nop; nop; nop; nop; nop");
-#else
-  ffi_flush_icache (closure, 16);
 #endif
+  ffi_flush_icache (closure, 16);
 #endif
 
   return FFI_OK;
index 4faf3bd3e2ffef94e70eda143694252d0655d5c4..ba3cdac9bedd1646739bc8d59302e30f25053761 100644 (file)
 ffi_flush_icache:
 _ffi_flush_icache:     
         add %o0, %o1, %o2
+#ifdef SPARC64 
+1:     flush %o0
+#else  
 1:     iflush %o0
+#endif
        add %o0, 8, %o0
        cmp %o0, %o2
        blt 1b