# HG changeset patch
# User aph
# Date 1338206478 14400
#      Mon May 28 08:01:18 2012 -0400
# Node ID 0bebe238c22fb22628a6c1a375ace996a0c26cde
# Parent  46de0f03f7d6ad97d426b9d378f171344b8cccc6
Use ldrexd for atomic reads on ARMv7.
2012-05-28  Andrew Haley  <aph@redhat.com>

	* os_linux_zero.hpp (atomic_copy64): Use ldrexd for atomic reads
	on ARMv7.

diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
--- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
@@ -48,6 +48,12 @@
                   "std %0, 0(%2)\n"
                   : "=r"(tmp)
                   : "a"(src), "a"(dst));
+#elif defined(__ARM_ARCH_7A__)
+    jlong tmp;
+    asm volatile ("ldrexd  %0, [%1]\n"
+                  : "=r"(tmp)
+                  : "r"(src), "m"(src));
+    *(jlong *) dst = tmp;
 #else
     *(jlong *) dst = *(jlong *) src;
 #endif
