diff options
| author | woglinde <henning@familie-heinold.de> | 2012-12-07 14:41:39 -0800 |
|---|---|---|
| committer | woglinde <henning@familie-heinold.de> | 2012-12-07 14:41:39 -0800 |
| commit | 716bae8a8b070b88fa91c30e03fc09e70310091a (patch) | |
| tree | a21977f6e2803701922fd8dac72ac924b64a995b /recipes-core/openjdk/openjdk-7-03b21/icedtea-jdk-powerpc-atomic64.patch | |
| parent | b1fd6ea3f30cc6fc24773b63a4adb3259b28903f (diff) | |
| parent | 5aae7eb70b2ca58679f9e89e878b7efff5eb3d24 (diff) | |
| download | meta-java-716bae8a8b070b88fa91c30e03fc09e70310091a.tar.gz | |
Merge pull request #32 from kraj/master
Forward port dbus-java recipes and some more openjdk-7 fixes
Diffstat (limited to 'recipes-core/openjdk/openjdk-7-03b21/icedtea-jdk-powerpc-atomic64.patch')
| -rw-r--r-- | recipes-core/openjdk/openjdk-7-03b21/icedtea-jdk-powerpc-atomic64.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/recipes-core/openjdk/openjdk-7-03b21/icedtea-jdk-powerpc-atomic64.patch b/recipes-core/openjdk/openjdk-7-03b21/icedtea-jdk-powerpc-atomic64.patch new file mode 100644 index 0000000..cc5e4e8 --- /dev/null +++ b/recipes-core/openjdk/openjdk-7-03b21/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" | ||
