Rev 418 | Rev 501 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 418 | Rev 475 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | 28 | ||
29 | #ifndef __sparc64_ATOMIC_H__ |
29 | #ifndef __sparc64_ATOMIC_H__ |
30 | #define __sparc64_ATOMIC_H__ |
30 | #define __sparc64_ATOMIC_H__ |
31 | 31 | ||
- | 32 | #include <arch/types.h> |
|
- | 33 | ||
- | 34 | typedef volatile __u64 atomic_t; |
|
- | 35 | ||
32 | /* |
36 | /* |
33 | * 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. |
34 | * WARNING: the following functions cause the code to be preemption-unsafe !!! |
38 | * WARNING: the following functions cause the code to be preemption-unsafe !!! |
35 | */ |
39 | */ |
36 | 40 | ||
37 | static inline atomic_inc(volatile int *val) { |
41 | static inline void atomic_inc(atomic_t *val) { |
38 | *val++; |
42 | *val++; |
39 | } |
43 | } |
40 | 44 | ||
41 | static inline atomic_dec(volatile int *val) { |
45 | static inline void atomic_dec(atomic_t *val) { |
42 | *val--; |
46 | *val--; |
43 | } |
47 | } |
44 | 48 | ||
45 | #endif |
49 | #endif |