class UserPager
Defined at line 169 of file ../../zircon/system/utest/core/pager/userpager.h
This class is not thread-safe and is only expected to be accessed from the main test thread.
Public Methods
void ClosePagerHandle ()
Closes the pager handle.
Defined at line 177 of file ../../zircon/system/utest/core/pager/userpager.h
void ClosePortHandle ()
Closes the pager's port handle.
Defined at line 179 of file ../../zircon/system/utest/core/pager/userpager.h
void UserPager ()
Defined at line 203 of file ../../zircon/system/utest/core/pager/userpager.cc
void ~UserPager ()
Defined at line 213 of file ../../zircon/system/utest/core/pager/userpager.cc
bool Init ()
Initialzies the UserPager.
Defined at line 228 of file ../../zircon/system/utest/core/pager/userpager.cc
bool CreateVmo (uint64_t num_pages, Vmo ** vmo_out)
Creates a new paged vmo.
Defined at line 247 of file ../../zircon/system/utest/core/pager/userpager.cc
const zx::pager & pager ()
Defined at line 251 of file ../../zircon/system/utest/core/pager/userpager.h
bool CreateVmoWithOptions (uint64_t num_pages, uint32_t options, Vmo ** vmo_out)
Creates a new paged vmo with the provided create |options|.
Defined at line 251 of file ../../zircon/system/utest/core/pager/userpager.cc
bool CreateUnboundedVmo (uint64_t initial_stream_size, uint32_t options, Vmo ** vmo_out)
Create a VMO of type ZX_VMO_UNBOUNDED. The resulting Vmo only has limited support and cannot
be accessed via its mapping. Additional |options| may also be specified, as long as they do not
conflict with ZX_VMO_UNBOUNDED.
Defined at line 298 of file ../../zircon/system/utest/core/pager/userpager.cc
bool DetachVmo (Vmo * vmo)
Detaches the paged vmo.
Defined at line 302 of file ../../zircon/system/utest/core/pager/userpager.cc
void ReleaseVmo (Vmo * vmo)
Destroys the paged vmo.
Defined at line 311 of file ../../zircon/system/utest/core/pager/userpager.cc
bool SupplyPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count, uint64_t src_page_offset)
Populates the specified pages with autogenerated content. |src_page_offset| is used
to offset where in the temporary vmo the content is generated.
Defined at line 445 of file ../../zircon/system/utest/core/pager/userpager.cc
bool SupplyPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count, zx::vmo src, uint64_t src_page_offset)
Populates the specified pages with the content in |src| starting at |src_page_offset|.
Defined at line 472 of file ../../zircon/system/utest/core/pager/userpager.cc
bool FailPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count, zx_status_t error_status)
Signals failure to populate pages in the specified range.
Defined at line 484 of file ../../zircon/system/utest/core/pager/userpager.cc
bool DirtyPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count)
Signals that pages in the specified range can be marked dirty.
Defined at line 496 of file ../../zircon/system/utest/core/pager/userpager.cc
bool VerifyDirtyRanges (Vmo * paged_vmo, zx_vmo_dirty_range_t * dirty_ranges_to_verify, size_t num_dirty_ranges_to_verify)
Queries dirty ranges of pages in the specified range and verifies that they match the ones
provided in |dirty_ranges_to_verify|. The number of entries in |dirty_ranges_to_verify| is
passed in with |num_dirty_ranges_to_verify|.
Defined at line 553 of file ../../zircon/system/utest/core/pager/userpager.cc
bool VerifyModified (Vmo * paged_vmo)
Queries pager vmo stats, and returns whether the |paged_vmo| has been modified since the last
query.
Defined at line 542 of file ../../zircon/system/utest/core/pager/userpager.cc
bool WritebackBeginPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count)
Begins and ends writeback on pages in the specified range.
Defined at line 507 of file ../../zircon/system/utest/core/pager/userpager.cc
bool WritebackBeginZeroPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count)
Defined at line 519 of file ../../zircon/system/utest/core/pager/userpager.cc
bool WritebackEndPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count)
Defined at line 531 of file ../../zircon/system/utest/core/pager/userpager.cc
bool WaitForPageRead (Vmo * vmo, uint64_t page_offset, uint64_t page_count, zx_instant_mono_t deadline)
Checks if there is a request for the range [page_offset, length). Will
wait until |deadline|.
Defined at line 323 of file ../../zircon/system/utest/core/pager/userpager.cc
bool WaitForPageDirty (Vmo * vmo, uint64_t page_offset, uint64_t page_count, zx_instant_mono_t deadline)
Defined at line 328 of file ../../zircon/system/utest/core/pager/userpager.cc
bool WaitForPageComplete (uint64_t key, zx_instant_mono_t deadline)
Defined at line 342 of file ../../zircon/system/utest/core/pager/userpager.cc
bool GetPageReadRequest (Vmo * vmo, zx_instant_mono_t deadline, uint64_t * page_offset, uint64_t * page_count)
Gets the first page read request. Blocks until |deadline|.
Defined at line 370 of file ../../zircon/system/utest/core/pager/userpager.cc
bool GetPageDirtyRequest (Vmo * vmo, zx_instant_mono_t deadline, uint64_t * page_offset, uint64_t * page_count)
Gets the first page dirty request. Blocks until |deadline|.
Defined at line 375 of file ../../zircon/system/utest/core/pager/userpager.cc
bool GetPageRequest (Vmo * vmo, uint16_t command, zx_instant_mono_t deadline, uint64_t * page_offset, uint64_t * page_count)
Gets the first page request with |command|. Blocks until |deadline|.
Defined at line 380 of file ../../zircon/system/utest/core/pager/userpager.cc
bool StartTaggedPageFaultHandler ()
Starts a thread to handle any page faults. Faulted in pages are initialized with the default
page tagged data as per SupplyPages. This function is not thread safe, and should only be
called once. After starting a pager thread it is an error to create or destroy VMOs, as this
could lead to data races.
The individual VMOs can, optionally, have the maximum offset of a fault that will be handled
through their respective SetPageFaultSupplyLimit methods. Any page request outside these limits
will be dropped and ignored, and cannot be retrieved through any of the GetPageRequest or
similar methods.
Defined at line 785 of file ../../zircon/system/utest/core/pager/userpager.cc