Records

Functions

  • zx_status_t AllocUser (VmAspace * aspace, const char * name, size_t size, user_inout_ptr<void> * ptr)

    Helper function to allocate memory in a user address space.

    Defined at line 15 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • zx_status_t make_partially_committed_pager_vmo (size_t num_pages, size_t committed_pages, bool trap_dirty, bool resizable, bool ignore_requests, vm_page_t ** out_pages, fbl::RefPtr<VmObjectPaged> * out_vmo)

    Create a pager-backed VMO |out_vmo| with size equals |num_pages| pages, and commit

    |commited_pages| of its pages. |trap_dirty| controls whether modifications to pages must be

    trapped in order to generate DIRTY page requests. |resizable| controls whether the created VMO is

    resizable. Returns pointers to the pages committed in |out_pages|, so that tests can examine

    their state. Allows tests to work with pager-backed VMOs without blocking on page faults. The

    |ignore_requests| flag can be set if attempts at sending page faults should be ignored, or result

    in a panic.

    Defined at line 40 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • template <typename T>
    void ConsumeValue (T value)

    Consume the (scalar) value, ensuring that the operation to calculate the value can not be

    optimized out/ deemed as unused by the compiler. I.e. this function can be used as a wrapper to a

    calculation to ensure it will be in the binary.

    Defined at line 69 of file ../../zircon/kernel/vm/unittests/aspace_unittest.cc

  • zx_status_t make_committed_pager_vmo (size_t num_pages, bool trap_dirty, bool resizable, vm_page_t ** out_pages, fbl::RefPtr<VmObjectPaged> * out_vmo)

    Convenience wrapper for |make_partially_committed_pager_vmo| that commits all pages.

    Defined at line 113 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • zx_status_t make_uncommitted_pager_vmo (size_t num_pages, bool trap_dirty, bool resizable, fbl::RefPtr<VmObjectPaged> * out_vmo)

    Same as make_committed_pager_vmo but does not commit any pages in the VMO.

    Defined at line 107 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • uint32_t test_rand (uint32_t seed)

    Defined at line 119 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • void fill_region (uintptr_t seed, void * _ptr, size_t len)

    fill a region of memory with a pattern based on the address of the region

    Defined at line 122 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • void fill_region_user (uintptr_t seed, user_inout_ptr<void> _ptr, size_t len)

    just like |fill_region|, but for user memory

    Defined at line 137 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • bool test_region (uintptr_t seed, void * _ptr, size_t len)

    test a region of memory against a known pattern

    Defined at line 153 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • bool test_region_user (uintptr_t seed, user_inout_ptr<void> _ptr, size_t len)

    just like |test_region|, but for user memory

    Defined at line 173 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • bool fill_and_test (void * ptr, size_t len)

    Defined at line 196 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • bool fill_and_test_user (user_inout_ptr<void> ptr, size_t len)

    just like |fill_and_test|, but for user memory

    Defined at line 210 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • bool verify_mapped_page_range (vaddr_t base, size_t mapping_size, size_t expected_mapped_page_count)

    Helper function used by vmo_mapping_page_fault_optimisation_test.

    Given a mapping, check that a run of consecutive pages are mapped (indicated by

    expected_mapped_page_count) and that remaining pages are unmapped.

    Defined at line 228 of file ../../zircon/kernel/vm/unittests/test_helper.cc

  • VmObject::AttributionCounts make_private_attribution_counts (uint64_t uncompresseduint64_t compressed)

    Helper function that produces a filled out AttributionCounts for testing simple VMOs that just

    have private and no shared content.

    Defined at line 252 of file ../../zircon/kernel/vm/unittests/test_helper.cc