[pypy-svn] r40944 - pypy/dist/pypy/translator/c/src

mwh at codespeak.net mwh at codespeak.net
Wed Mar 21 15:51:07 CET 2007


Author: mwh
Date: Wed Mar 21 15:51:05 2007
New Revision: 40944

Added:
   pypy/dist/pypy/translator/c/src/asm_ppc.h
Log:
forgot this, thanks cfbolz!


Added: pypy/dist/pypy/translator/c/src/asm_ppc.h
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/c/src/asm_ppc.h	Wed Mar 21 15:51:05 2007
@@ -0,0 +1,29 @@
+
+void LL_flush_icache(long base, long size);
+
+#ifndef PYPY_NOT_MAIN_FILE
+
+#define __dcbst(base, index)    \
+  __asm__ ("dcbst %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+#define __icbi(base, index)    \
+  __asm__ ("icbi %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+#define __sync() __asm__ volatile ("sync")
+#define __isync()       \
+  __asm__ volatile ("isync")
+
+void
+LL_flush_icache(long base, long size)
+{
+	long i;
+
+	for (i = 0; i < size; i += 32){
+		__dcbst(base, i);
+	}
+	__sync();
+	for (i = 0; i < size; i += 32){
+		__icbi(base, i);
+	}
+	__isync();
+}
+
+#endif



More information about the Pypy-commit mailing list