From 2b10808539d7ace3d9b1226a71a68e2431ef2176 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 3 Apr 2018 15:05:45 +1000 Subject: Add host_memory_backend_pagesize() helper There are a couple places (one generic, one target specific) where we need to get the host page size associated with a particular memory backend. I have some upcoming code which will add another place which wants this. So, for convenience, add a helper function to calculate this. host_memory_backend_pagesize() returns the host pagesize for a given HostMemoryBackend object. Signed-off-by: David Gibson Reviewed-by: Greg Kurz Acked-by: Paolo Bonzini --- include/sysemu/hostmem.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sysemu/hostmem.h') diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 47bc9846ac..bc36899bb8 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -68,4 +68,6 @@ MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend, void host_memory_backend_set_mapped(HostMemoryBackend *backend, bool mapped); bool host_memory_backend_is_mapped(HostMemoryBackend *backend); +size_t host_memory_backend_pagesize(HostMemoryBackend *memdev); + #endif -- cgit v1.2.3