From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw9ru-0002tC-1R for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:25:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zw9rt-0000fe-9h for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:25:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw9rt-0000fL-0W for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:25:53 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D547DC0AE67D for ; Tue, 10 Nov 2015 14:25:51 +0000 (UTC) From: Juan Quintela Date: Tue, 10 Nov 2015 15:24:51 +0100 Message-Id: <1447165546-27784-3-git-send-email-quintela@redhat.com> In-Reply-To: <1447165546-27784-1-git-send-email-quintela@redhat.com> References: <1447165546-27784-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PULL 02/57] Provide runtime Target page information List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, dgilbert@redhat.com From: "Dr. David Alan Gilbert" The migration code generally is built target-independent, however there are a few places where knowing the target page size would avoid artificially moving stuff into migration/ram.c. Provide 'qemu_target_page_bits()' that returns TARGET_PAGE_BITS to other bits of code so that they can stay target-independent. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- exec.c | 10 ++++++++++ include/sysemu/sysemu.h | 1 + 2 files changed, 11 insertions(+) diff --git a/exec.c b/exec.c index a028961..4ced1a6 100644 --- a/exec.c +++ b/exec.c @@ -3502,6 +3502,16 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, } return 0; } + +/* + * Allows code that needs to deal with migration bitmaps etc to still be built + * target independent. + */ +size_t qemu_target_page_bits(void) +{ + return TARGET_PAGE_BITS; +} + #endif /* diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 5cb0f05..8dc2add 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -70,6 +70,7 @@ void qemu_system_killed(int signal, pid_t pid); void qemu_devices_reset(void); void qemu_system_reset(bool report); void qemu_system_guest_panicked(void); +size_t qemu_target_page_bits(void); void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); -- 2.5.0