diff options
-rw-r--r-- | exec-obsolete.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/exec-obsolete.h b/exec-obsolete.h index c412be95e0..22e0ba5cd7 100644 --- a/exec-obsolete.h +++ b/exec-obsolete.h @@ -77,17 +77,18 @@ static inline int cpu_physical_memory_set_dirty_flags(ram_addr_t addr, } static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start, - int length, + ram_addr_t length, int dirty_flags) { - int i, mask, len; + int mask; uint8_t *p; + ram_addr_t addr, end; - len = length >> TARGET_PAGE_BITS; + end = start + length; mask = ~dirty_flags; p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS); - for (i = 0; i < len; i++) { - p[i] &= mask; + for (addr = start; addr <= end; addr += TARGET_PAGE_SIZE) { + *p++ &= mask; } } |