diff options
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/atomic.h | 17 | ||||
-rw-r--r-- | arch/x86/include/asm/atomic64_64.h | 2 |
2 files changed, 2 insertions, 17 deletions
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 6dd1c7dd0473..5e5cd123fdfb 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h | |||
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | static inline int atomic_read(const atomic_t *v) | 25 | static inline int atomic_read(const atomic_t *v) |
26 | { | 26 | { |
27 | return (*(volatile int *)&(v)->counter); | 27 | return ACCESS_ONCE((v)->counter); |
28 | } | 28 | } |
29 | 29 | ||
30 | /** | 30 | /** |
@@ -219,21 +219,6 @@ static inline short int atomic_inc_short(short int *v) | |||
219 | return *v; | 219 | return *v; |
220 | } | 220 | } |
221 | 221 | ||
222 | #ifdef CONFIG_X86_64 | ||
223 | /** | ||
224 | * atomic_or_long - OR of two long integers | ||
225 | * @v1: pointer to type unsigned long | ||
226 | * @v2: pointer to type unsigned long | ||
227 | * | ||
228 | * Atomically ORs @v1 and @v2 | ||
229 | * Returns the result of the OR | ||
230 | */ | ||
231 | static inline void atomic_or_long(unsigned long *v1, unsigned long v2) | ||
232 | { | ||
233 | asm(LOCK_PREFIX "orq %1, %0" : "+m" (*v1) : "r" (v2)); | ||
234 | } | ||
235 | #endif | ||
236 | |||
237 | /* These are x86-specific, used by some header files */ | 222 | /* These are x86-specific, used by some header files */ |
238 | #define atomic_clear_mask(mask, addr) \ | 223 | #define atomic_clear_mask(mask, addr) \ |
239 | asm volatile(LOCK_PREFIX "andl %0,%1" \ | 224 | asm volatile(LOCK_PREFIX "andl %0,%1" \ |
diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h index 46e9052bbd28..f8d273e18516 100644 --- a/arch/x86/include/asm/atomic64_64.h +++ b/arch/x86/include/asm/atomic64_64.h | |||
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | static inline long atomic64_read(const atomic64_t *v) | 19 | static inline long atomic64_read(const atomic64_t *v) |
20 | { | 20 | { |
21 | return (*(volatile long *)&(v)->counter); | 21 | return ACCESS_ONCE((v)->counter); |
22 | } | 22 | } |
23 | 23 | ||
24 | /** | 24 | /** |