Commit 92934bcb authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] i386/x86-64: Use input/output dependencies for bitops

Noticed by Andreas Schwab
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 636aab5c
...@@ -43,7 +43,7 @@ static inline void set_bit(int nr, volatile unsigned long * addr) ...@@ -43,7 +43,7 @@ static inline void set_bit(int nr, volatile unsigned long * addr)
{ {
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btsl %1,%0" "btsl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
} }
...@@ -60,7 +60,7 @@ static inline void __set_bit(int nr, volatile unsigned long * addr) ...@@ -60,7 +60,7 @@ static inline void __set_bit(int nr, volatile unsigned long * addr)
{ {
__asm__( __asm__(
"btsl %1,%0" "btsl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
} }
...@@ -78,7 +78,7 @@ static inline void clear_bit(int nr, volatile unsigned long * addr) ...@@ -78,7 +78,7 @@ static inline void clear_bit(int nr, volatile unsigned long * addr)
{ {
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btrl %1,%0" "btrl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
} }
...@@ -86,7 +86,7 @@ static inline void __clear_bit(int nr, volatile unsigned long * addr) ...@@ -86,7 +86,7 @@ static inline void __clear_bit(int nr, volatile unsigned long * addr)
{ {
__asm__ __volatile__( __asm__ __volatile__(
"btrl %1,%0" "btrl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
} }
#define smp_mb__before_clear_bit() barrier() #define smp_mb__before_clear_bit() barrier()
...@@ -105,7 +105,7 @@ static inline void __change_bit(int nr, volatile unsigned long * addr) ...@@ -105,7 +105,7 @@ static inline void __change_bit(int nr, volatile unsigned long * addr)
{ {
__asm__ __volatile__( __asm__ __volatile__(
"btcl %1,%0" "btcl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
} }
...@@ -123,7 +123,7 @@ static inline void change_bit(int nr, volatile unsigned long * addr) ...@@ -123,7 +123,7 @@ static inline void change_bit(int nr, volatile unsigned long * addr)
{ {
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btcl %1,%0" "btcl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
} }
...@@ -142,7 +142,7 @@ static inline int test_and_set_bit(int nr, volatile unsigned long * addr) ...@@ -142,7 +142,7 @@ static inline int test_and_set_bit(int nr, volatile unsigned long * addr)
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btsl %2,%1\n\tsbbl %0,%0" "btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"Ir" (nr) : "memory"); :"Ir" (nr) : "memory");
return oldbit; return oldbit;
} }
...@@ -162,7 +162,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long * addr) ...@@ -162,7 +162,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long * addr)
__asm__( __asm__(
"btsl %2,%1\n\tsbbl %0,%0" "btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
return oldbit; return oldbit;
} }
...@@ -182,7 +182,7 @@ static inline int test_and_clear_bit(int nr, volatile unsigned long * addr) ...@@ -182,7 +182,7 @@ static inline int test_and_clear_bit(int nr, volatile unsigned long * addr)
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btrl %2,%1\n\tsbbl %0,%0" "btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"Ir" (nr) : "memory"); :"Ir" (nr) : "memory");
return oldbit; return oldbit;
} }
...@@ -202,7 +202,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) ...@@ -202,7 +202,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
__asm__( __asm__(
"btrl %2,%1\n\tsbbl %0,%0" "btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"Ir" (nr)); :"Ir" (nr));
return oldbit; return oldbit;
} }
...@@ -214,7 +214,7 @@ static inline int __test_and_change_bit(int nr, volatile unsigned long *addr) ...@@ -214,7 +214,7 @@ static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
__asm__ __volatile__( __asm__ __volatile__(
"btcl %2,%1\n\tsbbl %0,%0" "btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"Ir" (nr) : "memory"); :"Ir" (nr) : "memory");
return oldbit; return oldbit;
} }
...@@ -233,7 +233,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long* addr) ...@@ -233,7 +233,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long* addr)
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btcl %2,%1\n\tsbbl %0,%0" "btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"Ir" (nr) : "memory"); :"Ir" (nr) : "memory");
return oldbit; return oldbit;
} }
......
...@@ -29,7 +29,7 @@ static __inline__ void set_bit(int nr, volatile void * addr) ...@@ -29,7 +29,7 @@ static __inline__ void set_bit(int nr, volatile void * addr)
{ {
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btsl %1,%0" "btsl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"dIr" (nr) : "memory"); :"dIr" (nr) : "memory");
} }
...@@ -46,7 +46,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr) ...@@ -46,7 +46,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr)
{ {
__asm__ volatile( __asm__ volatile(
"btsl %1,%0" "btsl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"dIr" (nr) : "memory"); :"dIr" (nr) : "memory");
} }
...@@ -64,7 +64,7 @@ static __inline__ void clear_bit(int nr, volatile void * addr) ...@@ -64,7 +64,7 @@ static __inline__ void clear_bit(int nr, volatile void * addr)
{ {
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btrl %1,%0" "btrl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"dIr" (nr)); :"dIr" (nr));
} }
...@@ -72,7 +72,7 @@ static __inline__ void __clear_bit(int nr, volatile void * addr) ...@@ -72,7 +72,7 @@ static __inline__ void __clear_bit(int nr, volatile void * addr)
{ {
__asm__ __volatile__( __asm__ __volatile__(
"btrl %1,%0" "btrl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"dIr" (nr)); :"dIr" (nr));
} }
...@@ -92,7 +92,7 @@ static __inline__ void __change_bit(int nr, volatile void * addr) ...@@ -92,7 +92,7 @@ static __inline__ void __change_bit(int nr, volatile void * addr)
{ {
__asm__ __volatile__( __asm__ __volatile__(
"btcl %1,%0" "btcl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"dIr" (nr)); :"dIr" (nr));
} }
...@@ -109,7 +109,7 @@ static __inline__ void change_bit(int nr, volatile void * addr) ...@@ -109,7 +109,7 @@ static __inline__ void change_bit(int nr, volatile void * addr)
{ {
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btcl %1,%0" "btcl %1,%0"
:"=m" (ADDR) :"+m" (ADDR)
:"dIr" (nr)); :"dIr" (nr));
} }
...@@ -127,7 +127,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr) ...@@ -127,7 +127,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btsl %2,%1\n\tsbbl %0,%0" "btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"dIr" (nr) : "memory"); :"dIr" (nr) : "memory");
return oldbit; return oldbit;
} }
...@@ -147,7 +147,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile void * addr) ...@@ -147,7 +147,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
__asm__( __asm__(
"btsl %2,%1\n\tsbbl %0,%0" "btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"dIr" (nr)); :"dIr" (nr));
return oldbit; return oldbit;
} }
...@@ -166,7 +166,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr) ...@@ -166,7 +166,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btrl %2,%1\n\tsbbl %0,%0" "btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"dIr" (nr) : "memory"); :"dIr" (nr) : "memory");
return oldbit; return oldbit;
} }
...@@ -186,7 +186,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile void * addr) ...@@ -186,7 +186,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
__asm__( __asm__(
"btrl %2,%1\n\tsbbl %0,%0" "btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"dIr" (nr)); :"dIr" (nr));
return oldbit; return oldbit;
} }
...@@ -198,7 +198,7 @@ static __inline__ int __test_and_change_bit(int nr, volatile void * addr) ...@@ -198,7 +198,7 @@ static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
__asm__ __volatile__( __asm__ __volatile__(
"btcl %2,%1\n\tsbbl %0,%0" "btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"dIr" (nr) : "memory"); :"dIr" (nr) : "memory");
return oldbit; return oldbit;
} }
...@@ -217,7 +217,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr) ...@@ -217,7 +217,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
__asm__ __volatile__( LOCK_PREFIX __asm__ __volatile__( LOCK_PREFIX
"btcl %2,%1\n\tsbbl %0,%0" "btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR) :"=r" (oldbit),"+m" (ADDR)
:"dIr" (nr) : "memory"); :"dIr" (nr) : "memory");
return oldbit; return oldbit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment