Changeset 10c071e in mainline for arch/ia64/include/atomic.h


Ignore:
Timestamp:
2005-12-15T16:57:48Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c68b97
Parents:
b4cad8b2
Message:

Fix ia64 and sparc64 to compile with new atomic_t.
Fix rwlock test #5 and semaphore test #1 to compile with new atomic_t.

sparc64 work.
TBA must be set before a function call when MMU is switched off.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia64/include/atomic.h

    rb4cad8b2 r10c071e  
    3434typedef struct { volatile __u64 count; } atomic_t;
    3535
    36 static inline atomic_t atomic_add(atomic_t *val, int imm)
     36/** Atomic addition.
     37 *
     38 * @param val Atomic value.
     39 * @param imm Value to add.
     40 *
     41 * @return Value after addition.
     42 */
     43static inline count_t atomic_add(atomic_t *val, int imm)
    3744{
    38         atomic_t v;
     45        count_t v;
    3946
    40        
    4147        __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (val->count) : "i" (imm));
    4248 
     
    5763static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); }
    5864
     65static inline count_t atomic_inc_pre(atomic_t *val) { return atomic_add(val, 1); }
     66static inline count_t atomic_dec_pre(atomic_t *val) { return atomic_add(val, -1); }
    5967
    60 static inline atomic_t atomic_inc_pre(atomic_t *val) { return atomic_add(val, 1); }
    61 static inline atomic_t atomic_dec_pre(atomic_t *val) { return atomic_add(val, -1); }
    62 
    63 
    64 static inline atomic_t atomic_inc_post(atomic_t *val) { return atomic_add(val, 1) + 1; }
    65 static inline atomic_t atomic_dec_post(atomic_t *val) { return atomic_add(val, -1) - 1; }
     68static inline count_t atomic_inc_post(atomic_t *val) { return atomic_add(val, 1) + 1; }
     69static inline count_t atomic_dec_post(atomic_t *val) { return atomic_add(val, -1) - 1; }
    6670
    6771#endif
Note: See TracChangeset for help on using the changeset viewer.