summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/atomic.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-09-02 15:08:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-09-03 11:07:36 +0200
commit29f7d31782dc7b03da119aba3fa09085500e1b0c (patch)
treeeafe1b84e081dc65a8e1ad8bc74ed2bd52947f18 /cpukit/score/include/rtems/score/atomic.h
parentbsp/lm4f120: new BSP to support TI LM4F120 XL LaunchPad board (diff)
downloadrtems-29f7d31782dc7b03da119aba3fa09085500e1b0c.tar.bz2
score: Use unsigned long for atomic integers
Use unsigned long instead of uint_fast32_t since C11 provides only a ATOMIC_LONG_LOCK_FREE macro constant. This makes it also possible to use properly typed integer literals like 123UL. It is now clear which compatible type should be used for the atomic integer.
Diffstat (limited to 'cpukit/score/include/rtems/score/atomic.h')
-rw-r--r--cpukit/score/include/rtems/score/atomic.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/cpukit/score/include/rtems/score/atomic.h b/cpukit/score/include/rtems/score/atomic.h
index e085dea4a0..459b55a455 100644
--- a/cpukit/score/include/rtems/score/atomic.h
+++ b/cpukit/score/include/rtems/score/atomic.h
@@ -34,7 +34,7 @@ extern "C" {
/**
* @brief atomic data initializer for static initialization.
*/
-#define ATOMIC_INITIALIZER_UINT(value) CPU_ATOMIC_INITIALIZER_UINT(value)
+#define ATOMIC_INITIALIZER_ULONG(value) CPU_ATOMIC_INITIALIZER_ULONG(value)
#define ATOMIC_INITIALIZER_PTR(value) CPU_ATOMIC_INITIALIZER_PTR(value)
/**
@@ -48,12 +48,12 @@ extern "C" {
* @param object an atomic type pointer of object.
* @param value a value to be stored into object.
*/
-static inline void _Atomic_Init_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value
+static inline void _Atomic_Init_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value
)
{
- _CPU_atomic_Init_uint(object, value);
+ _CPU_atomic_Init_ulong(object, value);
}
static inline void _Atomic_Init_ptr(
@@ -72,12 +72,12 @@ static inline void _Atomic_Init_ptr(
*
* The order shall not be ATOMIC_ORDER_RELEASE.
*/
-static inline uint_fast32_t _Atomic_Load_uint(
- volatile Atomic_Uint *object,
+static inline unsigned long _Atomic_Load_ulong(
+ volatile Atomic_Ulong *object,
Atomic_Order order
)
{
- return _CPU_atomic_Load_uint( object, order );
+ return _CPU_atomic_Load_ulong( object, order );
}
static inline uintptr_t _Atomic_Load_ptr(
@@ -97,13 +97,13 @@ static inline uintptr_t _Atomic_Load_ptr(
*
* The order shall not be ATOMIC_ORDER_ACQUIRE.
*/
-static inline void _Atomic_Store_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value,
+static inline void _Atomic_Store_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value,
Atomic_Order order
)
{
- _CPU_atomic_Store_uint( object, value, order );
+ _CPU_atomic_Store_ulong( object, value, order );
}
static inline void _Atomic_Store_ptr(
@@ -124,13 +124,13 @@ static inline void _Atomic_Store_ptr(
*
* @retval a result value before add ops.
*/
-static inline uint_fast32_t _Atomic_Fetch_add_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value,
+static inline unsigned long _Atomic_Fetch_add_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value,
Atomic_Order order
)
{
- return _CPU_atomic_Fetch_add_uint( object, value, order );
+ return _CPU_atomic_Fetch_add_ulong( object, value, order );
}
static inline uintptr_t _Atomic_Fetch_add_ptr(
@@ -151,13 +151,13 @@ static inline uintptr_t _Atomic_Fetch_add_ptr(
*
* @retval a result value before sub ops.
*/
-static inline uint_fast32_t _Atomic_Fetch_sub_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value,
+static inline unsigned long _Atomic_Fetch_sub_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value,
Atomic_Order order
)
{
- return _CPU_atomic_Fetch_sub_uint( object, value, order );
+ return _CPU_atomic_Fetch_sub_ulong( object, value, order );
}
static inline uintptr_t _Atomic_Fetch_sub_ptr(
@@ -178,13 +178,13 @@ static inline uintptr_t _Atomic_Fetch_sub_ptr(
*
* @retval a result value before or ops.
*/
-static inline uint_fast32_t _Atomic_Fetch_or_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value,
+static inline unsigned long _Atomic_Fetch_or_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value,
Atomic_Order order
)
{
- return _CPU_atomic_Fetch_or_uint( object, value, order );
+ return _CPU_atomic_Fetch_or_ulong( object, value, order );
}
static inline uintptr_t _Atomic_Fetch_or_ptr(
@@ -205,13 +205,13 @@ static inline uintptr_t _Atomic_Fetch_or_ptr(
*
* @retval a result value before and ops.
*/
-static inline uint_fast32_t _Atomic_Fetch_and_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value,
+static inline unsigned long _Atomic_Fetch_and_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value,
Atomic_Order order
)
{
- return _CPU_atomic_Fetch_and_uint( object, value, order );
+ return _CPU_atomic_Fetch_and_ulong( object, value, order );
}
static inline uintptr_t _Atomic_Fetch_and_ptr(
@@ -232,13 +232,13 @@ static inline uintptr_t _Atomic_Fetch_and_ptr(
*
* @retval a result value before exchange ops.
*/
-static inline uint_fast32_t _Atomic_Exchange_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t value,
+static inline unsigned long _Atomic_Exchange_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long value,
Atomic_Order order
)
{
- return _CPU_atomic_Exchange_uint( object, value, order );
+ return _CPU_atomic_Exchange_ulong( object, value, order );
}
static inline uintptr_t _Atomic_Exchange_ptr(
@@ -264,15 +264,15 @@ static inline uintptr_t _Atomic_Exchange_ptr(
* @retval true if the compare exchange successully.
* @retval false if the compare exchange failed.
*/
-static inline bool _Atomic_Compare_exchange_uint(
- volatile Atomic_Uint *object,
- uint_fast32_t *old_value,
- uint_fast32_t new_value,
+static inline bool _Atomic_Compare_exchange_ulong(
+ volatile Atomic_Ulong *object,
+ unsigned long *old_value,
+ unsigned long new_value,
Atomic_Order order_succ,
Atomic_Order order_fail
)
{
- return _CPU_atomic_Compare_exchange_uint( object, old_value, new_value,
+ return _CPU_atomic_Compare_exchange_ulong( object, old_value, new_value,
order_succ, order_fail );
}