Skip to content

Commit

Permalink
exec: replace ffsl with ctzl
Browse files Browse the repository at this point in the history
See commit fbeadf5 (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>
  • Loading branch information
ncopa authored and pm215 committed Jun 10, 2014
1 parent 747eb78 commit 7224f66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/exec/ram_addr.h
Expand Up @@ -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;
Expand Down

0 comments on commit 7224f66

Please sign in to comment.