diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2012-01-22 11:00:44 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-01-25 18:32:39 +0000 |
commit | 59abb06198ee9471e29c970f294eae80c0b39be1 (patch) | |
tree | b826244ff49f7be0166588390285a01643af58fc /exec-obsolete.h | |
parent | c5bd4f3d2ddf243565d94a5a16eafcb994c1524a (diff) | |
download | qemu-59abb06198ee9471e29c970f294eae80c0b39be1.zip qemu-59abb06198ee9471e29c970f294eae80c0b39be1.tar.gz qemu-59abb06198ee9471e29c970f294eae80c0b39be1.tar.bz2 |
memory: fix dirty mask function length handling
Fix handling of cases like start = 0xfff, length = 2.
Change length to ram_addr_t to handle larger lengths.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec-obsolete.h')
-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 c412be9..22e0ba5 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; } } |