X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-m68knommu%2Fbitops.h;h=6f3685eab44c7f88818451d76599f934661a8785;hb=bdee6ac7d1c9a4a9b65db1753b0bfa0b61361dde;hp=b8b2770d6870965de40edcf112b405aadd2f881e;hpb=70180659a479b55387eca8cc1fa7024ba8410b14;p=linux-2.6 diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h index b8b2770d68..6f3685eab4 100644 --- a/include/asm-m68knommu/bitops.h +++ b/include/asm-m68knommu/bitops.h @@ -10,8 +10,42 @@ #ifdef __KERNEL__ +#ifndef _LINUX_BITOPS_H +#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 @@ -258,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++); @@ -290,6 +324,8 @@ found_middle: return result + ffz(__swab32(tmp)); } +#define ext2_find_next_bit(addr, size, off) \ + generic_find_next_le_bit((unsigned long *)(addr), (size), (off)) #include #endif /* __KERNEL__ */