mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
memory: Sync before doing a test and clear
This commit is contained in:
parent
3e5da78157
commit
4a6910f052
27
memory.c
27
memory.c
@ -2049,19 +2049,6 @@ void memory_region_set_client_dirty(MemoryRegion *mr, hwaddr addr,
|
|||||||
size, 1 << client);
|
size, 1 << client);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool memory_region_test_and_clear_dirty(MemoryRegion *mr, hwaddr addr,
|
|
||||||
hwaddr size, unsigned client)
|
|
||||||
{
|
|
||||||
if (mr->alias) {
|
|
||||||
return memory_region_test_and_clear_dirty(mr->alias,
|
|
||||||
addr - mr->alias_offset,
|
|
||||||
size, client);
|
|
||||||
}
|
|
||||||
assert(mr->terminates);
|
|
||||||
return cpu_physical_memory_test_and_clear_dirty(
|
|
||||||
memory_region_get_ram_addr(mr) + addr, size, client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
|
static void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
|
||||||
{
|
{
|
||||||
MemoryListener *listener;
|
MemoryListener *listener;
|
||||||
@ -2090,6 +2077,20 @@ static void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool memory_region_test_and_clear_dirty(MemoryRegion *mr, hwaddr addr,
|
||||||
|
hwaddr size, unsigned client)
|
||||||
|
{
|
||||||
|
if (mr->alias) {
|
||||||
|
return memory_region_test_and_clear_dirty(mr->alias,
|
||||||
|
addr - mr->alias_offset,
|
||||||
|
size, client);
|
||||||
|
}
|
||||||
|
assert(mr->terminates);
|
||||||
|
memory_region_sync_dirty_bitmap(mr);
|
||||||
|
return cpu_physical_memory_test_and_clear_dirty(
|
||||||
|
memory_region_get_ram_addr(mr) + addr, size, client);
|
||||||
|
}
|
||||||
|
|
||||||
void memory_region_clear_dirty_bitmap(MemoryRegion *mr, hwaddr start,
|
void memory_region_clear_dirty_bitmap(MemoryRegion *mr, hwaddr start,
|
||||||
hwaddr len)
|
hwaddr len)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user