changeset in /hg/icedtea6: Merge.
Andrew John Hughes
ahughes at redhat.com
Tue Feb 3 04:14:00 PST 2009
changeset d57abf1d1d65 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d57abf1d1d65
description:
Merge.
diffstat:
2 files changed, 69 insertions(+), 24 deletions(-)
ChangeLog | 5
ports/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp | 88 +++++++---
diffs (152 lines):
diff -r 8e91de51da9e -r d57abf1d1d65 ChangeLog
--- a/ChangeLog Tue Jan 27 11:54:08 2009 +0000
+++ b/ChangeLog Tue Jan 27 11:54:55 2009 +0000
@@ -11,6 +11,11 @@ 2009-01-27 Andrew John Hughes <ahughes
* patches/icedtea-nio2.patch:
(FileChannelImpl.positionSBC(long)): Added, simply calls position(long).
(FileChannelImpl.truncateSBC(long)): Likewise.
+
+2009-01-27 Andrew Haley <aph at redhat.com>
+
+ * ports/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp:
+ Add memory barriers where needed for PPC.
2009-01-26 Andrew John Hughes <ahughes at redhat.com>
diff -r 8e91de51da9e -r d57abf1d1d65 ports/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
--- a/ports/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp Tue Jan 27 11:54:08 2009 +0000
+++ b/ports/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp Tue Jan 27 11:54:55 2009 +0000
@@ -23,6 +23,24 @@
*
*/
+#ifdef __PPC
+
+#define READ_MEM_BARRIER __asm __volatile ("isync":::"memory")
+#ifdef __NO_LWSYNC__
+#define WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory")
+#else
+#define WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
+#endif
+
+#else // PPC
+
+#define READ_MEM_BARRIER __asm __volatile ("":::"memory")
+#define WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
+
+#endif // PPC
+
+
+
inline void OrderAccess::loadload() { acquire(); }
inline void OrderAccess::storestore() { release(); }
inline void OrderAccess::loadstore() { acquire(); }
@@ -30,12 +48,12 @@ inline void OrderAccess::storeload() {
inline void OrderAccess::acquire()
{
- __sync_synchronize();
+ READ_MEM_BARRIER;
}
inline void OrderAccess::release()
{
- __sync_synchronize();
+ WRITE_MEM_BARRIER;
}
inline void OrderAccess::fence()
@@ -43,49 +61,71 @@ inline void OrderAccess::fence()
__sync_synchronize();
}
-inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { return *p; }
-inline jshort OrderAccess::load_acquire(volatile jshort* p) { return *p; }
-inline jint OrderAccess::load_acquire(volatile jint* p) { return *p; }
+inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { jbyte data = *p; acquire(); return data; }
+inline jshort OrderAccess::load_acquire(volatile jshort* p) { jshort data = *p; acquire(); return data; }
+inline jint OrderAccess::load_acquire(volatile jint* p) { jint data = *p; acquire(); return data; }
inline jlong OrderAccess::load_acquire(volatile jlong* p)
{
jlong tmp;
os::atomic_copy64(p, &tmp);
+ acquire();
return tmp;
}
-inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { return *p; }
-inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
-inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
+inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { jubyte data = *p; acquire(); return data; }
+inline jushort OrderAccess::load_acquire(volatile jushort* p) { jushort data = *p; acquire(); return data; }
+inline juint OrderAccess::load_acquire(volatile juint* p) { juint data = *p; acquire(); return data; }
inline julong OrderAccess::load_acquire(volatile julong* p)
{
julong tmp;
os::atomic_copy64(p, &tmp);
+ acquire();
return tmp;
}
-inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
+inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { jfloat data = *p; acquire(); return data; }
inline jdouble OrderAccess::load_acquire(volatile jdouble* p)
{
jdouble tmp;
os::atomic_copy64(p, &tmp);
+ acquire();
return tmp;
}
-inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t* p) { return *p; }
-inline void* OrderAccess::load_ptr_acquire(volatile void* p) { return *(void* volatile *)p; }
-inline void* OrderAccess::load_ptr_acquire(const volatile void* p) { return *(void* const volatile *)p; }
+inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t* p)
+{
+ intptr_t data = *p;
+ acquire();
+ return data;
+}
+inline void* OrderAccess::load_ptr_acquire(volatile void* p)
+{
+ void *data = *(void* volatile *)p;
+ acquire();
+ return data;
+}
+inline void* OrderAccess::load_ptr_acquire(const volatile void* p)
+{
+ void *data = *(void* const volatile *)p;
+ acquire();
+ return data;
+}
-inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { *p = v; }
-inline void OrderAccess::release_store(volatile jshort* p, jshort v) { *p = v; }
-inline void OrderAccess::release_store(volatile jint* p, jint v) { *p = v; }
-inline void OrderAccess::release_store(volatile jlong* p, jlong v) { os::atomic_copy64(&v, p); }
-inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { *p = v; }
-inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p = v; }
-inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
-inline void OrderAccess::release_store(volatile julong* p, julong v) { os::atomic_copy64(&v, p); }
-inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
-inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { os::atomic_copy64(&v, p); }
+inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile jshort* p, jshort v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile jint* p, jint v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile jlong* p, jlong v)
+{ release(); os::atomic_copy64(&v, p); }
+inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile jushort* p, jushort v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile juint* p, juint v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile julong* p, julong v)
+{ release(); os::atomic_copy64(&v, p); }
+inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { release(); *p = v; }
+inline void OrderAccess::release_store(volatile jdouble* p, jdouble v)
+{ release(); os::atomic_copy64(&v, p); }
-inline void OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
-inline void OrderAccess::release_store_ptr(volatile void* p, void* v) { *(void* volatile *)p = v; }
+inline void OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { release(); *p = v; }
+inline void OrderAccess::release_store_ptr(volatile void* p, void* v)
+{ release(); *(void* volatile *)p = v; }
inline void OrderAccess::store_fence(jbyte* p, jbyte v) { *p = v; fence(); }
inline void OrderAccess::store_fence(jshort* p, jshort v) { *p = v; fence(); }
More information about the distro-pkg-dev
mailing list