Rev 477 | Rev 501 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 477 | Rev 478 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | atomic_t v; |
38 | atomic_t v; |
39 | 39 | ||
40 | 40 | ||
41 | __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (*val) : "i" (imm)); |
41 | __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (*val) : "i" (imm)); |
42 | 42 | ||
43 | *val += imm; |
- | |
44 | - | ||
45 | return v; |
43 | return v; |
46 | } |
44 | } |
47 | 45 | ||
48 | static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } |
46 | static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } |
49 | static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } |
47 | static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } |
Line 51... | Line 49... | ||
51 | 49 | ||
52 | static inline atomic_t atomic_inc_pre(atomic_t *val) { return atomic_add(val, 1); } |
50 | static inline atomic_t atomic_inc_pre(atomic_t *val) { return atomic_add(val, 1); } |
53 | static inline atomic_t atomic_dec_pre(atomic_t *val) { return atomic_add(val, -1); } |
51 | static inline atomic_t atomic_dec_pre(atomic_t *val) { return atomic_add(val, -1); } |
54 | 52 | ||
55 | 53 | ||
56 | static inline atomic_t atomic_inc_post(atomic_t *val) { return atomic_add(val, 1)+1; } |
54 | static inline atomic_t atomic_inc_post(atomic_t *val) { return atomic_add(val, 1) + 1; } |
57 | static inline atomic_t atomic_dec_post(atomic_t *val) { return atomic_add(val, -1)-1; } |
55 | static inline atomic_t atomic_dec_post(atomic_t *val) { return atomic_add(val, -1) - 1; } |
58 | - | ||
59 | - | ||
60 | - | ||
61 | 56 | ||
62 | #endif |
57 | #endif |