diff options
Diffstat (limited to 'include/asm-mips/bitops.h')
-rw-r--r-- | include/asm-mips/bitops.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index d9e81af53f78..899357a72ac4 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -19,14 +19,14 @@ | |||
19 | #include <asm/sgidefs.h> | 19 | #include <asm/sgidefs.h> |
20 | #include <asm/war.h> | 20 | #include <asm/war.h> |
21 | 21 | ||
22 | #if (_MIPS_SZLONG == 32) | 22 | #if _MIPS_SZLONG == 32 |
23 | #define SZLONG_LOG 5 | 23 | #define SZLONG_LOG 5 |
24 | #define SZLONG_MASK 31UL | 24 | #define SZLONG_MASK 31UL |
25 | #define __LL "ll " | 25 | #define __LL "ll " |
26 | #define __SC "sc " | 26 | #define __SC "sc " |
27 | #define __INS "ins " | 27 | #define __INS "ins " |
28 | #define __EXT "ext " | 28 | #define __EXT "ext " |
29 | #elif (_MIPS_SZLONG == 64) | 29 | #elif _MIPS_SZLONG == 64 |
30 | #define SZLONG_LOG 6 | 30 | #define SZLONG_LOG 6 |
31 | #define SZLONG_MASK 63UL | 31 | #define SZLONG_MASK 63UL |
32 | #define __LL "lld " | 32 | #define __LL "lld " |
@@ -38,8 +38,8 @@ | |||
38 | /* | 38 | /* |
39 | * clear_bit() doesn't provide any barrier for the compiler. | 39 | * clear_bit() doesn't provide any barrier for the compiler. |
40 | */ | 40 | */ |
41 | #define smp_mb__before_clear_bit() smp_mb() | 41 | #define smp_mb__before_clear_bit() smp_llsc_mb() |
42 | #define smp_mb__after_clear_bit() smp_mb() | 42 | #define smp_mb__after_clear_bit() smp_llsc_mb() |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * set_bit - Atomically set a bit in memory | 45 | * set_bit - Atomically set a bit in memory |
@@ -289,7 +289,7 @@ static inline int test_and_set_bit(unsigned long nr, | |||
289 | raw_local_irq_restore(flags); | 289 | raw_local_irq_restore(flags); |
290 | } | 290 | } |
291 | 291 | ||
292 | smp_mb(); | 292 | smp_llsc_mb(); |
293 | 293 | ||
294 | return res != 0; | 294 | return res != 0; |
295 | } | 295 | } |
@@ -377,7 +377,7 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
377 | raw_local_irq_restore(flags); | 377 | raw_local_irq_restore(flags); |
378 | } | 378 | } |
379 | 379 | ||
380 | smp_mb(); | 380 | smp_llsc_mb(); |
381 | 381 | ||
382 | return res != 0; | 382 | return res != 0; |
383 | } | 383 | } |
@@ -445,7 +445,7 @@ static inline int test_and_change_bit(unsigned long nr, | |||
445 | raw_local_irq_restore(flags); | 445 | raw_local_irq_restore(flags); |
446 | } | 446 | } |
447 | 447 | ||
448 | smp_mb(); | 448 | smp_llsc_mb(); |
449 | 449 | ||
450 | return res != 0; | 450 | return res != 0; |
451 | } | 451 | } |
@@ -461,7 +461,7 @@ static inline int __ilog2(unsigned long x) | |||
461 | int lz; | 461 | int lz; |
462 | 462 | ||
463 | if (sizeof(x) == 4) { | 463 | if (sizeof(x) == 4) { |
464 | __asm__ ( | 464 | __asm__( |
465 | " .set push \n" | 465 | " .set push \n" |
466 | " .set mips32 \n" | 466 | " .set mips32 \n" |
467 | " clz %0, %1 \n" | 467 | " clz %0, %1 \n" |
@@ -474,7 +474,7 @@ static inline int __ilog2(unsigned long x) | |||
474 | 474 | ||
475 | BUG_ON(sizeof(x) != 8); | 475 | BUG_ON(sizeof(x) != 8); |
476 | 476 | ||
477 | __asm__ ( | 477 | __asm__( |
478 | " .set push \n" | 478 | " .set push \n" |
479 | " .set mips64 \n" | 479 | " .set mips64 \n" |
480 | " dclz %0, %1 \n" | 480 | " dclz %0, %1 \n" |
@@ -508,7 +508,7 @@ static inline unsigned long __ffs(unsigned long word) | |||
508 | */ | 508 | */ |
509 | static inline int fls(int word) | 509 | static inline int fls(int word) |
510 | { | 510 | { |
511 | __asm__ ("clz %0, %1" : "=r" (word) : "r" (word)); | 511 | __asm__("clz %0, %1" : "=r" (word) : "r" (word)); |
512 | 512 | ||
513 | return 32 - word; | 513 | return 32 - word; |
514 | } | 514 | } |
@@ -516,7 +516,7 @@ static inline int fls(int word) | |||
516 | #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPS64) | 516 | #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPS64) |
517 | static inline int fls64(__u64 word) | 517 | static inline int fls64(__u64 word) |
518 | { | 518 | { |
519 | __asm__ ("dclz %0, %1" : "=r" (word) : "r" (word)); | 519 | __asm__("dclz %0, %1" : "=r" (word) : "r" (word)); |
520 | 520 | ||
521 | return 64 - word; | 521 | return 64 - word; |
522 | } | 522 | } |