Rev 1104 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1104 | Rev 1107 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | 28 | ||
29 | #ifndef __ppc32_ATOMIC_H__ |
29 | #ifndef __ppc32_ATOMIC_H__ |
30 | #define __ppc32_ATOMIC_H__ |
30 | #define __ppc32_ATOMIC_H__ |
31 | 31 | ||
32 | #include <arch/types.h> |
- | |
33 | #include <typedefs.h> |
- | |
34 | - | ||
35 | static inline void atomic_inc(atomic_t *val) |
32 | static inline void atomic_inc(atomic_t *val) |
36 | { |
33 | { |
37 | __u32 tmp; |
34 | long tmp; |
38 | 35 | ||
39 | asm __volatile__ ( |
36 | asm __volatile__ ( |
40 | "1:\n" |
37 | "1:\n" |
41 | "lwarx %0, 0, %2\n" |
38 | "lwarx %0, 0, %2\n" |
42 | "addic %0, %0, 1\n" |
39 | "addic %0, %0, 1\n" |
Line 47... | Line 44... | ||
47 | : "cc"); |
44 | : "cc"); |
48 | } |
45 | } |
49 | 46 | ||
50 | static inline void atomic_dec(atomic_t *val) |
47 | static inline void atomic_dec(atomic_t *val) |
51 | { |
48 | { |
52 | __u32 tmp; |
49 | long tmp; |
53 | 50 | ||
54 | asm __volatile__( |
51 | asm __volatile__( |
55 | "1:\n" |
52 | "1:\n" |
56 | "lwarx %0, 0, %2\n" |
53 | "lwarx %0, 0, %2\n" |
57 | "addic %0, %0, -1\n" |
54 | "addic %0, %0, -1\n" |