Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932317AbWJFNek (ORCPT ); Fri, 6 Oct 2006 09:34:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932325AbWJFNek (ORCPT ); Fri, 6 Oct 2006 09:34:40 -0400 Received: from mx1.redhat.com ([66.187.233.31]:20898 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S932310AbWJFNei (ORCPT ); Fri, 6 Oct 2006 09:34:38 -0400 From: David Howells Subject: [PATCH 4/4] LOG2: Provide ilog2() fallbacks for powerpc [try #4] Date: Fri, 06 Oct 2006 14:34:22 +0100 To: torvalds@osdl.org, akpm@osdl.org, sfr@canb.auug.org.au Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, dhowells@redhat.com Message-Id: <20061006133422.9972.29416.stgit@warthog.cambridge.redhat.com> In-Reply-To: <20061006133414.9972.79007.stgit@warthog.cambridge.redhat.com> References: <20061006133414.9972.79007.stgit@warthog.cambridge.redhat.com> Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: 8bit User-Agent: StGIT/0.10 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2665 Lines: 96 From: David Howells Provide ilog2() fallbacks for powerpc for 32-bit numbers and 64-bit numbers on ppc64. Signed-Off-By: David Howells --- arch/powerpc/Kconfig | 4 ++-- include/asm-powerpc/bitops.h | 21 ++++++++++++++++++++- include/asm-powerpc/page_32.h | 10 +--------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 1cf67b7..9515489 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -43,11 +43,11 @@ config RWSEM_XCHGADD_ALGORITHM config ARCH_HAS_ILOG2_U32 bool - default n + default y config ARCH_HAS_ILOG2_U64 bool - default n + default y if 64BIT config GENERIC_HWEIGHT bool diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index c341063..0288144 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h @@ -190,7 +190,8 @@ #include > PAGE_SHIFT; - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); - return 32 - lz; -} +#include #endif /* __ASSEMBLY__ */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/