qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5890] Revert "hw/apic.c: use fls() from host-utils"
Date: Sat, 06 Dec 2008 10:46:36 +0000	[thread overview]
Message-ID: <E1L8ugG-0006pT-14@cvs.savannah.gnu.org> (raw)

Revision: 5890
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5890
Author:   aurel32
Date:     2008-12-06 10:46:35 +0000 (Sat, 06 Dec 2008)

Log Message:
-----------
Revert "hw/apic.c: use fls() from host-utils"

This reverts commit 5876.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Modified Paths:
--------------
    trunk/hw/apic.c

Modified: trunk/hw/apic.c
===================================================================
--- trunk/hw/apic.c	2008-12-05 20:05:26 UTC (rev 5889)
+++ trunk/hw/apic.c	2008-12-06 10:46:35 UTC (rev 5890)
@@ -105,6 +105,12 @@
 static void apic_set_irq(APICState *s, int vector_num, int trigger_mode);
 static void apic_update_irq(APICState *s);
 
+/* Find first bit starting from msb */
+static int fls_bit(uint32_t value)
+{
+    return 31 - clz32(value);
+}
+
 /* Find first bit starting from lsb */
 static int ffs_bit(uint32_t value)
 {
@@ -300,7 +306,7 @@
     int i;
     for(i = 7; i >= 0; i--) {
         if (tab[i] != 0) {
-            return i * 32 + fls(tab[i]);
+            return i * 32 + fls_bit(tab[i]);
         }
     }
     return -1;

                 reply	other threads:[~2008-12-06 10:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1L8ugG-0006pT-14@cvs.savannah.gnu.org \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).