class VmPageSpliceList
Defined at line 1696 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
Class which holds the list of vm_page structs removed from a VmPageList
by TakePages. The list include information about uncommitted pages and markers.
Every splice list is expected to go through the following series of states:
1. The splice list is created.
2. List is Initialized with the desired range.
3. Pages are added to the splice list.
4. The list is `Finalize`d, meaning that it can no longer be modified by `Append`.
5. Pages are then `Pop`d from the list. Once all the pages are popped, the list is considered
"processed".
6. The list is then considered `Processed` and can be destroyed.
Public Methods
void ~VmPageSpliceList ()
Defined at line 1204 of file ../../zircon/kernel/vm/vm_page_list.cc
zx_status_t CreateFromPageList (uint64_t length, list_node * pages, VmPageSpliceList * splice)
For use by PhysicalPageProvider. The user-pager path doesn't use this. This returns a
finalized list.
Defined at line 1220 of file ../../zircon/kernel/vm/vm_page_list.cc
VmPageOrMarker Pop ()
Pops the next page off of the splice list. It is invalid to pop a page from a non-finalized
splice list.
Defined at line 1276 of file ../../zircon/kernel/vm/vm_page_list.cc
zx_status_t Insert (uint64_t offset, VmPageOrMarker content)
Inserts the |content| into the splice list at the specified |offset|.
The splice list takes ownership of `content` after this call.
It is invalid to append to a finalized splice list.
Defined at line 1252 of file ../../zircon/kernel/vm/vm_page_list.cc
void VmPageSpliceList ()
Defined at line 1698 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
void VmPageSpliceList (uint64_t length)
Convenience constructor that calls Initialize.
Defined at line 1700 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
void Initialize (uint64_t length)
Initialize the list with the given range. Can only be done once, and must be done before
providing pages.
Defined at line 1710 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
template <typename PAGE_FUNC>
zx_status_t MutatePages (PAGE_FUNC page_func, uint64_t start_offset)
Iterates all pages in this splice list without taking ownership. Pages are not considered
processed and can not be removed using this iterator. The callback is expected to have the
signature: zx_status_t page_func(VmPageOrMarkerRef slot, uint64_t offset);
The iterator will start at `start_offset` and iterate until the end of the VmPageSpliceList.
start_offset must be paged aligned and less than length_.
Defined at line 1726 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
template <typename PAGE_FUNC, typename GAP_FUNC>
zx_status_t RemovePagesAndIterateGaps (PAGE_FUNC page_func, GAP_FUNC gap_func)
Iterates all the pages and gaps in this splice list. The page_func is given ownership of each
page. It is invalid to process a non-finalized splice list. The two callbacks are expected to
have the signature:
zx_status_t page_func(VmPageOrMarker slot, uint64_t splice_offset);
zx_status_t gap_func(uint64_t gap_start, uint64_t gap_end);
Due to page_func always taking ownership of the content if it returns any kind of error, either
a graceful request to stop iteration via ZX_ERR_STOP or an explicit error, then that offset is
considered processed and will not be repeated in future calls. In contrast, if iteration is
stopped during gap_func, that gap will not be considered processed and can be returned in
future calls.
Defined at line 1748 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
bool IsProcessed ()
Returns true after the whole collection has been processed by Pop.
Defined at line 1786 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
bool IsInitialized ()
Returns true if the collection has been Initialized.
Defined at line 1789 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
bool IsEmpty ()
Returns true if this list is empty.
Defined at line 1792 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
void Finalize ()
Marks the list as finalized.
See the comment at `VmPageSpliceList`'s declaration for more info on what this means and when
to call it. Note that it is invalid to call `Finalize` twice on the same list.
Defined at line 1797 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
bool IsFinalized ()
Returns true if the splice list is finalized.
See the comment at `VmPageSpliceList`'s declaration for more info on what this means.
Defined at line 1804 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
uint64_t Position ()
Returns the current position in the list.
Defined at line 1807 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
void VmPageSpliceList (const VmPageSpliceList & )
Defined at line 1809 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
VmPageSpliceList & operator= (const VmPageSpliceList & )
Defined at line 1809 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
Friends
class VmPageList