sparc v9 fixes for sun tools

This commit is contained in:
Anthony Green
2013-02-08 12:25:18 -05:00
parent 35ee8d44f3
commit cb03ea8f4e
7 changed files with 29 additions and 16 deletions

View 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;

View File

@@ -41,7 +41,11 @@
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