summaryrefslogtreecommitdiffstats
path: root/src/corelib/arch/qatomic_powerpc.h
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-02-10 11:31:34 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-13 07:07:41 +0100
commit48e48f25974afbac2d54e77e92e27a23732fc2c8 (patch)
tree1b698cf122386f3ea738e96a75af727f1c2e9a13 /src/corelib/arch/qatomic_powerpc.h
parent9b4db5151f81903bf34621b9db27473051b02e80 (diff)
Remove out-of-line atomic implementation for PowerPC
Only support inline assembler with GCC. Support for xlC or other compilers is not provided or tested. The files in src/corelib/arch/vxworks only supported out-of-line PowerPC, so remove it as well. The xlC compiler seems to support GNU-style inline assembly, which we prefer. Anyone wishing to support that compiler again should first test if the inline assembly (the prefered method) works. See http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/topic/com.ibm.xlcpp8l.doc/language/ref/asm.htm#asm Change-Id: I70e56c0b06428bfb6538ca5e101baebd870f92f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/arch/qatomic_powerpc.h')
-rw-r--r--src/corelib/arch/qatomic_powerpc.h134
1 files changed, 1 insertions, 133 deletions
diff --git a/src/corelib/arch/qatomic_powerpc.h b/src/corelib/arch/qatomic_powerpc.h
index 949102748a..f03539dcd5 100644
--- a/src/corelib/arch/qatomic_powerpc.h
+++ b/src/corelib/arch/qatomic_powerpc.h
@@ -473,139 +473,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueTo
#undef _Q_VALUE_REGISTER_OPERAND
#else
-
-extern "C" {
- int q_atomic_test_and_set_int(volatile int *ptr, int expectedValue, int newValue);
- int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expectedValue, int newValue);
- int q_atomic_test_and_set_release_int(volatile int *ptr, int expectedValue, int newValue);
- int q_atomic_test_and_set_ptr(volatile void *ptr, void *expectedValue, void *newValue);
- int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expectedValue, void *newValue);
- int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expectedValue, void *newValue);
- int q_atomic_increment(volatile int *);
- int q_atomic_decrement(volatile int *);
- int q_atomic_set_int(volatile int *, int);
- int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newValue);
- int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newValue);
- void *q_atomic_set_ptr(volatile void *, void *);
- int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue);
- int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue);
- int q_atomic_fetch_and_add_int(volatile int *ptr, int valueToAdd);
- int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int valueToAdd);
- int q_atomic_fetch_and_add_release_int(volatile int *ptr, int valueToAdd);
- void *q_atomic_fetch_and_add_ptr(volatile void *ptr, qptrdiff valueToAdd);
- void *q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd);
- void *q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd);
-} // extern "C"
-
-
-inline bool QBasicAtomicInt::ref()
-{
- return q_atomic_increment(&_q_value) != 0;
-}
-
-inline bool QBasicAtomicInt::deref()
-{
- return q_atomic_decrement(&_q_value) != 0;
-}
-
-inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
-{
- return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0;
-}
-
-inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
-{
- return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0;
-}
-
-inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
-{
- return q_atomic_test_and_set_release_int(&_q_value, expectedValue, newValue) != 0;
-}
-
-inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
-{
- return q_atomic_set_int(&_q_value, newValue);
-}
-
-inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
-{
- return q_atomic_fetch_and_store_acquire_int(&_q_value, newValue);
-}
-
-inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
-{
- return q_atomic_fetch_and_store_release_int(&_q_value, newValue);
-}
-
-inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
-{
- return q_atomic_fetch_and_add_int(&_q_value, valueToAdd);
-}
-
-inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
-{
- return q_atomic_fetch_and_add_acquire_int(&_q_value, valueToAdd);
-}
-
-inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
-{
- return q_atomic_fetch_and_add_release_int(&_q_value, valueToAdd);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
-{
- return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0;
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
-{
- return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0;
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
-{
- return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0;
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
-{
- return reinterpret_cast<T *>(q_atomic_set_ptr(&_q_value, newValue));
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
-{
- return reinterpret_cast<T *>(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue));
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
-{
- return reinterpret_cast<T *>(q_atomic_fetch_and_store_release_ptr(&_q_value, newValue));
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
-{
- return reinterpret_cast<T *>(q_atomic_fetch_and_add_ptr(&_q_value, valueToAdd * sizeof(T)));
-}
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
-{
- return reinterpret_cast<T *>(q_atomic_fetch_and_add_acquire_ptr(&_q_value, valueToAdd * sizeof(T)));
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
-{
- return reinterpret_cast<T *>(q_atomic_fetch_and_add_release_ptr(&_q_value, valueToAdd * sizeof(T)));
-}
-
+# error "This compiler for PowerPC is not supported"
#endif
inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)