summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorDirk Mueller <dmueller@suse.de>2010-02-17 22:17:36 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-17 22:17:36 (GMT)
commitcdf4701f442149546043b155cddcc53116875f1c (patch)
tree3be411f8755f4727499110d92195dbb41cf0a7b0 /src/corelib
parent884ea10d037d855b91ea5ef947b5c23d2f09aead (diff)
downloadQt-cdf4701f442149546043b155cddcc53116875f1c.zip
Qt-cdf4701f442149546043b155cddcc53116875f1c.tar.gz
Qt-cdf4701f442149546043b155cddcc53116875f1c.tar.bz2
Fix s390(x) atomic ops related crashes
The s390 implementation of the pointer related atomic ops never worked before, and the memory barrier was mixed up between the Acquire and the Relaxed variant. This fixes both. Merge-request: 2312 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/arch/qatomic_s390.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/corelib/arch/qatomic_s390.h b/src/corelib/arch/qatomic_s390.h
index 21f5037..273c17b 100644
--- a/src/corelib/arch/qatomic_s390.h
+++ b/src/corelib/arch/qatomic_s390.h
@@ -366,11 +366,9 @@ template <typename T>
Q_INLINE_TEMPLATE T* QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
{
#ifndef __s390x__
- return (T*)__CS_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (int)newValue, "lr",
- "", "bcr 15,0\n");
+ return (T*)__CS_OLD_LOOP(&_q_value, (int)newValue, "lr", "", "");
#else
- return (T*)__CSG_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (long)newValue, "lgr",
- "", "bcr 15,0\n");
+ return (T*)__CSG_OLD_LOOP(&_q_value, (long)newValue, "lgr", "", "");
#endif
}
@@ -378,9 +376,9 @@ template <typename T>
Q_INLINE_TEMPLATE T* QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
{
#ifndef __s390x__
- return (T*)__CS_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (int)newValue, "lr", "", "");
+ return (T*)__CS_OLD_LOOP(&_q_value, (int)newValue, "lr", "", "bcr 15,0 \n");
#else
- return (T*)__CSG_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (long)newValue, "lgr", "", "");
+ return (T*)__CSG_OLD_LOOP(&_q_value, (long)newValue, "lgr", "", "bcr 15,0 \n");
#endif
}
@@ -388,11 +386,9 @@ template <typename T>
Q_INLINE_TEMPLATE T* QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
{
#ifndef __s390x__
- return (T*)__CS_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (int)newValue, "lr",
- "bcr 15,0 \n", "");
+ return (T*)__CS_OLD_LOOP(&_q_value, (int)newValue, "lr", "bcr 15,0 \n", "");
#else
- return (T*)__CSG_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (long)newValue, "lgr",
- "bcr 15,0\n", "");
+ return (T*)__CSG_OLD_LOOP(&_q_value, (long)newValue, "lgr", "bcr 15,0\n", "");
#endif
}