Rev 115 | Rev 241 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 115 | Rev 116 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | #else |
45 | #else |
46 | __asm__ volatile ("decl (%0)\n" : : "r" (val)); |
46 | __asm__ volatile ("decl (%0)\n" : : "r" (val)); |
47 | #endif /* __SMP__ */ |
47 | #endif /* __SMP__ */ |
48 | } |
48 | } |
49 | 49 | ||
50 | static inline int test_and_set(int *val) { |
50 | static inline int test_and_set(volatile int *val) { |
51 | int v; |
51 | int v; |
52 | 52 | ||
53 | __asm__ volatile ( |
53 | __asm__ volatile ( |
54 | "movl $1, %0\n" |
54 | "movl $1, %0\n" |
55 | "xchgl %0, (%1)\n" |
55 | "xchgl %0, (%1)\n" |
Line 59... | Line 59... | ||
59 | 59 | ||
60 | return v; |
60 | return v; |
61 | } |
61 | } |
62 | 62 | ||
63 | 63 | ||
64 | extern void spinlock_arch(int *val); |
64 | extern void spinlock_arch(volatile int *val); |
65 | 65 | ||
66 | #endif |
66 | #endif |