Permalink
Browse files

Add a membar to libgc's UNLOCK () on arm. Fixes #683409.

  • Loading branch information...
1 parent 5e60d75 commit a166a782172c249e185a62e00b8ca407dc6dc248 @vargaz vargaz committed Apr 7, 2011
Showing with 10 additions and 0 deletions.
  1. +2 −0 configure.in
  2. +8 −0 libgc/include/private/gc_locks.h
View
@@ -2380,6 +2380,8 @@ if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_bui
AC_MSG_RESULT($armv6)
if test ${armv6} = yes; then
AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions")
+ # libgc's gc_locks.h depends on this
+ NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6"
fi
fi
@@ -230,6 +230,14 @@
return oldval;
}
# define GC_TEST_AND_SET_DEFINED
+ inline static void GC_clear(volatile unsigned int *addr) {
+#ifdef HAVE_ARMV6
+ /* Memory barrier */
+ __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
+#endif
+ *(addr) = 0;
+ }
+# define GC_CLEAR_DEFINED
# endif /* ARM32 */
# ifdef CRIS
inline static int GC_test_and_set(volatile unsigned int *addr) {

0 comments on commit a166a78

Please sign in to comment.