aboutsummaryrefslogtreecommitdiff
path: root/exec-obsolete.h
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2012-01-22 16:38:21 +0000
committerBlue Swirl <blauwirbel@gmail.com>2012-02-04 12:45:10 +0000
commitcd7a45c95ecf2404810f3c6becb7cb83c5010ad8 (patch)
tree49d6bedd8bf8267333293bfc5217687d3175b82c /exec-obsolete.h
parentcb437e48ab7ddd9b85843beb524904ee4b565721 (diff)
memory: change dirty getting API to take a size
Instead of each device knowing or guessing the guest page size, just pass the desired size of dirtied memory area. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec-obsolete.h')
-rw-r--r--exec-obsolete.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/exec-obsolete.h b/exec-obsolete.h
index d2749d36fa..94c23d0951 100644
--- a/exec-obsolete.h
+++ b/exec-obsolete.h
@@ -59,10 +59,21 @@ static inline int cpu_physical_memory_get_dirty_flags(ram_addr_t addr)
return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS];
}
-static inline int cpu_physical_memory_get_dirty(ram_addr_t addr,
+static inline int cpu_physical_memory_get_dirty(ram_addr_t start,
+ ram_addr_t length,
int dirty_flags)
{
- return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] & dirty_flags;
+ int ret = 0;
+ uint8_t *p;
+ ram_addr_t addr, end;
+
+ end = TARGET_PAGE_ALIGN(start + length);
+ start &= TARGET_PAGE_MASK;
+ p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
+ for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
+ ret |= *p++ & dirty_flags;
+ }
+ return ret;
}
static inline void cpu_physical_memory_set_dirty(ram_addr_t addr)