projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf9298b
)
Revert "hw/apic.c: use fls() from host-utils"
author
aurel32
<aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 6 Dec 2008 10:46:35 +0000
(10:46 +0000)
committer
aurel32
<aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 6 Dec 2008 10:46:35 +0000
(10:46 +0000)
This reverts commit 5876.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5890
c046a42c
-6fe2-441c-8c8c-
71466251a162
hw/apic.c
patch
|
blob
|
history
diff --git
a/hw/apic.c
b/hw/apic.c
index 626f72fd0e80cf11604a769b70f4161eb573ab1a..a2915f81211a8413d36d2eca2459e635f81f8140 100644
(file)
--- a/
hw/apic.c
+++ b/
hw/apic.c
@@
-105,6
+105,12
@@
static void apic_init_ipi(APICState *s);
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
@@
static int get_highest_priority_int(uint32_t *tab)
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;