From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvqFg-0002gb-K7 for qemu-devel@nongnu.org; Mon, 09 Nov 2015 12:29:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvqFf-0004bg-Lo for qemu-devel@nongnu.org; Mon, 09 Nov 2015 12:29:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvqFf-0004bc-HJ for qemu-devel@nongnu.org; Mon, 09 Nov 2015 12:29:07 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 47E9CC0B60FA for ; Mon, 9 Nov 2015 17:29:07 +0000 (UTC) From: Juan Quintela Date: Mon, 9 Nov 2015 18:28:06 +0100 Message-Id: <1447090141-29074-3-git-send-email-quintela@redhat.com> In-Reply-To: <1447090141-29074-1-git-send-email-quintela@redhat.com> References: <1447090141-29074-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