class VmAddressRegionOrMapping
Defined at line 100 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
A VmAddressRegion represents a contiguous region of the virtual address
space. It is partitioned by non-overlapping children of the following types:
1) child VmAddressRegion
2) child VmMapping (leafs that map VmObjects into the address space)
3) gaps (logical, not actually objects).
VmAddressRegionOrMapping represents a tagged union of the two types.
A VmAddressRegion/VmMapping may be in one of two states: ALIVE or DEAD. If
it is ALIVE, then the VmAddressRegion is a description of the virtual memory
mappings of the address range it represents in its parent VmAspace. If it is
DEAD, then the VmAddressRegion is invalid and has no meaning.
All VmAddressRegion and VmMapping state is protected by the aspace lock.
Protected Members
LifeCycleState state_
MemoryPriority memory_priority_
const uint32_t flags_
const vaddr_t base_
const size_t size_
RefPtr aspace_
VmAddressRegion * parent_
Public Methods
zx_status_t Destroy ()
If a VMO-mapping, unmap all pages and remove dependency on vm object it has a ref to.
Otherwise recursively destroy child VMARs and transition to the DEAD state.
Returns ZX_OK on success, ZX_ERR_BAD_STATE if already dead, and other
values on error (typically unmap failure).
Defined at line 34 of file ../../zircon/kernel/vm/vm_address_region_or_mapping.cc
fbl::RefPtr<VmAddressRegion> as_vm_address_region ()
Now that all the sub-classes are defined finish declaring some inline VmAddressRegionOrMapping
methods.
Defined at line 1377 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
fbl::RefPtr<VmMapping> as_vm_mapping ()
Defined at line 1410 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
VmAddressRegion * as_vm_address_region_ptr ()
Defined at line 1385 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
const VmAddressRegion * as_vm_address_region_ptr ()
Defined at line 1393 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
VmMapping * as_vm_mapping_ptr ()
Defined at line 1418 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
const VmMapping * as_vm_mapping_ptr ()
Defined at line 1426 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
fbl::RefPtr<VmAddressRegion> downcast_as_vm_address_region (fbl::RefPtr<VmAddressRegionOrMapping> * region_or_map)
Defined at line 1401 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
fbl::RefPtr<VmMapping> downcast_as_vm_mapping (fbl::RefPtr<VmAddressRegionOrMapping> * region_or_map)
Defined at line 1434 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
void DumpLocked (uint depth, bool verbose)
Dump debug info
vaddr_t base ()
accessors
Defined at line 112 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
size_t size ()
Defined at line 113 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
uint32_t flags ()
Defined at line 114 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
const fbl::RefPtr<VmAspace> & aspace ()
Defined at line 115 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
bool is_mapping ()
Subtype information and safe down-casting
Defined at line 118 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
vaddr_t GetKey ()
WAVL tree key function
For use in WAVL tree code only.
Defined at line 132 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Lock<CriticalMutex> * lock ()
Expose our backing lock for annotation purposes.
Defined at line 138 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Lock<CriticalMutex> & lock_ref ()
Defined at line 139 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Lock<CriticalMutex> * region_lock ()
Defined at line 140 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Lock<CriticalMutex> & region_lock_ref ()
Defined at line 143 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
bool is_in_range (vaddr_t base, size_t size)
Defined at line 147 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
VmAddressRegionSubtreeState & subtree_state_locked ()
Subtree state for augmented binary search tree operations.
Defined at line 162 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
const VmAddressRegionSubtreeState & subtree_state_locked ()
Defined at line 163 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
bool IsAliveLocked ()
Returns true if the instance is alive and reporting information that
reflects the address space layout. |aspace()->lock()| must be held.
Defined at line 169 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Protected Methods
void ~VmAddressRegionOrMapping ()
destructor, should only be invoked from RefPtr
Defined at line 46 of file ../../zircon/kernel/vm/vm_address_region_or_mapping.cc
void VmAddressRegionOrMapping (vaddr_t base, size_t size, uint32_t flags, VmAspace * aspace, VmAddressRegion * parent, bool is_mapping)
Defined at line 21 of file ../../zircon/kernel/vm/vm_address_region_or_mapping.cc
zx_status_t DestroyLocked ()
void CommitHighMemoryPriority ()
Performs any actions necessary to apply a high memory priority over the given range.
This method is always safe to call as it will internally check the memory priority status and
skip if necessary, so the caller does not need to worry about races with a different memory
priority being applied.
As this may need to acquire the lock even to check the memory priority, if the caller knows
they have not caused this to become high priority (i.e. they have called
SetMemoryPriorityLocked with MemoryPriority::DEFAULT), then calling this should be skipped for
performance.
Memory that needs to be committed for a high memory priority are user pager backed pages and
any compressed or loaned pages. Anonymous pages and copy-on-write pages do not allocated /
committed.
This method has no return value as it is entirely best effort and no part of its operation is
needed for correctness.
void Activate ()
Transition from NOT_READY to READY, and add references to self to related
structures.
bool in_subregion_tree ()
Defined at line 189 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
LifeCycleState state_locked ()
Defined at line 203 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
LifeCycleState state_locked_region ()
Defined at line 204 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
bool is_valid_mapping_flags (uint arch_mmu_flags)
Check if the given *arch_mmu_flags* are allowed under this
regions *flags_*
Defined at line 213 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Enumerations
enum MemoryPriority
| Name | Value |
|---|---|
| DEFAULT | 0 |
| HIGH | 1 |
Memory priorities that can be applied to VMARs and mappings to propagate to VMOs and page
tables.
Defined at line 154 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
enum LifeCycleState
| Name | Value |
|---|---|
| NOT_READY | 0 |
| ALIVE | 1 |
| DEAD | 2 |
Defined at line 193 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
Friends
class RefPtr
template <VmAddressRegionEnumeratorType, typename>
class VmAddressRegionEnumerator
class VmAddressRegion