Changeset 3bac8a4c in rtems


Ignore:
Timestamp:
Sep 3, 2013, 9:04:33 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
4a8c334
Parents:
29f7d317
git-author:
Sebastian Huber <sebastian.huber@…> (09/03/13 09:04:33)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/03/13 09:07:36)
Message:

score: Use void * for some atomic pointer ops

Location:
cpukit/score/include/rtems/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/atomic.h

    r29f7d317 r3bac8a4c  
    4747 *
    4848 * @param object an atomic type pointer of object.
    49  * @param value a value to be stored into object.
     49 * @param pointer a pointer to be stored into object.
    5050 */
    5151static inline void _Atomic_Init_ulong(
     
    5959static inline void _Atomic_Init_ptr(
    6060  volatile Atomic_Pointer *object,
    61   uintptr_t value
    62 )
    63 {
    64   _CPU_atomic_Init_ptr(object, value);
     61  void *pointer
     62)
     63{
     64  _CPU_atomic_Init_ptr(object, pointer);
    6565}
    6666
     
    8181}
    8282
    83 static inline uintptr_t _Atomic_Load_ptr(
     83static inline void *_Atomic_Load_ptr(
    8484  volatile Atomic_Pointer *object,
    8585  Atomic_Order order
     
    109109static inline void _Atomic_Store_ptr(
    110110  volatile Atomic_Pointer *object,
    111   uintptr_t value,
    112   Atomic_Order order
    113 )
    114 {
    115   _CPU_atomic_Store_ptr( object, value, order );
     111  void *pointer,
     112  Atomic_Order order
     113)
     114{
     115  _CPU_atomic_Store_ptr( object, pointer, order );
    116116}
    117117
     
    242242}
    243243
    244 static inline uintptr_t _Atomic_Exchange_ptr(
     244static inline void *_Atomic_Exchange_ptr(
    245245 volatile Atomic_Pointer *object,
    246  uintptr_t value,
     246 void *pointer,
    247247 Atomic_Order order
    248248)
    249249{
    250   return _CPU_atomic_Exchange_ptr( object, value, order );
     250  return _CPU_atomic_Exchange_ptr( object, pointer, order );
    251251}
    252252
     
    279279static inline bool _Atomic_Compare_exchange_ptr(
    280280  volatile Atomic_Pointer *object,
    281   uintptr_t *old_value,
    282   uintptr_t new_value,
     281  void **old_pointer,
     282  void *new_pointer,
    283283  Atomic_Order order_succ,
    284284  Atomic_Order order_fail
    285285)
    286286{
    287   return _CPU_atomic_Compare_exchange_ptr( object, old_value, new_value,
     287  return _CPU_atomic_Compare_exchange_ptr( object, old_pointer, new_pointer,
    288288    order_succ, order_fail );
    289289}
  • cpukit/score/include/rtems/score/cpustdatomic.h

    r29f7d317 r3bac8a4c  
    7373 */
    7474#define CPU_ATOMIC_INITIALIZER_ULONG(value) ATOMIC_VAR_INIT(value)
    75 #define CPU_ATOMIC_INITIALIZER_PTR(value) ATOMIC_VAR_INIT(value)
     75#define CPU_ATOMIC_INITIALIZER_PTR(pointer) \
     76  ATOMIC_VAR_INIT((uintptr_t) pointer)
    7677
    7778#define CPU_ATOMIC_INITIALIZER_FLAG ATOMIC_FLAG_INIT
     
    9394static inline void _CPU_atomic_Init_ptr(
    9495  volatile Atomic_Pointer *object,
    95   uintptr_t value
    96 )
    97 {
    98   atomic_init(object, value);
     96  void *pointer
     97)
     98{
     99  atomic_init(object, pointer);
    99100}
    100101
     
    115116}
    116117
    117 static inline uintptr_t _CPU_atomic_Load_ptr(
     118static inline void *_CPU_atomic_Load_ptr(
    118119  volatile Atomic_Pointer *object,
    119120  Atomic_Order order
     
    143144static inline void _CPU_atomic_Store_ptr(
    144145  volatile Atomic_Pointer *object,
    145   uintptr_t value,
    146   Atomic_Order order
    147 )
    148 {
    149   atomic_store_explicit( object, value, order );
     146  void *pointer,
     147  Atomic_Order order
     148)
     149{
     150  atomic_store_explicit( object, pointer, order );
    150151}
    151152
     
    276277}
    277278
    278 static inline uintptr_t _CPU_atomic_Exchange_ptr(
     279static inline void *_CPU_atomic_Exchange_ptr(
    279280 volatile Atomic_Pointer *object,
    280  uintptr_t value,
     281 void *pointer,
    281282 Atomic_Order order
    282283)
    283284{
    284   return atomic_exchange_explicit( object, value, order );
     285  return atomic_exchange_explicit( object, pointer, pointer );
    285286}
    286287
     
    313314static inline bool _CPU_atomic_Compare_exchange_ptr(
    314315  volatile Atomic_Pointer *object,
    315   uintptr_t *old_value,
    316   uintptr_t new_value,
     316  void **old_pointer,
     317  void *new_pointer,
    317318  Atomic_Order order_succ,
    318319  Atomic_Order order_fail
    319320)
    320321{
    321   return atomic_compare_exchange_strong_explicit( object, old_value,
    322     new_value, order_succ, order_fail );
     322  return atomic_compare_exchange_strong_explicit( object, old_pointer,
     323    new_pointer, order_succ, order_fail );
    323324}
    324325
Note: See TracChangeset for help on using the changeset viewer.