class VmAddressRegion
Defined at line 631 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
A representation of a contiguous range of virtual address space
Public Methods
zx_status_t CreateRootLocked (VmAspace & aspace, uint32_t vmar_flags, fbl::RefPtr<VmAddressRegion> * out)
Creates a root region. This will span the entire aspace
Defined at line 73 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t CreateSubVmar (size_t offset, size_t size, uint8_t align_pow2, uint32_t vmar_flags, const char * name, fbl::RefPtr<VmAddressRegion> * out)
Creates a subregion of this region
Defined at line 265 of file ../../zircon/kernel/vm/vm_address_region.cc
zx::result<MapResult> CreateVmMapping (size_t mapping_offset, size_t size, uint8_t align_pow2, uint32_t vmar_flags, fbl::RefPtr<VmObject> vmo, uint64_t vmo_offset, uint arch_mmu_flags, const char * name)
Defined at line 291 of file ../../zircon/kernel/vm/vm_address_region.cc
fbl::RefPtr<VmAddressRegionOrMapping> FindRegion (vaddr_t addr)
Finds the child region that contains the given addr. If addr is in a gap,
returns nullptr. This is a non-recursive search.
Defined at line 442 of file ../../zircon/kernel/vm/vm_address_region.cc
fbl::RefPtr<VmAddressRegionOrMapping> FindRegionLocked (vaddr_t addr)
Defined at line 447 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t SetMemoryPriorityLocked (MemoryPriority priority)
Applies the given memory priority to this VMAR, which may or may not result in a change. Up to
the derived type to know how to apply and update the |memory_priority_| field.
Defined at line 1282 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t RangeOp (RangeOpType op, vaddr_t base, size_t len, VmAddressRegionOpChildren op_children, user_inout_ptr<void> buffer, size_t buffer_size)
Apply |op| to VMO mappings in the specified range of pages.
Defined at line 661 of file ../../zircon/kernel/vm/vm_address_region.cc
const char * name ()
Defined at line 699 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
zx_status_t Unmap (vaddr_t base, size_t size, VmAddressRegionOpChildren op_children)
Unmap a subset of the region of memory in the containing address space,
returning it to this region to allocate. If a subregion is entirely in
the range, and op_children is Yes, that subregion is destroyed. If a subregion is partially in
the range, Unmap() will fail.
Defined at line 838 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t UnmapAllowPartial (vaddr_t base, size_t size)
Same as Unmap, but allows for subregions that are partially in the range.
Additionally, sub-VMARs that are completely within the range will not be
destroyed.
Defined at line 858 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t Protect (vaddr_t base, size_t size, uint new_arch_mmu_flags, VmAddressRegionOpChildren op_children)
Change protections on a subset of the region of memory in the containing
address space. If the requested range overlaps with a subregion and op_children is No,
Protect() will fail, otherwise the mapping permissions in the sub-region may only be reduced.
Defined at line 1014 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t ReserveSpace (const char * name, size_t base, size_t size, uint arch_mmu_flags)
Reserve a memory region within this VMAR. This region is already mapped in the page table with
|arch_mmu_flags|. VMAR should create a VmMapping for this region even though no physical pages
need to be allocated for this region.
Defined at line 1199 of file ../../zircon/kernel/vm/vm_address_region.cc
bool has_parent ()
Defined at line 610 of file ../../zircon/kernel/vm/vm_address_region.cc
void DumpLocked (uint depth, bool verbose)
Defined at line 615 of file ../../zircon/kernel/vm/vm_address_region.cc
VmMapping * FindMappingLocked (vaddr_t va)
Recursively traverses the regions for a given virtual address and returns a raw pointer to a
mapping if one is found. The returned pointer is only valid as long as the aspace lock remains
held.
Defined at line 487 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t SetMemoryPriority (MemoryPriority priority)
Apply a memory priority to this VMAR and all of its subregions.
Defined at line 1262 of file ../../zircon/kernel/vm/vm_address_region.cc
AttributionCounts GetAttributedMemory ()
Defined at line 458 of file ../../zircon/kernel/vm/vm_address_region.cc
void VmAddressRegion (VmAspace & aspace, vaddr_t base, size_t size, uint32_t vmar_flags)
Constructors are public as LazyInit cannot use them otherwise, even if friended, but
otherwise should be considered private and Create...() should be used instead.
Defined at line 49 of file ../../zircon/kernel/vm/vm_address_region.cc
void VmAddressRegion (VmAddressRegion & parent, vaddr_t base, size_t size, uint32_t vmar_flags, const char * name)
Defined at line 59 of file ../../zircon/kernel/vm/vm_address_region.cc
zx_status_t EnumerateChildren (VmEnumerator * ve)
Traverses this vmar (and any sub-vmars) starting at this node, in depth-first pre-order. See
VmEnumerator for more details. If this vmar is not alive (in the LifeCycleState sense) or
otherwise not enumerable this returns ZX_ERR_BAD_STATE, otherwise the result of enumeration is
returned.
Defined at line 570 of file ../../zircon/kernel/vm/vm_address_region.cc
bool is_in_range (vaddr_t base, size_t size)
Defined at line 722 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Protected Methods
void VmAddressRegion (VmAspace & kernel_aspace)
constructor for use in creating the kernel aspace singleton
Defined at line 66 of file ../../zircon/kernel/vm/vm_address_region.cc
void CommitHighMemoryPriority ()
Defined at line 1316 of file ../../zircon/kernel/vm/vm_address_region.cc
Enumerations
enum RangeOpType
| Name | Value |
|---|---|
| Commit | 0 |
| Decommit | 1 |
| MapRange | 2 |
| Zero | 3 |
| DontNeed | 4 |
| AlwaysNeed | 5 |
| Prefetch | 6 |
Defined at line 662 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Records
Friends
template <VmAddressRegionEnumeratorType, typename>
class VmAddressRegionEnumerator
class VmMapping
void VmAddressRegion ()
class Access
class VmAspace