diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-28 11:27:26 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-28 14:58:50 +0200 |
commit | 03aad60a05e2aea8449e79f5b7f7f26a93878251 (patch) | |
tree | ed85f6788b620ab3b92df7b488aa57ca2dda1f73 /cpukit/score/include/rtems/score/cpustdatomic.h | |
parent | score: Simplify <rtems/score/cpuatomic.h> (diff) | |
download | rtems-03aad60a05e2aea8449e79f5b7f7f26a93878251.tar.bz2 |
score: Atomic flag changes
Delete _Atomic_Init_flag(). Change ATOMIC_INITIALIZER_FLAG into a
constant. Rename _Atomic_Clear_flag() to _Atomic_Flag_clear(). Rename
_Atomic_Test_set_flag() to _Atomic_Flag_test_and_set(). This is now in
line with the C11 schema.
Diffstat (limited to 'cpukit/score/include/rtems/score/cpustdatomic.h')
-rw-r--r-- | cpukit/score/include/rtems/score/cpustdatomic.h | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/cpukit/score/include/rtems/score/cpustdatomic.h b/cpukit/score/include/rtems/score/cpustdatomic.h index 47f9195d93..6ec5828d1d 100644 --- a/cpukit/score/include/rtems/score/cpustdatomic.h +++ b/cpukit/score/include/rtems/score/cpustdatomic.h @@ -73,7 +73,8 @@ typedef enum { */ #define CPU_ATOMIC_INITIALIZER_UINT(value) ATOMIC_VAR_INIT(value) #define CPU_ATOMIC_INITIALIZER_PTR(value) ATOMIC_VAR_INIT(value) -#define CPU_ATOMIC_INITIALIZER_FLAG(value) ATOMIC_VAR_INIT(value) + +#define CPU_ATOMIC_INITIALIZER_FLAG ATOMIC_FLAG_INIT /** * @brief Initializes an atomic type value into a atomic object. @@ -97,14 +98,6 @@ static inline void _CPU_atomic_Init_ptr( atomic_init(object, value); } -static inline void _CPU_atomic_Init_flag( - volatile Atomic_Flag *object, - _Bool value -) -{ - atomic_init(object, value); -} - /** * @brief Atomically load an atomic type value from atomic object. * @@ -329,33 +322,17 @@ static inline bool _CPU_atomic_Compare_exchange_ptr( new_value, order_succ, order_fail ); } -/** - * @brief Atomically clear the value of an atomic flag type object. - * - * @param[in, out] object an atomic flag type pointer of object. - * @param order a type of Atomic_Order. - * - */ -static inline void _CPU_atomic_Clear_flag( - volatile Atomic_Flag *object, - Atomic_Order order +static inline void _CPU_atomic_Flag_clear( + volatile Atomic_Flag *object, + Atomic_Order order ) { return atomic_flag_clear_explicit( object, order ); } -/** - * @brief Atomically test and clear the value of an atomic flag type object. - * - * @param[in, out] object an atomic flag type pointer of object. - * @param order a type of Atomic_Order. - * - * @retval true if the test and set successully. - * @retval false if the test and set failed. - */ -static inline bool _CPU_atomic_Test_set_flag( - volatile Atomic_Flag *object, - Atomic_Order order +static inline bool _CPU_atomic_Flag_test_and_set( + volatile Atomic_Flag *object, + Atomic_Order order ) { return atomic_flag_test_and_set_explicit( object, order ); |