Changeset 59e07c91 in mainline for arch/mips32/include/atomic.h
- Timestamp:
- 2005-11-10T13:56:26Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0172eba
- Parents:
- 13fe013
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/include/atomic.h
r13fe013 r59e07c91 30 30 #define __mips32_ATOMIC_H__ 31 31 32 #include <arch/types.h> 33 32 34 #define atomic_inc(x) (a_add(x,1)) 33 35 #define atomic_dec(x) (a_sub(x,1)) 36 37 typedef volatile __u32 atomic_t; 34 38 35 39 /* … … 42 46 * the same location, the SC (store-conditional) instruction fails. 43 47 */ 44 static inline int a_add( volatile int *val, int i)48 static inline atomic_t a_add(atomic_t *val, int i) 45 49 { 46 int tmp, tmp2;50 atomic_t tmp, tmp2; 47 51 48 52 asm volatile ( … … 70 74 * Implemented in the same manner as a_add, except we substract the value. 71 75 */ 72 static inline int a_sub( volatile int *val, int i)76 static inline atomic_t a_sub(atomic_t *val, int i) 73 77 74 78 { 75 int tmp, tmp2;79 atomic_t tmp, tmp2; 76 80 77 81 asm volatile (
Note:
See TracChangeset
for help on using the changeset viewer.