From: Mike Hommey <glandium@debian.org>
Date: Tue, 7 Jul 2009 22:09:19 +0200
Subject: Implement sync_instruction_memory for sparc linux

https://bugzilla.mozilla.org/show_bug.cgi?id=502369
---
 js/src/nanojit/Assembler.cpp |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/js/src/nanojit/Assembler.cpp b/js/src/nanojit/Assembler.cpp
index 2727706..2727a14 100755
--- a/js/src/nanojit/Assembler.cpp
+++ b/js/src/nanojit/Assembler.cpp
@@ -50,8 +50,20 @@ extern "C" void __clear_cache(char *BEG, char *END);
 #endif
 
 #ifdef AVMPLUS_SPARC
+#ifdef __linux__
+void sync_instruction_memory(caddr_t v, u_int len)
+{
+	caddr_t end = v + len;
+	caddr_t p = v;
+	while (p < end) {
+		asm volatile("flush %0" : : "r" (p));
+		p += 32;
+	}
+}
+#else
 extern  "C"	void sync_instruction_memory(caddr_t v, u_int len);
 #endif
+#endif
 
 namespace nanojit
 {
