Message ID | 1429031053-4454-7-git-send-email-dgilbert@redhat.com |
---|---|
State | New |
Headers | show |
On (Tue) 14 Apr 2015 [18:03:32], Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com> > > 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 arch_init. > > 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 <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Amit
diff --git a/exec.c b/exec.c index 7693794..c3027cf 100644 --- a/exec.c +++ b/exec.c @@ -3038,6 +3038,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 7a1ea91..bd67f86 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -68,6 +68,7 @@ int qemu_reset_requested_get(void); void qemu_system_killed(int signal, pid_t pid); void qemu_devices_reset(void); void qemu_system_reset(bool report); +size_t qemu_target_page_bits(void); void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify);