From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail01.miraclelinux.com (ns.miraclelinux.com [219.118.163.66]) by ozlabs.org (Postfix) with ESMTP id 8632167A2E for ; Tue, 14 Feb 2006 16:05:10 +1100 (EST) Message-Id: <20060214050443.852246000@localhost.localdomain> References: <20060214050351.252615000@localhost.localdomain> Date: Tue, 14 Feb 2006 14:04:02 +0900 From: Akinobu Mita To: linux-kernel@vger.kernel.org Subject: [patch 11/47] generic fls64() Cc: akpm@osdl.org, linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, Ian Molton , Andi Kleen , David Howells , linuxppc-dev@ozlabs.org, Greg Ungerer , sparclinux@vger.kernel.org, Miles Bader , Yoshinori Sato , Hirokazu Takata , linuxsh-shmedia-dev@lists.sourceforge.net, linux-m68k@lists.linux-m68k.org, Ivan Kokshaysky , Richard Henderson , Akinobu Mita , Chris Zankel , dev-etrax@axis.com, ultralinux@vger.kernel.org, Linus Torvalds , linuxsh-dev@lists.sourceforge.net, linux390@de.ibm.com, Russell King , parisc-linux@parisc-linux.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This patch introduces the C-language equivalent of the function: int fls64(__u64 x); In include/asm-generic/bitops/fls64.h This code largely copied from: include/linux/bitops.h Signed-off-by: Akinobu Mita include/asm-generic/bitops/fls64.h | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: 2.6-rc/include/asm-generic/bitops/fls64.h =================================================================== --- /dev/null +++ 2.6-rc/include/asm-generic/bitops/fls64.h @@ -0,0 +1,12 @@ +#ifndef _ASM_GENERIC_BITOPS_FLS64_H_ +#define _ASM_GENERIC_BITOPS_FLS64_H_ + +static inline int fls64(__u64 x) +{ + __u32 h = x >> 32; + if (h) + return fls(h) + 32; + return fls(x); +} + +#endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */ --