[rtems commit] score: Use static inline directly

Sebastian Huber sebh at rtems.org
Wed Aug 28 12:54:21 UTC 2013


Module:    rtems
Branch:    master
Commit:    4288f9fd01f57ff7711bb3d1c4fe22f6ff463980
Changeset: http://git.rtems.org/rtems/commit/?id=4288f9fd01f57ff7711bb3d1c4fe22f6ff463980

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Aug 27 15:10:50 2013 +0200

score: Use static inline directly

This file uses already C11 features.  Include proper header file.

---

 cpukit/score/include/rtems/score/atomic.h       |   42 +++++++++++-----------
 cpukit/score/include/rtems/score/cpustdatomic.h |   44 +++++++++++-----------
 2 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/cpukit/score/include/rtems/score/atomic.h b/cpukit/score/include/rtems/score/atomic.h
index d51e733..2c431cc 100644
--- a/cpukit/score/include/rtems/score/atomic.h
+++ b/cpukit/score/include/rtems/score/atomic.h
@@ -44,7 +44,7 @@ extern "C" {
  * @param object an atomic type pointer of object.
  * @param value a value to be stored into object.
  */
-RTEMS_INLINE_ROUTINE void _Atomic_Init_uint(
+static inline void _Atomic_Init_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value
 )
@@ -52,7 +52,7 @@ RTEMS_INLINE_ROUTINE void _Atomic_Init_uint(
   _CPU_atomic_Init_uint(object, value);
 }
 
-RTEMS_INLINE_ROUTINE void _Atomic_Init_ptr(
+static inline void _Atomic_Init_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value
 )
@@ -60,7 +60,7 @@ RTEMS_INLINE_ROUTINE void _Atomic_Init_ptr(
   _CPU_atomic_Init_ptr(object, value);
 }
 
-RTEMS_INLINE_ROUTINE void _Atomic_Init_flag(
+static inline void _Atomic_Init_flag(
   volatile Atomic_Flag *object,
   _Bool value
 )
@@ -76,7 +76,7 @@ RTEMS_INLINE_ROUTINE void _Atomic_Init_flag(
  * 
  * The order shall not be ATOMIC_ORDER_RELEASE.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Load_uint(
+static inline uint_fast32_t _Atomic_Load_uint(
   volatile Atomic_Uint *object,
   Atomic_Order order
 )
@@ -84,7 +84,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Load_uint(
   return _CPU_atomic_Load_uint( object, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Load_ptr(
+static inline uintptr_t _Atomic_Load_ptr(
   volatile Atomic_Pointer *object,
   Atomic_Order order
 )
@@ -101,7 +101,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Load_ptr(
  * 
  * The order shall not be ATOMIC_ORDER_ACQUIRE.
  */
-RTEMS_INLINE_ROUTINE void _Atomic_Store_uint(
+static inline void _Atomic_Store_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -110,7 +110,7 @@ RTEMS_INLINE_ROUTINE void _Atomic_Store_uint(
   _CPU_atomic_Store_uint( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE void _Atomic_Store_ptr(
+static inline void _Atomic_Store_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -128,7 +128,7 @@ RTEMS_INLINE_ROUTINE void _Atomic_Store_ptr(
  * 
  * @retval a result value before add ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_add_uint(
+static inline uint_fast32_t _Atomic_Fetch_add_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -137,7 +137,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_add_uint(
   return _CPU_atomic_Fetch_add_uint( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_add_ptr(
+static inline uintptr_t _Atomic_Fetch_add_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -155,7 +155,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_add_ptr(
  * 
  * @retval a result value before sub ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_sub_uint(
+static inline uint_fast32_t _Atomic_Fetch_sub_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -164,7 +164,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_sub_uint(
   return _CPU_atomic_Fetch_sub_uint( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_sub_ptr(
+static inline uintptr_t _Atomic_Fetch_sub_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -182,7 +182,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_sub_ptr(
  * 
  * @retval a result value before or ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_or_uint(
+static inline uint_fast32_t _Atomic_Fetch_or_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -191,7 +191,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_or_uint(
   return _CPU_atomic_Fetch_or_uint( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_or_ptr(
+static inline uintptr_t _Atomic_Fetch_or_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -209,7 +209,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_or_ptr(
  * 
  * @retval a result value before and ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_and_uint(
+static inline uint_fast32_t _Atomic_Fetch_and_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -218,7 +218,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Fetch_and_uint(
   return _CPU_atomic_Fetch_and_uint( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_and_ptr(
+static inline uintptr_t _Atomic_Fetch_and_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -236,7 +236,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Fetch_and_ptr(
  * 
  * @retval a result value before exchange ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Exchange_uint(
+static inline uint_fast32_t _Atomic_Exchange_uint(
  volatile Atomic_Uint *object,
  uint_fast32_t value,
  Atomic_Order order
@@ -245,7 +245,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _Atomic_Exchange_uint(
   return _CPU_atomic_Exchange_uint( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Exchange_ptr(
+static inline uintptr_t _Atomic_Exchange_ptr(
  volatile Atomic_Pointer *object,
  uintptr_t value,
  Atomic_Order order
@@ -268,7 +268,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Atomic_Exchange_ptr(
  * @retval true if the compare exchange successully.
  * @retval false if the compare exchange failed.
  */
-RTEMS_INLINE_ROUTINE bool _Atomic_Compare_exchange_uint(
+static inline bool _Atomic_Compare_exchange_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t *old_value,
   uint_fast32_t new_value,
@@ -280,7 +280,7 @@ RTEMS_INLINE_ROUTINE bool _Atomic_Compare_exchange_uint(
     order_succ, order_fail );
 }
 
-RTEMS_INLINE_ROUTINE bool _Atomic_Compare_exchange_ptr(
+static inline bool _Atomic_Compare_exchange_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t *old_value,
   uintptr_t new_value,
@@ -299,7 +299,7 @@ RTEMS_INLINE_ROUTINE bool _Atomic_Compare_exchange_ptr(
  * @param order a type of Atomic_Order. 
  * 
  */
-RTEMS_INLINE_ROUTINE void _Atomic_Clear_flag(
+static inline void _Atomic_Clear_flag(
  volatile Atomic_Flag *object,
  Atomic_Order order
 )
@@ -316,7 +316,7 @@ RTEMS_INLINE_ROUTINE void _Atomic_Clear_flag(
  * @retval true if the test and set successully.
  * @retval false if the test and set failed.
  */
-RTEMS_INLINE_ROUTINE bool _Atomic_Test_set_flag(
+static inline bool _Atomic_Test_set_flag(
  volatile Atomic_Flag *object,
  Atomic_Order order
 )
diff --git a/cpukit/score/include/rtems/score/cpustdatomic.h b/cpukit/score/include/rtems/score/cpustdatomic.h
index 5e4f910..47f9195 100644
--- a/cpukit/score/include/rtems/score/cpustdatomic.h
+++ b/cpukit/score/include/rtems/score/cpustdatomic.h
@@ -19,7 +19,7 @@
 #define _RTEMS_SCORE_GENERAL_STDATOMIC_CPU_H_
 
 #include <stdatomic.h>
-#include <rtems/score/types.h>
+#include <stdbool.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -81,7 +81,7 @@ typedef enum {
  * @param object an atomic type pointer of object.
  * @param value a value to be stored into object.
  */
-RTEMS_INLINE_ROUTINE void _CPU_atomic_Init_uint(
+static inline void _CPU_atomic_Init_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value
 )
@@ -89,7 +89,7 @@ RTEMS_INLINE_ROUTINE void _CPU_atomic_Init_uint(
   atomic_init(object, value);
 }
 
-RTEMS_INLINE_ROUTINE void _CPU_atomic_Init_ptr(
+static inline void _CPU_atomic_Init_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value
 )
@@ -97,7 +97,7 @@ RTEMS_INLINE_ROUTINE void _CPU_atomic_Init_ptr(
   atomic_init(object, value);
 }
 
-RTEMS_INLINE_ROUTINE void _CPU_atomic_Init_flag(
+static inline void _CPU_atomic_Init_flag(
   volatile Atomic_Flag *object,
   _Bool value
 )
@@ -113,7 +113,7 @@ RTEMS_INLINE_ROUTINE void _CPU_atomic_Init_flag(
  * 
  * The order shall not be ATOMIC_ORDER_RELEASE.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Load_uint(
+static inline uint_fast32_t _CPU_atomic_Load_uint(
   volatile Atomic_Uint *object,
   Atomic_Order order
 )
@@ -121,7 +121,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Load_uint(
   return atomic_load_explicit( object, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Load_ptr(
+static inline uintptr_t _CPU_atomic_Load_ptr(
   volatile Atomic_Pointer *object,
   Atomic_Order order
 )
@@ -138,7 +138,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Load_ptr(
  * 
  * The order shall not be ATOMIC_ORDER_ACQUIRE.
  */
-RTEMS_INLINE_ROUTINE void _CPU_atomic_Store_uint(
+static inline void _CPU_atomic_Store_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -147,7 +147,7 @@ RTEMS_INLINE_ROUTINE void _CPU_atomic_Store_uint(
   atomic_store_explicit( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE void _CPU_atomic_Store_ptr(
+static inline void _CPU_atomic_Store_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE void _CPU_atomic_Store_ptr(
  * 
  * @retval a result value before add ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_add_uint(
+static inline uint_fast32_t _CPU_atomic_Fetch_add_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -174,7 +174,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_add_uint(
   return atomic_fetch_add_explicit( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_add_ptr(
+static inline uintptr_t _CPU_atomic_Fetch_add_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -192,7 +192,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_add_ptr(
  * 
  * @retval a result value before sub ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_sub_uint(
+static inline uint_fast32_t _CPU_atomic_Fetch_sub_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -201,7 +201,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_sub_uint(
   return atomic_fetch_sub_explicit( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_sub_ptr(
+static inline uintptr_t _CPU_atomic_Fetch_sub_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -219,7 +219,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_sub_ptr(
  * 
  * @retval a result value before or ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_or_uint(
+static inline uint_fast32_t _CPU_atomic_Fetch_or_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -228,7 +228,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_or_uint(
   return atomic_fetch_or_explicit( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_or_ptr(
+static inline uintptr_t _CPU_atomic_Fetch_or_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -246,7 +246,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_or_ptr(
  * 
  * @retval a result value before and ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_and_uint(
+static inline uint_fast32_t _CPU_atomic_Fetch_and_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t value,
   Atomic_Order order
@@ -255,7 +255,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Fetch_and_uint(
   return atomic_fetch_and_explicit( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_and_ptr(
+static inline uintptr_t _CPU_atomic_Fetch_and_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t value,
   Atomic_Order order
@@ -273,7 +273,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Fetch_and_ptr(
  * 
  * @retval a result value before exchange ops.
  */
-RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Exchange_uint(
+static inline uint_fast32_t _CPU_atomic_Exchange_uint(
  volatile Atomic_Uint *object,
  uint_fast32_t value,
  Atomic_Order order
@@ -282,7 +282,7 @@ RTEMS_INLINE_ROUTINE uint_fast32_t _CPU_atomic_Exchange_uint(
   return atomic_exchange_explicit( object, value, order );
 }
 
-RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Exchange_ptr(
+static inline uintptr_t _CPU_atomic_Exchange_ptr(
  volatile Atomic_Pointer *object,
  uintptr_t value,
  Atomic_Order order
@@ -305,7 +305,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _CPU_atomic_Exchange_ptr(
  * @retval true if the compare exchange successully.
  * @retval false if the compare exchange failed.
  */
-RTEMS_INLINE_ROUTINE bool _CPU_atomic_Compare_exchange_uint(
+static inline bool _CPU_atomic_Compare_exchange_uint(
   volatile Atomic_Uint *object,
   uint_fast32_t *old_value,
   uint_fast32_t new_value,
@@ -317,7 +317,7 @@ RTEMS_INLINE_ROUTINE bool _CPU_atomic_Compare_exchange_uint(
     new_value, order_succ, order_fail );
 }
 
-RTEMS_INLINE_ROUTINE bool _CPU_atomic_Compare_exchange_ptr(
+static inline bool _CPU_atomic_Compare_exchange_ptr(
   volatile Atomic_Pointer *object,
   uintptr_t *old_value,
   uintptr_t new_value,
@@ -336,7 +336,7 @@ RTEMS_INLINE_ROUTINE bool _CPU_atomic_Compare_exchange_ptr(
  * @param order a type of Atomic_Order. 
  * 
  */
-RTEMS_INLINE_ROUTINE void _CPU_atomic_Clear_flag(
+static inline void _CPU_atomic_Clear_flag(
  volatile Atomic_Flag *object,
  Atomic_Order order
 )
@@ -353,7 +353,7 @@ RTEMS_INLINE_ROUTINE void _CPU_atomic_Clear_flag(
  * @retval true if the test and set successully.
  * @retval false if the test and set failed.
  */
-RTEMS_INLINE_ROUTINE bool _CPU_atomic_Test_set_flag(
+static inline bool _CPU_atomic_Test_set_flag(
  volatile Atomic_Flag *object,
  Atomic_Order order
 )




More information about the vc mailing list