X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-s390%2Fbitops.h;h=16bb08499c7ff0d20b2a81d2a6eac3b471e51f2a;hb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;hp=f714d9e83972b1322709b2bf9e5bd57174d63fa6;hpb=c449269f45c2cdf53af08c8d0af37472f66539d9;p=linux-2.6.git diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index f714d9e83..16bb08499 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h @@ -110,6 +110,7 @@ extern const char _sb_findmap[]; #endif /* __s390x__ */ +#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) #define __BITOPS_BARRIER() __asm__ __volatile__ ( "" : : : "memory" ) #ifdef CONFIG_SMP @@ -534,6 +535,7 @@ __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) { static inline int find_first_zero_bit(const unsigned long * addr, unsigned int size) { + typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; unsigned long cmp, count; unsigned int res; @@ -566,13 +568,15 @@ find_first_zero_bit(const unsigned long * addr, unsigned int size) " alr %0,%2\n" "4:" : "=&a" (res), "=&d" (cmp), "=&a" (count) - : "a" (size), "a" (addr), "a" (&_zb_findmap) : "cc" ); + : "a" (size), "a" (addr), "a" (&_zb_findmap), + "m" (*(addrtype *) addr) : "cc" ); return (res < size) ? res : size; } static inline int find_first_bit(const unsigned long * addr, unsigned int size) { + typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; unsigned long cmp, count; unsigned int res; @@ -605,7 +609,8 @@ find_first_bit(const unsigned long * addr, unsigned int size) " alr %0,%2\n" "4:" : "=&a" (res), "=&d" (cmp), "=&a" (count) - : "a" (size), "a" (addr), "a" (&_sb_findmap) : "cc" ); + : "a" (size), "a" (addr), "a" (&_sb_findmap), + "m" (*(addrtype *) addr) : "cc" ); return (res < size) ? res : size; } @@ -695,6 +700,7 @@ find_next_bit (const unsigned long * addr, int size, int offset) static inline unsigned long find_first_zero_bit(const unsigned long * addr, unsigned long size) { + typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; unsigned long res, cmp, count; if (!size) @@ -730,13 +736,15 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size) " algr %0,%2\n" "5:" : "=&a" (res), "=&d" (cmp), "=&a" (count) - : "a" (size), "a" (addr), "a" (&_zb_findmap) : "cc" ); + : "a" (size), "a" (addr), "a" (&_zb_findmap), + "m" (*(addrtype *) addr) : "cc" ); return (res < size) ? res : size; } static inline unsigned long find_first_bit(const unsigned long * addr, unsigned long size) { + typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; unsigned long res, cmp, count; if (!size) @@ -772,7 +780,8 @@ find_first_bit(const unsigned long * addr, unsigned long size) " algr %0,%2\n" "5:" : "=&a" (res), "=&d" (cmp), "=&a" (count) - : "a" (size), "a" (addr), "a" (&_sb_findmap) : "cc" ); + : "a" (size), "a" (addr), "a" (&_sb_findmap), + "m" (*(addrtype *) addr) : "cc" ); return (res < size) ? res : size; } @@ -983,6 +992,7 @@ static inline int sched_find_first_bit(unsigned long *b) static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size) { + typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; unsigned long cmp, count; unsigned int res; @@ -1016,7 +1026,8 @@ ext2_find_first_zero_bit(void *vaddr, unsigned int size) " alr %0,%2\n" "4:" : "=&a" (res), "=&d" (cmp), "=&a" (count) - : "a" (size), "a" (vaddr), "a" (&_zb_findmap) : "cc" ); + : "a" (size), "a" (vaddr), "a" (&_zb_findmap), + "m" (*(addrtype *) vaddr) : "cc" ); return (res < size) ? res : size; } @@ -1068,6 +1079,7 @@ ext2_find_next_zero_bit(void *vaddr, unsigned int size, unsigned offset) static inline unsigned long ext2_find_first_zero_bit(void *vaddr, unsigned long size) { + typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; unsigned long res, cmp, count; if (!size) @@ -1103,7 +1115,8 @@ ext2_find_first_zero_bit(void *vaddr, unsigned long size) " algr %0,%2\n" "5:" : "=&a" (res), "=&d" (cmp), "=&a" (count) - : "a" (size), "a" (vaddr), "a" (&_zb_findmap) : "cc" ); + : "a" (size), "a" (vaddr), "a" (&_zb_findmap), + "m" (*(addrtype *) vaddr) : "cc" ); return (res < size) ? res : size; }