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 204 of file ../../zircon/system/utest/core/pager/userpager.cc

void ~UserPager ()

Defined at line 214 of file ../../zircon/system/utest/core/pager/userpager.cc

bool Init ()

Initialzies the UserPager.

Defined at line 229 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 248 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 252 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 299 of file ../../zircon/system/utest/core/pager/userpager.cc

bool DetachVmo (Vmo * vmo)

Detaches the paged vmo.

Defined at line 303 of file ../../zircon/system/utest/core/pager/userpager.cc

void ReleaseVmo (Vmo * vmo)

Destroys the paged vmo.

Defined at line 312 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 446 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 473 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 485 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 497 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 554 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 543 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 508 of file ../../zircon/system/utest/core/pager/userpager.cc

bool WritebackBeginZeroPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count)

Defined at line 520 of file ../../zircon/system/utest/core/pager/userpager.cc

bool WritebackEndPages (Vmo * vmo, uint64_t page_offset, uint64_t page_count)

Defined at line 532 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 324 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 329 of file ../../zircon/system/utest/core/pager/userpager.cc

bool WaitForPageComplete (uint64_t key, zx_instant_mono_t deadline)

Defined at line 343 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 371 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 376 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 381 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 786 of file ../../zircon/system/utest/core/pager/userpager.cc