42 #ifndef QATOMIC_S390_H 43 #define QATOMIC_S390_H 49 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE 56 #define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE 63 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE 70 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE 77 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE 86 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE 95 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE 100 template <
typename T>
105 #define __GNU_EXTENSION __extension__ 107 #define __GNU_EXTENSION 110 #define __CS_LOOP(ptr, op_val, op_string, pre, post) __GNU_EXTENSION ({ \ 111 volatile int old_val, new_val; \ 112 __asm__ __volatile__(pre \ 115 op_string " %1,%4\n" \ 116 " cs %0,%1,0(%3)\n" \ 119 : "=&d" (old_val), "=&d" (new_val), \ 121 : "a" (ptr), "d" (op_val), \ 123 : "cc", "memory" ); \ 127 #define __CS_OLD_LOOP(ptr, op_val, op_string, pre, post ) __GNU_EXTENSION ({ \ 128 volatile int old_val, new_val; \ 129 __asm__ __volatile__(pre \ 132 op_string " %1,%4\n" \ 133 " cs %0,%1,0(%3)\n" \ 136 : "=&d" (old_val), "=&d" (new_val), \ 138 : "a" (ptr), "d" (op_val), \ 140 : "cc", "memory" ); \ 145 #define __CSG_OLD_LOOP(ptr, op_val, op_string, pre, post) __GNU_EXTENSION ({ \ 146 long old_val, new_val; \ 147 __asm__ __volatile__(pre \ 150 op_string " %1,%4\n" \ 151 " csg %0,%1,0(%3)\n" \ 154 : "=&d" (old_val), "=&d" (new_val), \ 156 : "a" (ptr), "d" (op_val), \ 158 : "cc", "memory" ); \ 176 __asm__ __volatile__(
183 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
191 __asm__ __volatile__(
199 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
207 __asm__ __volatile__(
215 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
265 template <
typename T>
271 __asm__ __volatile__(
278 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
281 __asm__ __volatile__(
288 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
295 template <
typename T>
301 __asm__ __volatile__(
309 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
312 __asm__ __volatile__(
320 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
327 template <
typename T>
333 __asm__ __volatile__(
341 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
344 __asm__ __volatile__(
352 :
"a" (&
_q_value),
"d" (expectedValue) ,
"d" (newValue),
359 template <
typename T>
365 template <
typename T>
371 return (T*)__CSG_OLD_LOOP(&
_q_value, (
long)newValue,
"lgr",
"",
"");
375 template <
typename T>
381 return (T*)__CSG_OLD_LOOP(&
_q_value, (
long)newValue,
"lgr",
"",
"bcr 15,0 \n");
385 template <
typename T>
391 return (T*)__CSG_OLD_LOOP(&
_q_value, (
long)newValue,
"lgr",
"bcr 15,0\n",
"");
395 template <
typename T>
402 template <
typename T>
408 template <
typename T>
414 template <
typename T>
420 #undef __GNU_EXTENSION 426 #endif // QATOMIC_S390_H static bool isFetchAndStoreNative()
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()
static bool isTestAndSetNative()
static bool isFetchAndAddNative()
T * fetchAndStoreRelease(T *newValue)
static bool isTestAndSetWaitFree()
T * fetchAndAddRelease(qptrdiff valueToAdd)
bool testAndSetOrdered(T *expectedValue, T *newValue)
int fetchAndAddAcquire(int valueToAdd)
T * fetchAndAddAcquire(qptrdiff valueToAdd)
int fetchAndStoreRelaxed(int newValue)
bool testAndSetAcquire(int expectedValue, int newValue)
#define __CS_OLD_LOOP(ptr, op_val, op_string, pre, post)
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)
bool testAndSetOrdered(int expectedValue, int newValue)
T * fetchAndStoreAcquire(T *newValue)
static bool isFetchAndStoreWaitFree()
static bool isTestAndSetWaitFree()
static bool isReferenceCountingWaitFree()
int fetchAndAddOrdered(int valueToAdd)
#define __CS_LOOP(ptr, op_val, op_string, pre, post)
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)
T * fetchAndStoreRelaxed(T *newValue)
static bool isFetchAndStoreNative()
bool testAndSetAcquire(T *expectedValue, T *newValue)