aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-29 16:17:30 +0200
committerPeter Maydell <peter.maydell@linaro.org>2014-06-05 20:04:29 +0100
commitaaf088b9826c33159f138b56b56679490864913a (patch)
treef5f63d9416792a4ac884988cecc476a8b1807c4d
parent91b0e2854b6e8671ae07eae3732018ddc15e7c0d (diff)
downloadqemu-arm-aaf088b9826c33159f138b56b56679490864913a.tar.gz
exec: replace ffsl with ctzl
See commit fbeadf50 (bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl) on why ctzl should be used instead of ffsl. This is also needed for musl libc which does not implement ffsl. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--include/exec/ram_addr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 2edfa96c6d..b94de02ea7 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -117,7 +117,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap,
if (bitmap[i] != 0) {
c = leul_to_cpu(bitmap[i]);
do {
- j = ffsl(c) - 1;
+ j = ctzl(c);
c &= ~(1ul << j);
page_number = (i * HOST_LONG_BITS + j) * hpratio;
addr = page_number * TARGET_PAGE_SIZE;