diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-04-11 15:40:59 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-29 16:27:16 +0200 |
commit | 51644ab70ba125cb9545702d64890743d75b444b (patch) | |
tree | 420c1b45d6556c81b04d532ca4a05202c069e341 /include/exec | |
parent | c353e4cc08a2fce7c505dd0d04512ef3947adff8 (diff) | |
download | qemu-51644ab70ba125cb9545702d64890743d75b444b.zip qemu-51644ab70ba125cb9545702d64890743d75b444b.tar.gz qemu-51644ab70ba125cb9545702d64890743d75b444b.tar.bz2 |
memory: add address_space_access_valid
The old-style IOMMU lets you check whether an access is valid in a
given DMAContext. There is no equivalent for AddressSpace in the
memory API, implement it with a lookup of the dispatch tree.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/exec')
-rw-r--r-- | include/exec/memory.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 688d3f0..81e0e41 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -866,6 +866,21 @@ MemoryRegionSection *address_space_translate(AddressSpace *as, hwaddr addr, hwaddr *xlat, hwaddr *len, bool is_write); +/* address_space_access_valid: check for validity of accessing an address + * space range + * + * Check whether memory is assigned to the given address space range. + * + * For now, addr and len should be aligned to a page size. This limitation + * will be lifted in the future. + * + * @as: #AddressSpace to be accessed + * @addr: address within that address space + * @len: length of the area to be checked + * @is_write: indicates the transfer direction + */ +bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write); + /* address_space_map: map a physical memory region into a host virtual address * * May map a subset of the requested range, given by and returned in @plen. |