diff options
author | David 'Digit' Turner <digit@android.com> | 2011-05-11 17:37:44 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-06-01 17:08:19 +0200 |
commit | 280afa072a7b829e581d884c2b3276530a6014b7 (patch) | |
tree | 6f1f213d66db8a5f89994bdfda7c9cd24140ffeb /cpu-common.h | |
parent | ae3098a3bce898cf958a6c3334f3d62282b12d2a (diff) | |
download | external_qemu-280afa072a7b829e581d884c2b3276530a6014b7.zip external_qemu-280afa072a7b829e581d884c2b3276530a6014b7.tar.gz external_qemu-280afa072a7b829e581d884c2b3276530a6014b7.tar.bz2 |
ramblocks: integrate upstream implementation (sophisticated)
Change-Id: I49e96e2d5ae571849b0b6fef0a30b41ecdee8d23
Diffstat (limited to 'cpu-common.h')
-rw-r--r-- | cpu-common.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/cpu-common.h b/cpu-common.h index a422689..9e32177 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -28,10 +28,21 @@ typedef unsigned long ram_addr_t; typedef void CPUWriteMemoryFunc(void *opaque, target_phys_addr_t addr, uint32_t value); typedef uint32_t CPUReadMemoryFunc(void *opaque, target_phys_addr_t addr); -void cpu_register_physical_memory_offset(target_phys_addr_t start_addr, +void cpu_register_physical_memory_log(target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t phys_offset, - ram_addr_t region_offset); + ram_addr_t region_offset, + bool log_dirty); + +static inline void cpu_register_physical_memory_offset(target_phys_addr_t start_addr, + ram_addr_t size, + ram_addr_t phys_offset, + ram_addr_t region_offset) +{ + cpu_register_physical_memory_log(start_addr, size, phys_offset, + region_offset, false); +} + static inline void cpu_register_physical_memory(target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t phys_offset) @@ -40,12 +51,19 @@ static inline void cpu_register_physical_memory(target_phys_addr_t start_addr, } ram_addr_t cpu_get_physical_page_desc(target_phys_addr_t addr); -ram_addr_t qemu_ram_alloc(ram_addr_t); +ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name, + ram_addr_t size, void *host); +ram_addr_t qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size); void qemu_ram_free(ram_addr_t addr); +void qemu_ram_remap(ram_addr_t addr, ram_addr_t length); /* This should only be used for ram local to a device. */ void *qemu_get_ram_ptr(ram_addr_t addr); +/* Same but slower, to use for migration, where the order of + * RAMBlocks must not change. */ +void *qemu_safe_ram_ptr(ram_addr_t addr); /* This should not be used by devices. */ -ram_addr_t qemu_ram_addr_from_host(void *ptr); +int qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr); +ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr); int cpu_register_io_memory(CPUReadMemoryFunc * const *mem_read, CPUWriteMemoryFunc * const *mem_write, |