Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162846
b: refs/heads/master
c: b791d11
h: refs/heads/master
v: v3
  • Loading branch information
David Daney authored and Ralf Baechle committed Sep 17, 2009
1 parent 0f812c6 commit 2454cd6
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7ade3c168e4f437c11f57be012992bbb0e3075c
refs/heads/master: b791d1193af9772040e592d5aa161790f800b762
40 changes: 20 additions & 20 deletions trunk/arch/mips/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
static __inline__ void atomic_add(int i, atomic_t * v)
{
if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
int temp;

__asm__ __volatile__(
Expand All @@ -61,7 +61,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
" .set mips0 \n"
: "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter));
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
int temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -94,7 +94,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
*/
static __inline__ void atomic_sub(int i, atomic_t * v)
{
if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
int temp;

__asm__ __volatile__(
Expand All @@ -106,7 +106,7 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
" .set mips0 \n"
: "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter));
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
int temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -139,7 +139,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
int temp;

__asm__ __volatile__(
Expand All @@ -153,7 +153,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
int temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -191,7 +191,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
int temp;

__asm__ __volatile__(
Expand All @@ -205,7 +205,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
int temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -251,7 +251,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
int temp;

__asm__ __volatile__(
Expand All @@ -269,7 +269,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
int temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -428,7 +428,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
*/
static __inline__ void atomic64_add(long i, atomic64_t * v)
{
if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
long temp;

__asm__ __volatile__(
Expand All @@ -440,7 +440,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
" .set mips0 \n"
: "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter));
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
long temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -473,7 +473,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
*/
static __inline__ void atomic64_sub(long i, atomic64_t * v)
{
if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
long temp;

__asm__ __volatile__(
Expand All @@ -485,7 +485,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
" .set mips0 \n"
: "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter));
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
long temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -518,7 +518,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
long temp;

__asm__ __volatile__(
Expand All @@ -532,7 +532,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
long temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -570,7 +570,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
long temp;

__asm__ __volatile__(
Expand All @@ -584,7 +584,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
long temp;

__asm__ __volatile__(
Expand Down Expand Up @@ -630,7 +630,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
long temp;

__asm__ __volatile__(
Expand All @@ -648,7 +648,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
long temp;

__asm__ __volatile__(
Expand Down
34 changes: 17 additions & 17 deletions trunk/arch/mips/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
unsigned short bit = nr & SZLONG_MASK;
unsigned long temp;

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
__asm__ __volatile__(
" .set mips3 \n"
"1: " __LL "%0, %1 # set_bit \n"
Expand All @@ -72,7 +72,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << bit), "m" (*m));
#ifdef CONFIG_CPU_MIPSR2
} else if (__builtin_constant_p(bit)) {
} else if (kernel_uses_llsc && __builtin_constant_p(bit)) {
__asm__ __volatile__(
"1: " __LL "%0, %1 # set_bit \n"
" " __INS "%0, %4, %2, 1 \n"
Expand All @@ -84,7 +84,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
: "=&r" (temp), "=m" (*m)
: "ir" (bit), "m" (*m), "r" (~0));
#endif /* CONFIG_CPU_MIPSR2 */
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
__asm__ __volatile__(
" .set mips3 \n"
"1: " __LL "%0, %1 # set_bit \n"
Expand Down Expand Up @@ -126,7 +126,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
unsigned short bit = nr & SZLONG_MASK;
unsigned long temp;

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
__asm__ __volatile__(
" .set mips3 \n"
"1: " __LL "%0, %1 # clear_bit \n"
Expand All @@ -137,7 +137,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
: "=&r" (temp), "=m" (*m)
: "ir" (~(1UL << bit)), "m" (*m));
#ifdef CONFIG_CPU_MIPSR2
} else if (__builtin_constant_p(bit)) {
} else if (kernel_uses_llsc && __builtin_constant_p(bit)) {
__asm__ __volatile__(
"1: " __LL "%0, %1 # clear_bit \n"
" " __INS "%0, $0, %2, 1 \n"
Expand All @@ -149,7 +149,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
: "=&r" (temp), "=m" (*m)
: "ir" (bit), "m" (*m));
#endif /* CONFIG_CPU_MIPSR2 */
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
__asm__ __volatile__(
" .set mips3 \n"
"1: " __LL "%0, %1 # clear_bit \n"
Expand Down Expand Up @@ -202,7 +202,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned short bit = nr & SZLONG_MASK;

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand All @@ -215,7 +215,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
" .set mips0 \n"
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << bit), "m" (*m));
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand Down Expand Up @@ -260,7 +260,7 @@ static inline int test_and_set_bit(unsigned long nr,

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand All @@ -275,7 +275,7 @@ static inline int test_and_set_bit(unsigned long nr,
: "=&r" (temp), "=m" (*m), "=&r" (res)
: "r" (1UL << bit), "m" (*m)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand Down Expand Up @@ -328,7 +328,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
unsigned short bit = nr & SZLONG_MASK;
unsigned long res;

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand All @@ -343,7 +343,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
: "=&r" (temp), "=m" (*m), "=&r" (res)
: "r" (1UL << bit), "m" (*m)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand Down Expand Up @@ -397,7 +397,7 @@ static inline int test_and_clear_bit(unsigned long nr,

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand All @@ -414,7 +414,7 @@ static inline int test_and_clear_bit(unsigned long nr,
: "r" (1UL << bit), "m" (*m)
: "memory");
#ifdef CONFIG_CPU_MIPSR2
} else if (__builtin_constant_p(nr)) {
} else if (kernel_uses_llsc && __builtin_constant_p(nr)) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand All @@ -431,7 +431,7 @@ static inline int test_and_clear_bit(unsigned long nr,
: "ir" (bit), "m" (*m)
: "memory");
#endif
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand Down Expand Up @@ -487,7 +487,7 @@ static inline int test_and_change_bit(unsigned long nr,

smp_llsc_mb();

if (cpu_has_llsc && R10000_LLSC_WAR) {
if (kernel_uses_llsc && R10000_LLSC_WAR) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand All @@ -502,7 +502,7 @@ static inline int test_and_change_bit(unsigned long nr,
: "=&r" (temp), "=m" (*m), "=&r" (res)
: "r" (1UL << bit), "m" (*m)
: "memory");
} else if (cpu_has_llsc) {
} else if (kernel_uses_llsc) {
unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
unsigned long temp;

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
({ \
__typeof(*(m)) __ret; \
\
if (cpu_has_llsc && R10000_LLSC_WAR) { \
if (kernel_uses_llsc && R10000_LLSC_WAR) { \
__asm__ __volatile__( \
" .set push \n" \
" .set noat \n" \
Expand All @@ -33,7 +33,7 @@
: "=&r" (__ret), "=R" (*m) \
: "R" (*m), "Jr" (old), "Jr" (new) \
: "memory"); \
} else if (cpu_has_llsc) { \
} else if (kernel_uses_llsc) { \
__asm__ __volatile__( \
" .set push \n" \
" .set noat \n" \
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/mips/include/asm/cpu-features.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
#ifndef cpu_has_llsc
#define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC)
#endif
#ifndef kernel_uses_llsc
#define kernel_uses_llsc cpu_has_llsc
#endif
#ifndef cpu_has_mips16
#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16)
#endif
Expand Down
Loading

0 comments on commit 2454cd6

Please sign in to comment.