diff options
-rw-r--r-- | recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch | 65 | ||||
-rw-r--r-- | recipes-core/openjdk/openjdk-6-common.inc | 2 | ||||
-rw-r--r-- | recipes-core/openjdk/openjdk-6-release-6b24.inc | 2 |
3 files changed, 68 insertions, 1 deletions
diff --git a/recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch b/recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch new file mode 100644 index 0000000..cc5e4e8 --- /dev/null +++ b/recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | http://mail.openjdk.java.net/pipermail/zero-dev/2010-June/000346.html | ||
2 | |||
3 | this cute C code does the same thing on powerpc as the assembly code that | ||
4 | was here before. If the compiler was built with the SPE extensions instead | ||
5 | of traditional FPU and double operations are performed in HW then we are | ||
6 | one step further: The compiler turns this into evldd & evstdd. Voila :) | ||
7 | |||
8 | This C code could also be activated on s390. The compiler turns this into | ||
9 | a single mvc instruction which does the copy operation. I don't know if | ||
10 | mvc's copy ability is atomic _or_ not and therefore I leave it as it. | ||
11 | |||
12 | Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de> | ||
13 | |||
14 | ./openjdk-src-dir/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp | ||
15 | Index: openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp | ||
16 | =================================================================== | ||
17 | --- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp.org 2011-11-14 14:07:32.000000000 -0800 | ||
18 | +++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp 2012-07-19 07:28:26.208405923 -0700 | ||
19 | @@ -25,6 +25,16 @@ | ||
20 | |||
21 | #ifndef OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP | ||
22 | #define OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP | ||
23 | +#if defined(PPC) && !defined(_LP64) | ||
24 | + | ||
25 | +#ifndef __NO_FPRS__ | ||
26 | +#define ATOMIC64_COPY_THROUGH_DOUBLE 1 | ||
27 | + | ||
28 | +#elif defined(__SPE__) && !defined(_SOFT_DOUBLE) | ||
29 | +#define ATOMIC64_COPY_THROUGH_DOUBLE 1 | ||
30 | + | ||
31 | +#endif | ||
32 | +#endif | ||
33 | |||
34 | static void setup_fpu() {} | ||
35 | |||
36 | @@ -36,12 +46,23 @@ | ||
37 | |||
38 | // Atomically copy 64 bits of data | ||
39 | static void atomic_copy64(volatile void *src, volatile void *dst) { | ||
40 | -#if defined(PPC) && !defined(_LP64) | ||
41 | - double tmp; | ||
42 | - asm volatile ("lfd %0, 0(%1)\n" | ||
43 | - "stfd %0, 0(%2)\n" | ||
44 | - : "=f"(tmp) | ||
45 | - : "b"(src), "b"(dst)); | ||
46 | +#if ATOMIC64_COPY_THROUGH_DOUBLE | ||
47 | + /* | ||
48 | + * In order to copy 8 bytes atomicly we rely on the trick that some | ||
49 | + * architectures can load and store a double as a single operation. | ||
50 | + * gcc picks the correct opcode here and with optimization turned on | ||
51 | + * all temporary assignments are gone. - bigeasy | ||
52 | + */ | ||
53 | + union { | ||
54 | + double *d; | ||
55 | + volatile void *v; | ||
56 | + } s, d; | ||
57 | + | ||
58 | + s.v = src; | ||
59 | + d.v = dst; | ||
60 | + | ||
61 | + *d.d = *s.d; | ||
62 | + | ||
63 | #elif defined(S390) && !defined(_LP64) | ||
64 | double tmp; | ||
65 | asm volatile ("ld %0, 0(%1)\n" | ||
diff --git a/recipes-core/openjdk/openjdk-6-common.inc b/recipes-core/openjdk/openjdk-6-common.inc index c1861b6..6e984f6 100644 --- a/recipes-core/openjdk/openjdk-6-common.inc +++ b/recipes-core/openjdk/openjdk-6-common.inc | |||
@@ -10,7 +10,7 @@ ICEDTEA = "NEEDS TO BE SET" | |||
10 | S = "${WORKDIR}/${ICEDTEA}" | 10 | S = "${WORKDIR}/${ICEDTEA}" |
11 | B = "${S}/build" | 11 | B = "${S}/build" |
12 | 12 | ||
13 | INC_PR = "r18" | 13 | INC_PR = "r19" |
14 | 14 | ||
15 | SRC_URI = "\ | 15 | SRC_URI = "\ |
16 | ${ICEDTEA_URI} \ | 16 | ${ICEDTEA_URI} \ |
diff --git a/recipes-core/openjdk/openjdk-6-release-6b24.inc b/recipes-core/openjdk/openjdk-6-release-6b24.inc index 00a14c2..b867fb3 100644 --- a/recipes-core/openjdk/openjdk-6-release-6b24.inc +++ b/recipes-core/openjdk/openjdk-6-release-6b24.inc | |||
@@ -81,6 +81,7 @@ ICEDTEAPATCHES = "\ | |||
81 | file://icedtea-fix-xrender.patch;apply=no \ | 81 | file://icedtea-fix-xrender.patch;apply=no \ |
82 | file://icedtea-shark-arm-linux-cpu-detection.patch;apply=no \ | 82 | file://icedtea-shark-arm-linux-cpu-detection.patch;apply=no \ |
83 | file://icedtea-zero-hotspotfix.patch;apply=no \ | 83 | file://icedtea-zero-hotspotfix.patch;apply=no \ |
84 | file://icedtea-jdk-powerpc-atomic64.patch;apply=no \ | ||
84 | " | 85 | " |
85 | 86 | ||
86 | ICEDTEAPATCHES_append_libc-uclibc = " \ | 87 | ICEDTEAPATCHES_append_libc-uclibc = " \ |
@@ -105,6 +106,7 @@ DISTRIBUTION_PATCHES = "\ | |||
105 | patches/icedtea-fix-xrender.patch \ | 106 | patches/icedtea-fix-xrender.patch \ |
106 | patches/icedtea-shark-arm-linux-cpu-detection.patch \ | 107 | patches/icedtea-shark-arm-linux-cpu-detection.patch \ |
107 | patches/icedtea-zero-hotspotfix.patch \ | 108 | patches/icedtea-zero-hotspotfix.patch \ |
109 | patches/icedtea-jdk-powerpc-atomic64.patch \ | ||
108 | " | 110 | " |
109 | 111 | ||
110 | DISTRIBUTION_PATCHES_append_libc-uclibc = "\ | 112 | DISTRIBUTION_PATCHES_append_libc-uclibc = "\ |