From patchwork Sun Apr 29 12:00:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 155731 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1401BB6FDC for ; Sun, 29 Apr 2012 22:03:46 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C55128308; Sun, 29 Apr 2012 14:03:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EJkOTVNyhr+f; Sun, 29 Apr 2012 14:03:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D3E5928319; Sun, 29 Apr 2012 14:02:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF8D92829A for ; Sun, 29 Apr 2012 14:02:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e5YnXhGv1X7p for ; Sun, 29 Apr 2012 14:02:30 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 6DE5E2828A for ; Sun, 29 Apr 2012 14:02:19 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id rp16so2277367pbb.3 for ; Sun, 29 Apr 2012 05:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=8h4IHjj4wO1oVbktlq6IyjZ/ZsxaWOOshS4+YIhZmCs=; b=idxzqU22WNvBGs75hz2ImE3rvgGTk1D+jgDEHXZCkBs5do/lplzKkMbwvNLg/7XoQ7 2/PoEe/Cv24kZlR7af2hvK38u0//ojj9YSEeOpNhrTLa0LrAI8DbCvzKJzFbH494Oa1C wuCu/2+iXiTEMFLiT+5VQWG+1XXoX90mHRzCgpv0sttB4D+ktRNirOvusPgfnp3W0vaa qk+l3wgNE4oGmcSNsM/fX0dCjyKH8EnJOHW3rDEfaeF65PvhbQrNZfZMckHOpRIbn9pw 9bzcAId1EsW/1kNsTiTXAuKtnmoi8XFD+rnyYPwXl725pWur3tBPTNSMkLEHz2Uq5Upi FSTw== Received: by 10.68.200.68 with SMTP id jq4mr11386633pbc.42.1335700939693; Sun, 29 Apr 2012 05:02:19 -0700 (PDT) Received: from dingo.localhost (d58-106-86-244.sbr801.nsw.optusnet.com.au. [58.106.86.244]) by mx.google.com with ESMTPS id pk5sm2625515pbb.68.2012.04.29.05.02.17 (version=SSLv3 cipher=OTHER); Sun, 29 Apr 2012 05:02:19 -0700 (PDT) From: Graeme Russ To: u-boot@lists.denx.de Date: Sun, 29 Apr 2012 22:00:23 +1000 Message-Id: <1335700823-15144-6-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1335700823-15144-1-git-send-email-graeme.russ@gmail.com> References: <1335700823-15144-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH 5/5] x86: Add ilog2 to bitops X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de ilog2 is required by AHCI driver Signed-off-by: Graeme Russ --- arch/x86/include/asm/bitops.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index c7a38f2..5a7e4cb 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h @@ -351,6 +351,11 @@ static __inline__ int ffs(int x) } #define PLATFORM_FFS +static inline int __ilog2(unsigned int x) +{ + return generic_fls(x) - 1; +} + /** * hweightN - returns the hamming weight of a N-bit word * @x: the word to weigh