Anthony Liguori wrote:
This could correspond to a:
void *cpu_physical_memory_map(target_phys_addr_t addr, ram_addr_t
size, int is_write);
void cpu_physical_memory_unmap(target_physical_addr_t addr,
ram_addr_t size, void *mapping, int is_dirty);
A really nice touch here, and note this is optional and can be a
follow up series later, would be to use the mapping itself to encode
the physical address and size so the signatures were:
void *cpu_physical_memory_map(target_phys_addr_t addr, ram_addr_t
size, int flags);
void cpu_physical_memory_unmap(void *mapping);
flags could be PHYS_MAP_READ and/or PHYS_MAP_WRITE.
In unmap, you could check to see if the address is in phys_ram_base
... phys_ram_size. If so, you can get the physical address.
If you maintained a list of mappings, you could then search the list
of mappings based on the physical address and check the flags to see
if a flush was required.