Re: [PATCH] m68k: merge mmu and non-mmu bitops.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





+#if defined(CONFIG_M68000) || defined(CONFIG_MCPU32) || defined(CONFIG_COLDFIRE)
+
+/*
+ *     The newer ColdFire family members support a "bitrev" instruction
+ *     and we can use that to implement a fast ffs. Older Coldfire parts,
+ *     and normal 68000 parts don't have anything special, so we use the
+ *     generic functions for those.
+ */
+#if (defined(__mcfisaaplus__) || defined(__mcfisac__)) && \
+    !defined(CONFIG_M68000) && !defined(CONFIG_MCPU32)

Aren't the !defined(CONFIG_M68000) && !defined(CONFIG_MCPU32) terms 
redundant?

Finn

+static inline int __ffs(int x)
+{
+        __asm__ __volatile__ ("bitrev %0; ff1 %0"
+               : "=d" (x)
+               : "0" (x));
+        return x;
+}
+
+static inline int ffs(int x)
+{
+        if (!x)
+                return 0;
+       return __ffs(x) + 1;
+}
+
+#else
+#include <asm-generic/bitops/ffs.h>
+#include <asm-generic/bitops/__ffs.h>
+#endif
+
+#include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
+
 #else

--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux