Rev 625 | Rev 861 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 625 | Rev 627 | ||
|---|---|---|---|
| Line 36... | Line 36... | ||
| 36 | /* |
36 | /* |
| 37 | * TODO: these are just placeholders for real implementations of atomic_inc and atomic_dec. |
37 | * TODO: these are just placeholders for real implementations of atomic_inc and atomic_dec. |
| 38 | * WARNING: the following functions cause the code to be preemption-unsafe !!! |
38 | * WARNING: the following functions cause the code to be preemption-unsafe !!! |
| 39 | */ |
39 | */ |
| 40 | 40 | ||
| 41 | static inline void atomic_inc(atomic_t *val) { |
41 | static inline void atomic_inc(atomic_t *val) |
| - | 42 | { |
|
| 42 | val->count++; |
43 | val->count++; |
| 43 | } |
44 | } |
| 44 | 45 | ||
| 45 | static inline void atomic_dec(atomic_t *val) { |
46 | static inline void atomic_dec(atomic_t *val) |
| - | 47 | { |
|
| 46 | val->count--; |
48 | val->count--; |
| 47 | } |
49 | } |
| 48 | 50 | ||
| - | 51 | static inline void atomic_set(atomic_t *val, __u64 i) |
|
| - | 52 | { |
|
| - | 53 | val->count = i; |
|
| - | 54 | } |
|
| - | 55 | ||
| - | 56 | static inline __u64 atomic_get(atomic_t *val) |
|
| - | 57 | { |
|
| - | 58 | return val->count; |
|
| - | 59 | } |
|
| - | 60 | ||
| 49 | #endif |
61 | #endif |