X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-m68knommu%2Fbitops.h;h=6f3685eab44c7f88818451d76599f934661a8785;hb=e872504b311cec52f7a316a0037fb959080dbea0;hp=f43afe1fc3b33940dc1c46178045830f4bf01b44;hpb=aa02ad67d9b308290fde390682cd039b29f7ab85;p=linux-2.6 diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h index f43afe1fc3..6f3685eab4 100644 --- a/include/asm-m68knommu/bitops.h +++ b/include/asm-m68knommu/bitops.h @@ -14,8 +14,38 @@ #error only can be included directly #endif +#if defined (__mcfisaaplus__) || defined (__mcfisac__) +static inline int ffs(unsigned int val) +{ + if (!val) + return 0; + + asm volatile( + "bitrev %0\n\t" + "ff1 %0\n\t" + : "=d" (val) + : "0" (val) + ); + val++; + return val; +} + +static inline int __ffs(unsigned int val) +{ + asm volatile( + "bitrev %0\n\t" + "ff1 %0\n\t" + : "=d" (val) + : "0" (val) + ); + return val; +} + +#else #include #include +#endif + #include #include @@ -262,7 +292,7 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon * tmp = __swab32(*(p++)); * tmp |= ~0UL >> (32-offset); * - * but this would decrease preformance, so we change the + * but this would decrease performance, so we change the * shift: */ tmp = *(p++);