aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/bitops.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/bitops.h')
-rw-r--r--arch/s390/include/asm/bitops.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index e5beb490959b..a6ff5a83e227 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -13,8 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#ifdef __KERNEL__
17
18#ifndef _LINUX_BITOPS_H 16#ifndef _LINUX_BITOPS_H
19#error only <linux/bitops.h> can be included directly 17#error only <linux/bitops.h> can be included directly
20#endif 18#endif
@@ -63,7 +61,7 @@ extern const char _ni_bitmap[];
63extern const char _zb_findmap[]; 61extern const char _zb_findmap[];
64extern const char _sb_findmap[]; 62extern const char _sb_findmap[];
65 63
66#ifndef __s390x__ 64#ifndef CONFIG_64BIT
67 65
68#define __BITOPS_ALIGN 3 66#define __BITOPS_ALIGN 3
69#define __BITOPS_WORDSIZE 32 67#define __BITOPS_WORDSIZE 32
@@ -83,7 +81,7 @@ extern const char _sb_findmap[];
83 : "d" (__val), "Q" (*(unsigned long *) __addr) \ 81 : "d" (__val), "Q" (*(unsigned long *) __addr) \
84 : "cc"); 82 : "cc");
85 83
86#else /* __s390x__ */ 84#else /* CONFIG_64BIT */
87 85
88#define __BITOPS_ALIGN 7 86#define __BITOPS_ALIGN 7
89#define __BITOPS_WORDSIZE 64 87#define __BITOPS_WORDSIZE 64
@@ -103,7 +101,7 @@ extern const char _sb_findmap[];
103 : "d" (__val), "Q" (*(unsigned long *) __addr) \ 101 : "d" (__val), "Q" (*(unsigned long *) __addr) \
104 : "cc"); 102 : "cc");
105 103
106#endif /* __s390x__ */ 104#endif /* CONFIG_64BIT */
107 105
108#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) 106#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE)
109#define __BITOPS_BARRIER() asm volatile("" : : : "memory") 107#define __BITOPS_BARRIER() asm volatile("" : : : "memory")
@@ -412,7 +410,7 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr,
412 unsigned long bytes = 0; 410 unsigned long bytes = 0;
413 411
414 asm volatile( 412 asm volatile(
415#ifndef __s390x__ 413#ifndef CONFIG_64BIT
416 " ahi %1,-1\n" 414 " ahi %1,-1\n"
417 " sra %1,5\n" 415 " sra %1,5\n"
418 " jz 1f\n" 416 " jz 1f\n"
@@ -449,7 +447,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
449 unsigned long bytes = 0; 447 unsigned long bytes = 0;
450 448
451 asm volatile( 449 asm volatile(
452#ifndef __s390x__ 450#ifndef CONFIG_64BIT
453 " ahi %1,-1\n" 451 " ahi %1,-1\n"
454 " sra %1,5\n" 452 " sra %1,5\n"
455 " jz 1f\n" 453 " jz 1f\n"
@@ -481,7 +479,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
481 */ 479 */
482static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) 480static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
483{ 481{
484#ifdef __s390x__ 482#ifdef CONFIG_64BIT
485 if ((word & 0xffffffff) == 0xffffffff) { 483 if ((word & 0xffffffff) == 0xffffffff) {
486 word >>= 32; 484 word >>= 32;
487 nr += 32; 485 nr += 32;
@@ -505,7 +503,7 @@ static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
505 */ 503 */
506static inline unsigned long __ffs_word(unsigned long nr, unsigned long word) 504static inline unsigned long __ffs_word(unsigned long nr, unsigned long word)
507{ 505{
508#ifdef __s390x__ 506#ifdef CONFIG_64BIT
509 if ((word & 0xffffffff) == 0) { 507 if ((word & 0xffffffff) == 0) {
510 word >>= 32; 508 word >>= 32;
511 nr += 32; 509 nr += 32;
@@ -546,7 +544,7 @@ static inline unsigned long __load_ulong_le(const unsigned long *p,
546 unsigned long word; 544 unsigned long word;
547 545
548 p = (unsigned long *)((unsigned long) p + offset); 546 p = (unsigned long *)((unsigned long) p + offset);
549#ifndef __s390x__ 547#ifndef CONFIG_64BIT
550 asm volatile( 548 asm volatile(
551 " ic %0,%O1(%R1)\n" 549 " ic %0,%O1(%R1)\n"
552 " icm %0,2,%O1+1(%R1)\n" 550 " icm %0,2,%O1+1(%R1)\n"
@@ -834,7 +832,4 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
834 832
835#include <asm-generic/bitops/ext2-atomic-setbit.h> 833#include <asm-generic/bitops/ext2-atomic-setbit.h>
836 834
837
838#endif /* __KERNEL__ */
839
840#endif /* _S390_BITOPS_H */ 835#endif /* _S390_BITOPS_H */