]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-s390/bitops.h
ihex: Add support for long records to ihex2fw.c
[linux-2.6-omap-h63xx.git] / include / asm-s390 / bitops.h
index 882db054110cbe9f8c7487e6dfe89cdc0647776e..b4eb24ab5af97811e5a0ca1845607de238210863 100644 (file)
@@ -456,23 +456,25 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr,
 
        asm volatile(
 #ifndef __s390x__
-               "       ahi     %1,31\n"
-               "       srl     %1,5\n"
+               "       ahi     %1,-1\n"
+               "       sra     %1,5\n"
+               "       jz      1f\n"
                "0:     c       %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,4(%0)\n"
                "       brct    %1,0b\n"
                "1:\n"
 #else
-               "       aghi    %1,63\n"
-               "       srlg    %1,%1,6\n"
+               "       aghi    %1,-1\n"
+               "       srag    %1,%1,6\n"
+               "       jz      1f\n"
                "0:     cg      %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,8(%0)\n"
                "       brct    %1,0b\n"
                "1:\n"
 #endif
-               : "+a" (bytes), "+d" (size)
+               : "+&a" (bytes), "+&d" (size)
                : "d" (-1UL), "a" (addr), "m" (*(addrtype *) addr)
                : "cc" );
        return bytes;
@@ -491,23 +493,25 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
 
        asm volatile(
 #ifndef __s390x__
-               "       ahi     %1,31\n"
-               "       srl     %1,5\n"
+               "       ahi     %1,-1\n"
+               "       sra     %1,5\n"
+               "       jz      1f\n"
                "0:     c       %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,4(%0)\n"
                "       brct    %1,0b\n"
                "1:\n"
 #else
-               "       aghi    %1,63\n"
-               "       srlg    %1,%1,6\n"
+               "       aghi    %1,-1\n"
+               "       srag    %1,%1,6\n"
+               "       jz      1f\n"
                "0:     cg      %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,8(%0)\n"
                "       brct    %1,0b\n"
                "1:\n"
 #endif
-               : "+a" (bytes), "+a" (size)
+               : "+&a" (bytes), "+&a" (size)
                : "d" (0UL), "a" (addr), "m" (*(addrtype *) addr)
                : "cc" );
        return bytes;
@@ -765,6 +769,7 @@ static inline int sched_find_first_bit(unsigned long *b)
 }
 
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 
 #include <asm-generic/bitops/hweight.h>