Changeset 80d2bdb in mainline for arch/mips32/include/atomic.h
- Timestamp:
- 2005-12-15T16:10:19Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4cad8b2
- Parents:
- 7dd2561
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/include/atomic.h
r7dd2561 r80d2bdb 42 42 43 43 44 typedef volatile __u32atomic_t;44 typedef struct { volatile __u32 count; } atomic_t; 45 45 46 46 /* Atomic addition of immediate value. … … 63 63 " beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ 64 64 /* nop */ /* nop is inserted automatically by compiler */ 65 : "=r" (tmp), "=m" ( *val), "=r" (v)65 : "=r" (tmp), "=m" (val->count), "=r" (v) 66 66 : "i" (i), "i" (0) 67 67 ); … … 70 70 } 71 71 72 /* Reads/writes are atomic on mips for 4-bytes */ 73 74 static inline void atomic_set(atomic_t *val, __u32 i) 75 { 76 val->count = i; 77 } 78 79 static inline __u32 atomic_get(atomic_t *val) 80 { 81 return val->count; 82 } 72 83 73 84 #endif
Note:
See TracChangeset
for help on using the changeset viewer.