]> Git Repo - qemu.git/blobdiff - target-i386/topology.h
sd/sdhci:ADMA: fix interrupt
[qemu.git] / target-i386 / topology.h
index 24ed525453ed3c94242c44a17e9b660f66f58051..07a6c5fb559ffb1dda869b9671b89161e86a23bc 100644 (file)
@@ -52,10 +52,8 @@ typedef uint32_t apic_id_t;
 static unsigned apicid_bitwidth_for_count(unsigned count)
 {
     g_assert(count >= 1);
-    if (count == 1) {
-        return 0;
-    }
-    return bitops_flsl(count - 1) + 1;
+    count -= 1;
+    return count ? 32 - clz32(count) : 0;
 }
 
 /* Bit width of the SMT_ID (thread ID) field on the APIC ID
This page took 0.023664 seconds and 4 git commands to generate.