qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [PATCH] spapr: Fix spapr_populate_memory() to compile on wind


From: Alexey Kardashevskiy
Subject: [Qemu-ppc] [PATCH] spapr: Fix spapr_populate_memory() to compile on windows
Date: Mon, 8 Sep 2014 09:59:04 +1000

This replaces gcc's ffsl() function ("find first bit set in a word")
with QEMU's ctzl ("count trailing zeros"). There are no corner cases
in the affected code so simple replacement ffsl()-1 by ctzl() works.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
---
 hw/ppc/spapr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 4b20e36..2ab4460 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -705,8 +705,8 @@ static int spapr_populate_memory(sPAPREnvironment *spapr, 
void *fdt)
             hwaddr sizetmp = pow2floor(node_size);
 
             /* mem_start != 0 here */
-            if (ffsl(mem_start) < ffsl(sizetmp)) {
-                sizetmp = 1ULL << (ffsl(mem_start) - 1);
+            if (ctzl(mem_start) < ctzl(sizetmp)) {
+                sizetmp = 1ULL << ctzl(mem_start);
             }
 
             spapr_populate_memory_node(fdt, i, mem_start, sizetmp);
-- 
2.0.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]