memory: change dirty setting APIs to take a size

Instead of each target knowing or guessing the guest page size,
just pass the desired size of dirtied memory area.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-10-16 16:04:59 +00:00
parent 59abb06198
commit fd4aa97903
12 changed files with 48 additions and 48 deletions

View file

@ -76,6 +76,20 @@ static inline int cpu_physical_memory_set_dirty_flags(ram_addr_t addr,
return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags;
}
static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
ram_addr_t length,
int dirty_flags)
{
uint8_t *p;
ram_addr_t addr, end;
end = start + length;
p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
for (addr = start; addr <= end; addr += TARGET_PAGE_SIZE) {
*p++ |= dirty_flags;
}
}
static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start,
ram_addr_t length,
int dirty_flags)