42 #ifndef QATOMIC_BFIN_H 43 #define QATOMIC_BFIN_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_NOT_NATIVE 70 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE 77 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE 86 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE 95 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE 100 template <
typename T>
104 #if defined(Q_OS_LINUX) && defined(Q_CC_GNU) 107 #include <asm/fixed_code.h> 113 asm volatile(
"R0 = 1;\n\t" 119 :
"R0",
"R1",
"P0",
"RETS",
"memory");
126 asm volatile(
"R0 = 1;\n\t" 132 :
"R0",
"R1",
"P0",
"RETS",
"memory");
139 asm volatile (
"P0 = %2;\n\t" 146 "da" (expectedValue),
150 :
"P0",
"R0",
"R1",
"R2",
"RETS",
"memory",
"cc");
151 return readval == expectedValue;
156 asm volatile(
"R1 = %2;\n\t" 162 :
"R0",
"R1",
"P0",
"RETS",
"memory");
169 asm volatile(
"R0 = %[val];\n\t" 171 "CALL (%[addr]);\n\t" 173 : [ret]
"=da" (ret),
"=m" (
_q_value)
174 : [addr]
"a" (ATOMIC_ADD32), [qvalp]
"da" (&
_q_value),
"m" (
_q_value), [val]
"da" (valueToAdd)
175 :
"R0",
"R1",
"P0",
"RETS",
"memory");
179 template <
typename T>
183 asm volatile (
"P0 = %2;\n\t" 190 "da" (expectedValue),
194 :
"P0",
"R0",
"R1",
"R2",
"RETS",
"memory",
"cc");
195 return readval == expectedValue;
198 template <
typename T>
201 asm volatile(
"R1 = %2;\n\t" 207 :
"R0",
"R1",
"P0",
"RETS",
"memory");
211 template <
typename T>
215 asm volatile(
"R0 = %[val];\n\t" 217 "CALL (%[addr]);\n\t" 219 : [ret]
"=da" (ret),
"=m" (
_q_value)
220 : [addr]
"a" (ATOMIC_ADD32), [qvalp]
"da" (&
_q_value),
"m" (
_q_value), [val]
"da" (valueToAdd *
sizeof(T))
221 :
"R0",
"R1",
"P0",
"RETS",
"memory");
226 #endif // Q_OS_LINUX && Q_CC_GNU 281 template <
typename T>
287 template <
typename T>
293 template <
typename T>
301 template <
typename T>
307 template <
typename T>
313 template <
typename T>
321 template <
typename T>
327 template <
typename T>
333 template <
typename T>
343 #endif // QATOMIC_BFIN_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)
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
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)
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)
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
bool testAndSetRelease(T *expectedValue, T *newValue)
T * fetchAndStoreRelaxed(T *newValue)
static bool isFetchAndStoreNative()
bool testAndSetAcquire(T *expectedValue, T *newValue)