[Ecls-list] [PATCH] don't use lwsync if it is not available

Sebastian Andrzej Siewior sebastian at breakpoint.cc
Sun Dec 14 18:12:27 UTC 2008


PowerPCs with e500 cores interprete lwsync as an invalid instruction.
The ISA requests to execute a sync operation if lwsync is not
implemented.

--- a/src/gc/include/private/gc_locks.h
+++ b/src/gc/include/private/gc_locks.h
@@ -174,7 +174,11 @@
         }
 #     define GC_TEST_AND_SET_DEFINED
       inline static void GC_clear(volatile unsigned int *addr) {
+#ifdef __NO_LWSYNC__
+	__asm__ __volatile__("sync" : : : "memory");
+#else
 	__asm__ __volatile__("lwsync" : : : "memory");
+#endif
         *(addr) = 0;
       }
 #     define GC_CLEAR_DEFINED






More information about the ecl-devel mailing list