From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5876] hw/apic.c: use fls() from host-utils
Date: Thu, 04 Dec 2008 20:57:02 +0000 [thread overview]
Message-ID: <E1L8LFu-0000Qp-Qj@cvs.savannah.gnu.org> (raw)
Revision: 5876
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5876
Author: aurel32
Date: 2008-12-04 20:57:02 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
hw/apic.c: use fls() from host-utils
...and fix a bug, the implementation in hw/apic.c was wrong.
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-04 20:35:16 UTC (rev 5875)
+++ trunk/hw/apic.c 2008-12-04 20:57:02 UTC (rev 5876)
@@ -105,12 +105,6 @@
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)
{
@@ -306,7 +300,7 @@
int i;
for(i = 7; i >= 0; i--) {
if (tab[i] != 0) {
- return i * 32 + fls_bit(tab[i]);
+ return i * 32 + fls(tab[i]);
}
}
return -1;
next reply other threads:[~2008-12-04 20:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 20:57 Aurelien Jarno [this message]
2008-12-05 20:39 ` [Qemu-devel] [5876] hw/apic.c: use fls() from host-utils Anthony Liguori
2008-12-06 10:48 ` Andreas Färber
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=E1L8LFu-0000Qp-Qj@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).