class VmPageSpliceList
Defined at line 1687 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 AddPagesFrom. 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 1194 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 1210 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 1266 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 1242 of file ../../zircon/kernel/vm/vm_page_list.cc
void VmPageSpliceList ()
Defined at line 1689 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
void VmPageSpliceList (uint64_t length)
Convenience constructor that calls Initialize.
Defined at line 1691 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 1701 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
template <typename F>
zx_status_t AddPagesFrom (F merge_func, VmPageList & source, uint64_t offset)
Takes the content out of |source| and places them in this splice list, which must have already
been initialized but still be empty. The range to be taken is determined by the provided
|offset| and the length of this splice list. May return ZX_ERR_OUT_OF_MEMORY, in which case an
unspecified number of pages will have been moved into this splice list.
Takes a function with the signature void(VmPageOrMarker *src, VmPageOrMarker *dst, uint64_t
offset), which is expected to move content from |src| to |dst|.
Defined at line 1719 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 1732 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 1754 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 1792 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
bool IsInitialized ()
Returns true if the collection has been Initialized.
Defined at line 1795 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
bool IsEmpty ()
Returns true if this list is empty.
Defined at line 1798 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 1803 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 1810 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
uint64_t Position ()
Returns the current position in the list.
Defined at line 1813 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
void VmPageSpliceList (const VmPageSpliceList & )
Defined at line 1815 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
VmPageSpliceList & operator= (const VmPageSpliceList & )
Defined at line 1815 of file ../../zircon/kernel/vm/include/vm/vm_page_list.h
Friends
class VmPageList