Lines Matching refs:alloc_size

148     static const size_t alloc_size = 256 * 1024;  in vmm_alloc_smoke_test()  local
154 "test", alloc_size, &ptr, 0, 0, kArchRwFlags); in vmm_alloc_smoke_test()
159 if (!fill_and_test(ptr, alloc_size)) { in vmm_alloc_smoke_test()
173 static const size_t alloc_size = 256 * 1024; in vmm_alloc_contiguous_smoke_test() local
179 alloc_size, &ptr, 0, in vmm_alloc_contiguous_smoke_test()
185 if (!fill_and_test(ptr, alloc_size)) { in vmm_alloc_contiguous_smoke_test()
192 for (size_t i = 0; i < alloc_size / PAGE_SIZE; i++) { in vmm_alloc_contiguous_smoke_test()
212 static const size_t alloc_size = 16 * 1024; in multiple_regions_test() local
221 zx_status_t err = aspace->Alloc("test0", alloc_size, &ptr, 0, 0, kArchRwFlags); in multiple_regions_test()
226 if (!fill_and_test(ptr, alloc_size)) { in multiple_regions_test()
236 if (!fill_and_test(ptr, alloc_size)) { in multiple_regions_test()
246 if (!fill_and_test(ptr, alloc_size)) { in multiple_regions_test()
353 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_commit_test() local
355 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_commit_test()
359 auto ret = vmo->CommitRange(0, alloc_size); in vmo_commit_test()
361 EXPECT_EQ(ROUNDUP_PAGE_SIZE(alloc_size), in vmo_commit_test()
371 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_pin_test() local
374 PMM_ALLOC_FLAG_ANY, VmObjectPaged::kResizable, alloc_size, &vmo); in vmo_pin_test()
378 status = vmo->Pin(PAGE_SIZE, alloc_size); in vmo_pin_test()
382 status = vmo->Pin(alloc_size + PAGE_SIZE, 0); in vmo_pin_test()
387 status = vmo->Pin(0, alloc_size); in vmo_pin_test()
393 status = vmo->Pin(0, alloc_size); in vmo_pin_test()
435 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_multiple_pin_test() local
437 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_multiple_pin_test()
441 status = vmo->CommitRange(0, alloc_size); in vmo_multiple_pin_test()
444 status = vmo->Pin(0, alloc_size); in vmo_multiple_pin_test()
456 vmo->Unpin(0, alloc_size); in vmo_multiple_pin_test()
459 status = vmo->DecommitRange(5 * PAGE_SIZE, alloc_size - 5 * PAGE_SIZE); in vmo_multiple_pin_test()
482 static const size_t alloc_size = 15; in vmo_odd_size_commit_test() local
484 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_odd_size_commit_test()
488 auto ret = vmo->CommitRange(0, alloc_size); in vmo_odd_size_commit_test()
490 EXPECT_EQ(ROUNDUP_PAGE_SIZE(alloc_size), in vmo_odd_size_commit_test()
523 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_create_contiguous_test() local
525 zx_status_t status = VmObjectPaged::CreateContiguous(PMM_ALLOC_FLAG_ANY, alloc_size, 0, &vmo); in vmo_create_contiguous_test()
540 status = vmo->Lookup(0, alloc_size, lookup_func, &last_pa); in vmo_create_contiguous_test()
550 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_contiguous_decommit_test() local
552 zx_status_t status = VmObjectPaged::CreateContiguous(PMM_ALLOC_FLAG_ANY, alloc_size, 0, &vmo); in vmo_contiguous_decommit_test()
560 status = vmo->DecommitRange(alloc_size - PAGE_SIZE, PAGE_SIZE); in vmo_contiguous_decommit_test()
573 status = vmo->Lookup(0, alloc_size, lookup_func, &last_pa); in vmo_contiguous_decommit_test()
582 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_precommitted_map_test() local
584 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0, alloc_size, &vmo); in vmo_precommitted_map_test()
590 auto ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr, in vmo_precommitted_map_test()
595 if (!fill_and_test(ptr, alloc_size)) { in vmo_precommitted_map_test()
607 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_demand_paged_map_test() local
609 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_demand_paged_map_test()
615 auto ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr, in vmo_demand_paged_map_test()
620 if (!fill_and_test(ptr, alloc_size)) { in vmo_demand_paged_map_test()
632 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_dropped_ref_test() local
634 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_dropped_ref_test()
640 auto ret = ka->MapObjectInternal(ktl::move(vmo), "test", 0, alloc_size, &ptr, in vmo_dropped_ref_test()
647 if (!fill_and_test(ptr, alloc_size)) { in vmo_dropped_ref_test()
660 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_remap_test() local
662 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_remap_test()
668 auto ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr, in vmo_remap_test()
673 if (!fill_and_test(ptr, alloc_size)) { in vmo_remap_test()
681 ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr, in vmo_remap_test()
686 bool result = test_region((uintptr_t)ptr, ptr, alloc_size); in vmo_remap_test()
698 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_double_remap_test() local
700 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_double_remap_test()
706 auto ret = ka->MapObjectInternal(vmo, "test0", 0, alloc_size, &ptr, in vmo_double_remap_test()
711 if (!fill_and_test(ptr, alloc_size)) { in vmo_double_remap_test()
717 ret = ka->MapObjectInternal(vmo, "test1", 0, alloc_size, &ptr2, in vmo_double_remap_test()
723 bool result = test_region((uintptr_t)ptr, ptr2, alloc_size); in vmo_double_remap_test()
729 ret = ka->MapObjectInternal(vmo, "test2", alloc_offset, alloc_size - alloc_offset, in vmo_double_remap_test()
737 memcmp((uint8_t*)ptr + alloc_offset, ptr3, alloc_size - alloc_offset); in vmo_double_remap_test()
753 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_read_write_smoke_test() local
757 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0, alloc_size, &vmo); in vmo_read_write_smoke_test()
763 fbl::Array<uint8_t> a(new (&ac) uint8_t[alloc_size], alloc_size); in vmo_read_write_smoke_test()
765 fill_region(99, a.get(), alloc_size); in vmo_read_write_smoke_test()
778 err = vmo->Write(a.get(), 0, alloc_size + 47); in vmo_read_write_smoke_test()
782 err = vmo->Write(a.get(), 31, alloc_size + 47); in vmo_read_write_smoke_test()
786 err = vmo->Write(a.get(), alloc_size + 99, 42); in vmo_read_write_smoke_test()
792 err = ka->MapObjectInternal(vmo, "test", 0, alloc_size, (void**)&ptr, in vmo_read_write_smoke_test()
803 err = vmo->Write(a.get(), 0, alloc_size); in vmo_read_write_smoke_test()
807 bool result = test_region(99, ptr, alloc_size); in vmo_read_write_smoke_test()
814 fbl::Array<uint8_t> b(new (&ac) uint8_t[alloc_size], alloc_size); in vmo_read_write_smoke_test()
817 err = vmo->Read(b.get(), 0, alloc_size); in vmo_read_write_smoke_test()
821 cmpres = memcmp(b.get(), a.get(), alloc_size); in vmo_read_write_smoke_test()
913 static const size_t alloc_size = PAGE_SIZE * 16; in vmo_lookup_test() local
915 zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0u, alloc_size, &vmo); in vmo_lookup_test()
925 status = vmo->Lookup(0, alloc_size, lookup_fn, &pages_seen); in vmo_lookup_test()
936 status = vmo->Lookup(0, alloc_size, lookup_fn, &pages_seen); in vmo_lookup_test()
942 status = vmo->Lookup(PAGE_SIZE, alloc_size - PAGE_SIZE, lookup_fn, &pages_seen); in vmo_lookup_test()
954 status = vmo->CommitRange(0, alloc_size); in vmo_lookup_test()
956 EXPECT_EQ(alloc_size, PAGE_SIZE * vmo->AllocatedPages(), "committing vm object\n"); in vmo_lookup_test()
958 status = vmo->Lookup(0, alloc_size, lookup_fn, &pages_seen); in vmo_lookup_test()
960 EXPECT_EQ(alloc_size / PAGE_SIZE, pages_seen, "lookup on partially committed pages\n"); in vmo_lookup_test()