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>
This commit is contained in:
parent
c5bd4f3d2d
commit
59abb06198
|
@ -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,
|
static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start,
|
||||||
int length,
|
ram_addr_t length,
|
||||||
int dirty_flags)
|
int dirty_flags)
|
||||||
{
|
{
|
||||||
int i, mask, len;
|
int mask;
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
|
ram_addr_t addr, end;
|
||||||
|
|
||||||
len = length >> TARGET_PAGE_BITS;
|
end = start + length;
|
||||||
mask = ~dirty_flags;
|
mask = ~dirty_flags;
|
||||||
p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
|
p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
|
||||||
for (i = 0; i < len; i++) {
|
for (addr = start; addr <= end; addr += TARGET_PAGE_SIZE) {
|
||||||
p[i] &= mask;
|
*p++ &= mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue