diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-01-27 22:06:57 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-02-09 16:56:13 -0600 |
commit | f6f3fbcab0c36f17ea63573ed4d21816a09c978e (patch) | |
tree | d7897bf389e87488f1365aefd5c0fdfc6f4d0fcc /cpu-common.h | |
parent | cca1af8c4d2ef6449fd61494ba2cb087b838011c (diff) | |
download | qemu-f6f3fbcab0c36f17ea63573ed4d21816a09c978e.zip qemu-f6f3fbcab0c36f17ea63573ed4d21816a09c978e.tar.gz qemu-f6f3fbcab0c36f17ea63573ed4d21816a09c978e.tar.bz2 |
qemu: memory notifiers
This adds notifiers for phys memory changes: a set of callbacks that
vhost can register and update kernel accordingly. Down the road, kvm
code can be switched to use these as well, instead of calling kvm code
directly from exec.c as is done now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'cpu-common.h')
-rw-r--r-- | cpu-common.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpu-common.h b/cpu-common.h index 6302372..0ec9b72 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -8,6 +8,7 @@ #endif #include "bswap.h" +#include "qemu-queue.h" /* address in the RAM (different from a physical address) */ typedef unsigned long ram_addr_t; @@ -61,6 +62,24 @@ void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len, void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque)); void cpu_unregister_map_client(void *cookie); +struct CPUPhysMemoryClient; +typedef struct CPUPhysMemoryClient CPUPhysMemoryClient; +struct CPUPhysMemoryClient { + void (*set_memory)(struct CPUPhysMemoryClient *client, + target_phys_addr_t start_addr, + ram_addr_t size, + ram_addr_t phys_offset); + int (*sync_dirty_bitmap)(struct CPUPhysMemoryClient *client, + target_phys_addr_t start_addr, + target_phys_addr_t end_addr); + int (*migration_log)(struct CPUPhysMemoryClient *client, + int enable); + QLIST_ENTRY(CPUPhysMemoryClient) list; +}; + +void cpu_register_phys_memory_client(CPUPhysMemoryClient *); +void cpu_unregister_phys_memory_client(CPUPhysMemoryClient *); + uint32_t ldub_phys(target_phys_addr_t addr); uint32_t lduw_phys(target_phys_addr_t addr); uint32_t ldl_phys(target_phys_addr_t addr); |