mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
memory: add memory_region_flush_rom_device()
ROM devices go via MemoryRegionOps->write() callbacks for write operations and do not dirty/invalidate that memory. Device emulation must be able to mark memory ranges that have been modified internally (e.g. using memory_region_get_ram_ptr()). Introduce the memory_region_flush_rom_device() API for this purpose. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190123212234.32068-2-stefanha@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: fix block comment style] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
bf8d09694c
commit
047be4ed24
2 changed files with 31 additions and 0 deletions
|
@ -1344,6 +1344,24 @@ bool memory_region_snapshot_get_dirty(MemoryRegion *mr,
|
|||
void memory_region_reset_dirty(MemoryRegion *mr, hwaddr addr,
|
||||
hwaddr size, unsigned client);
|
||||
|
||||
/**
|
||||
* memory_region_flush_rom_device: Mark a range of pages dirty and invalidate
|
||||
* TBs (for self-modifying code).
|
||||
*
|
||||
* The MemoryRegionOps->write() callback of a ROM device must use this function
|
||||
* to mark byte ranges that have been modified internally, such as by directly
|
||||
* accessing the memory returned by memory_region_get_ram_ptr().
|
||||
*
|
||||
* This function marks the range dirty and invalidates TBs so that TCG can
|
||||
* detect self-modifying code.
|
||||
*
|
||||
* @mr: the region being flushed.
|
||||
* @addr: the start, relative to the start of the region, of the range being
|
||||
* flushed.
|
||||
* @size: the size, in bytes, of the range being flushed.
|
||||
*/
|
||||
void memory_region_flush_rom_device(MemoryRegion *mr, hwaddr addr, hwaddr size);
|
||||
|
||||
/**
|
||||
* memory_region_set_readonly: Turn a memory region read-only (or read-write)
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue