template <typename T = VmAddressRegionOrMapping>
class RegionList
Defined at line 268 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
A list of regions ordered by virtual address. Templated to allow for test code to avoid needing
to instantiate 'real' VmAddressRegionOrMapping instances.
TODO(https://fxbug.dev/503042881): The RegionList API is quite object reference focused, instead
of iterator focused, and this leads to a lot of theoretically redundant 'find' operations on the
btree. These APIs, and the VMAR logic using them, should be re-designed to be more iterator
based.
Public Methods
void RegionList<T> ()
Defined at line 273 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
void RemoveRegion (T * region)
Remove *region* from the list, returns the removed region.
Defined at line 276 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::iterator LeftOf (T * region)
Request the region to the left or right of the given region.
Defined at line 283 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::iterator RightOf (T * region)
Defined at line 289 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
zx_status_t InsertRegion (fbl::RefPtr<T> region)
Insert *region* to the region list. On failure the region list is unmodified.
Defined at line 297 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
void ReplaceRegion (T * prev, fbl::RefPtr<T> region)
Replaces the target region with a new region at the same address. Unlike insertion this cannot
fail.
Defined at line 304 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
template <typename S>
ktl::conditional_t<ktl::is_const_v<S>, const T, T> * FindRegion (S * self, vaddr_t addr)
Use a static template to allow for returning a const and non-const pointer depending on the
constness of self.
Defined at line 314 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
const T * FindRegion (vaddr_t addr)
Find the region that covers addr, returns nullptr if not found.
Defined at line 336 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
T * FindRegion (vaddr_t addr)
Defined at line 337 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
template <typename S>
ktl::conditional_t<ktl::is_const_v<S>, typename ChildList::const_iterator, typename ChildList::iterator> IncludeOrHigher (S * self, vaddr_t base)
Defined at line 340 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::iterator IncludeOrHigher (vaddr_t base)
Find the region that contains |base|, or if that doesn't exist, the first region that contains
an address greater than |base|.
Defined at line 361 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::const_iterator IncludeOrHigher (vaddr_t base)
Defined at line 362 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::iterator UpperBound (vaddr_t base)
Defined at line 366 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::const_iterator UpperBound (vaddr_t base)
Defined at line 367 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
bool IsRangeAvailable (vaddr_t base, size_t size)
Check whether it would be valid to create a child in the range [base, base+size).
Defined at line 370 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
fit::result<FindSpotAtIndexFailed, vaddr_t> FindSpotAtIndex (vaddr_ttarget_index,uint8_talign_pow2,size_tsize,vaddr_tparent_base,size_tparent_size,vaddr_tupper_limit)
Defined at line 413 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
zx_status_t GetAllocSpot (vaddr_t *alloc_spot,uint8_talign_pow2,uint8_tentropy,size_tsize,vaddr_tparent_base,size_tparent_size,crypto::Prng *prng,vaddr_tupper_limit)
Get the allocation spot that is free and large enough for the aligned size.
Defined at line 569 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
bool IsEmpty ()
Returns whether the region list is empty.
Defined at line 623 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
T & front ()
Returns the first element of the list.
Defined at line 626 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::iterator begin ()
Defined at line 631 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::const_iterator begin ()
Defined at line 632 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::iterator end ()
Defined at line 634 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
ChildList::const_iterator end ()
Defined at line 635 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h
size_t size_slow ()
Defined at line 637 of file ../../zircon/kernel/vm/include/vm/vm_address_region.h