java-1.8.0-openjdk/pr3559-use_ldrexd_for_atomic_reads_on_armv7_zero.patch

30 lines
1000 B
Diff
Raw Normal View History

2018-06-11 15:11:26 +00:00
# HG changeset patch
# User aph
# Date 1338206478 14400
# Mon May 28 08:01:18 2012 -0400
# Node ID 6275d7b419091092752d5a1854194c98897892ba
# Parent be1379a186ba527b32c93a83e04c9600735fe44b
PR3559: 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 openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
@@ -54,6 +54,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