From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujXQ-0004o1-BH for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WujXP-0008J0-9l for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:04 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujXP-0008DN-3j for qemu-devel@nongnu.org; Wed, 11 Jun 2014 10:30:03 -0400 From: Peter Maydell Date: Wed, 11 Jun 2014 15:29:45 +0100 Message-Id: <1402496993-27206-8-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1402496993-27206-1-git-send-email-peter.maydell@linaro.org> References: <1402496993-27206-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 07/15] exec: replace ffsl with ctzl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl From: Natanael Copa 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 Reviewed-by: Paolo Bonzini Signed-off-by: Peter Maydell --- include/exec/ram_addr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 2edfa96..b94de02 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; -- 1.9.2