Changeset 73a4bab in mainline for arch/mips32
- Timestamp:
- 2005-11-11T14:06:55Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a0b3730
- Parents:
- 0172eba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/include/atomic.h
r0172eba r73a4bab 35 35 #define atomic_dec(x) (a_sub(x,1)) 36 36 37 #define atomic_inc_pre(x) (a_add(x,1)-1) 38 #define atomic_dec_pre(x) (a_sub(x,1)+1) 39 40 #define atomic_inc_post(x) (a_add(x,1)) 41 #define atomic_dec_post(x) (a_sub(x,1)) 42 43 37 44 typedef volatile __u32 atomic_t; 38 45 … … 45 52 * of the variable to a special register and if another process writes to 46 53 * the same location, the SC (store-conditional) instruction fails. 54 55 Returns (*val)+i 56 47 57 */ 48 58 static inline atomic_t a_add(atomic_t *val, int i) … … 73 83 * 74 84 * Implemented in the same manner as a_add, except we substract the value. 85 86 Returns (*val)-i 87 75 88 */ 76 89 static inline atomic_t a_sub(atomic_t *val, int i)
Note:
See TracChangeset
for help on using the changeset viewer.