mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
memory: introduce memory_region_present
This new API will avoid having too many memory_region_ref/unref in paths that currently use memory_region_find. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
46637be269
commit
3ce10901ca
4 changed files with 28 additions and 7 deletions
|
@ -836,6 +836,18 @@ void memory_region_set_address(MemoryRegion *mr, hwaddr addr);
|
|||
void memory_region_set_alias_offset(MemoryRegion *mr,
|
||||
hwaddr offset);
|
||||
|
||||
/**
|
||||
* memory_region_present: translate an address/size relative to a
|
||||
* MemoryRegion into a #MemoryRegionSection.
|
||||
*
|
||||
* Answer whether a #MemoryRegion within @parent covers the address
|
||||
* @addr.
|
||||
*
|
||||
* @parent: a MemoryRegion within which @addr is a relative address
|
||||
* @addr: the area within @parent to be searched
|
||||
*/
|
||||
bool memory_region_present(MemoryRegion *parent, hwaddr addr);
|
||||
|
||||
/**
|
||||
* memory_region_find: translate an address/size relative to a
|
||||
* MemoryRegion into a #MemoryRegionSection.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue