[U-Boot] [PATCH 04/13] include: Add ffs64 header file

Fabio Estevam festevam at gmail.com
Sat Oct 24 14:28:04 CEST 2015


From: Fabio Estevam <fabio.estevam at freescale.com>

The ffs64() implementation for powerpc is not found in the Linux kernel,
so use the ffs64 header file from barebox.

Imported from barebox v2015.10.0.

Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
 arch/powerpc/include/asm/ffs64.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 arch/powerpc/include/asm/ffs64.h

diff --git a/arch/powerpc/include/asm/ffs64.h b/arch/powerpc/include/asm/ffs64.h
new file mode 100644
index 0000000..620874c
--- /dev/null
+++ b/arch/powerpc/include/asm/ffs64.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2013 GE Intelligent Platforms, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ */
+#include <linux/log2.h>
+
+static inline int ffs64(u64 x)
+{
+	return __ilog2_u64(x & -x) + 1ull;
+}
-- 
1.9.1



More information about the U-Boot mailing list