42 #ifndef QATOMIC_ARMV5_H 43 #define QATOMIC_ARMV5_H 49 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE 56 #define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE 63 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE 64 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE 71 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE 78 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE 87 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE 88 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE 97 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE 102 template <
typename T>
106 #ifndef QT_NO_ARM_EABI 111 #define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast<qt_atomic_eabi_cmpxchg_int_t *>(0xffff0fc0)) 112 #define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast<qt_atomic_eabi_cmpxchg_ptr_t *>(0xffff0fc0)) 125 inline char q_atomic_swp(
volatile char *
ptr,
char newval)
128 asm volatile(
"swpb %0,%2,[%3]" 129 :
"=&r"(ret),
"=m" (*ptr)
130 :
"r"(newval),
"r"(ptr)
137 #endif // QT_NO_ARM_EABI 143 #ifndef QT_NO_ARM_EABI 144 register int originalValue;
145 register int newValue;
148 newValue = originalValue + 1;
150 return newValue != 0;
157 return originalValue != -1;
163 #ifndef QT_NO_ARM_EABI 164 register int originalValue;
165 register int newValue;
168 newValue = originalValue - 1;
170 return newValue != 0;
177 return originalValue != 1;
185 #ifndef QT_NO_ARM_EABI 186 register int originalValue;
189 if (originalValue != expectedValue)
194 bool returnValue =
false;
229 #ifndef QT_NO_ARM_EABI 230 asm volatile(
"swp %0,%2,[%3]" 231 :
"=&r"(originalValue),
"=m" (
_q_value)
242 return originalValue;
266 #ifndef QT_NO_ARM_EABI 267 register int originalValue;
268 register int newValue;
271 newValue = originalValue + valueToAdd;
273 return originalValue;
281 return originalValue;
302 template <
typename T>
305 #ifndef QT_NO_ARM_EABI 306 register T *originalValue;
309 if (originalValue != expectedValue)
314 bool returnValue =
false;
327 template <
typename T>
333 template <
typename T>
339 template <
typename T>
349 template <
typename T>
363 template <
typename T>
367 #ifndef QT_NO_ARM_EABI 368 asm volatile(
"swp %0,%2,[%3]" 369 :
"=&r"(originalValue),
"=m" (
_q_value)
380 return originalValue;
385 template <
typename T>
391 template <
typename T>
397 template <
typename T>
405 template <
typename T>
408 #ifndef QT_NO_ARM_EABI 409 register T *originalValue;
410 register T *newValue;
413 newValue = originalValue + valueToAdd;
415 return originalValue;
423 return originalValue;
427 template <
typename T>
433 template <
typename T>
439 template <
typename T>
449 #endif // QATOMIC_ARMV5_H static bool isFetchAndStoreNative()
#define qt_atomic_eabi_cmpxchg_int
static bool isTestAndSetNative()
int fetchAndStoreRelease(int newValue)
static bool isReferenceCountingNative()
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
#define QT_END_NAMESPACE
This macro expands to.
static bool isFetchAndAddNative()
int() qt_atomic_eabi_cmpxchg_ptr_t(const void *oldval, const void *newval, volatile void *ptr)
static bool isTestAndSetNative()
Q_CORE_EXPORT void qt_atomic_yield(int *count)
static bool isFetchAndAddNative()
T * fetchAndStoreRelease(T *newValue)
static bool isTestAndSetWaitFree()
int() qt_atomic_eabi_cmpxchg_int_t(int oldval, int newval, volatile int *ptr)
T * fetchAndAddRelease(qptrdiff valueToAdd)
bool testAndSetOrdered(T *expectedValue, T *newValue)
int fetchAndAddAcquire(int valueToAdd)
T * fetchAndAddAcquire(qptrdiff valueToAdd)
int fetchAndStoreRelaxed(int newValue)
T * fetchAndAddOrdered(qptrdiff valueToAdd)
bool testAndSetAcquire(int expectedValue, int newValue)
bool testAndSetRelaxed(int expectedValue, int newValue)
#define QT_BEGIN_NAMESPACE
This macro expands to.
int fetchAndStoreAcquire(int newValue)
QIntegerForSizeof< void * >::Signed qptrdiff
T * fetchAndStoreOrdered(T *newValue)
#define Q_INLINE_TEMPLATE
int fetchAndAddRelease(int valueToAdd)
const T * ptr(const T &t)
bool testAndSetOrdered(int expectedValue, int newValue)
T * fetchAndStoreAcquire(T *newValue)
static bool isFetchAndStoreWaitFree()
static bool isTestAndSetWaitFree()
static bool isReferenceCountingWaitFree()
int fetchAndAddOrdered(int valueToAdd)
static bool isFetchAndStoreWaitFree()
static bool isFetchAndAddWaitFree()
static bool isFetchAndAddWaitFree()
bool testAndSetRelease(int expectedValue, int newValue)
int fetchAndAddRelaxed(int valueToAdd)
int fetchAndStoreOrdered(int newValue)
bool testAndSetRelaxed(T *expectedValue, T *newValue)
bool testAndSetRelease(T *expectedValue, T *newValue)
Q_CORE_EXPORT char q_atomic_lock
T * fetchAndStoreRelaxed(T *newValue)
#define qt_atomic_eabi_cmpxchg_ptr
static bool isFetchAndStoreNative()
bool testAndSetAcquire(T *expectedValue, T *newValue)