Lines Matching refs:ret

46     int ret;  in mmutest_run_in_thread()  local
60 ret = vmm_alloc(aspace, "canary", PAGE_SIZE, (void**)&canary, 0, in mmutest_run_in_thread()
62 if (ret) { in mmutest_run_in_thread()
69 ret = thread_resume(thread); in mmutest_run_in_thread()
70 if (ret) { in mmutest_run_in_thread()
71 return ret; in mmutest_run_in_thread()
74 ret = thread_join(thread, &thread_ret, INFINITE_TIME); in mmutest_run_in_thread()
75 if (ret) { in mmutest_run_in_thread()
76 return ret; in mmutest_run_in_thread()
94 int ret; in mmutest_alloc() local
98 ret = vmm_alloc_contiguous(aspace, "mmutest", PAGE_SIZE, ptrp, 0, 0, in mmutest_alloc()
101 EXPECT_EQ(NO_ERROR, ret, "vmm_alloc_contiguous failed\n"); in mmutest_alloc()
102 if (ret) { in mmutest_alloc()
103 return ret; in mmutest_alloc()
115 int ret; in mmutest_vmm_store_uint32() local
118 ret = mmutest_alloc(&ptr, arch_mmu_flags); in mmutest_vmm_store_uint32()
119 if (ret) { in mmutest_vmm_store_uint32()
120 return ret; in mmutest_vmm_store_uint32()
123 ret = mmutest_arch_store_uint32(ptr, user); in mmutest_vmm_store_uint32()
126 return ret; in mmutest_vmm_store_uint32()
163 int ret; in mmu_test_execute() local
166 ret = pmm_alloc(&vmm_obj, &vmm_obj_ref, alloc_len / PAGE_SIZE, in mmu_test_execute()
168 ASSERT_EQ(NO_ERROR, ret, "pmm_alloc failed\n"); in mmu_test_execute()
170 ret = vmm_alloc_obj(aspace, "mmutest_w", vmm_obj, 0, alloc_len, &ptr, 0, 0, in mmu_test_execute()
172 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc_obj failed\n"); in mmu_test_execute()
179 ret = vmm_alloc_obj(aspace, "mmutest_flags", vmm_obj, 0, alloc_len, in mmu_test_execute()
181 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc_obj failed\n"); in mmu_test_execute()
195 ret = mmutest_run_in_thread("mmu_test_execute", in mmu_test_execute()
213 return ret; in mmu_test_execute()
229 int ret; in TEST_F_SETUP() local
238 ret = vmm_create_aspace(&_state->aspace, "mmutestvmm", 0); in TEST_F_SETUP()
239 ASSERT_EQ(NO_ERROR, ret); in TEST_F_SETUP()
260 int ret; in TEST_P() local
262 ret = vmm_alloc(_state->aspace, "mmutest", _state->allocation_size, &ptr, 0, in TEST_P()
264 EXPECT_EQ(NO_ERROR, ret); in TEST_P()
266 ret = vmm_free_region(_state->aspace, (vaddr_t)ptr); in TEST_P()
267 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST_P()
272 int ret; in TEST_P() local
274 ret = vmm_alloc_contiguous(_state->aspace, "mmutest", in TEST_P()
278 EXPECT_EQ(NO_ERROR, ret); in TEST_P()
280 ret = vmm_free_region(_state->aspace, (vaddr_t)ptr); in TEST_P()
281 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST_P()
297 int ret = mmutest_run_in_thread("mmutest-panic", mmutest_panic_thread_func, in TEST() local
299 EXPECT_EQ(ERR_FAULT, ret); in TEST()
313 int ret = in TEST() local
316 EXPECT_EQ(ERR_FAULT, ret); in TEST()
320 int ret; in TEST() local
337 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, in TEST()
342 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc failed last page\n"); in TEST()
345 ret = vmm_get_obj(aspace, (vaddr_t)ptr1, PAGE_SIZE, &slice); in TEST()
346 EXPECT_EQ(NO_ERROR, ret, "vmm_get_obj failed to get last page object"); in TEST()
354 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, 0, in TEST()
356 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc failed anywhere page\n"); in TEST()
359 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, in TEST()
362 EXPECT_EQ(ERR_NO_MEMORY, ret, "vmm_alloc last page\n"); in TEST()
366 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr3, 0, in TEST()
370 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc failed 2nd last page\n"); in TEST()
373 ret = vmm_free_region(aspace, (vaddr_t)ptr1); in TEST()
374 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST()
375 ret = vmm_free_region(aspace, (vaddr_t)ptr2); in TEST()
376 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST()
377 ret = vmm_free_region(aspace, (vaddr_t)ptr3); in TEST()
378 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST()
381 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, in TEST()
383 ASSERT_EQ(ERR_OUT_OF_RANGE, ret, "vmm_alloc succeeded unexpectedly\n"); in TEST()
386 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, in TEST()
390 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc failed last page\n"); in TEST()
391 ret = vmm_free_region(aspace, (vaddr_t)ptr1); in TEST()
392 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST()
395 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, 0, in TEST()
397 ASSERT_EQ(NO_ERROR, ret, "vmm_alloc failed anywhere page\n"); in TEST()
398 ret = vmm_free_region(aspace, (vaddr_t)ptr2); in TEST()
399 EXPECT_EQ(NO_ERROR, ret, "vmm_free_region failed\n"); in TEST()
409 int ret; in TEST_F_SETUP() local
415 ret = vmm_create_aspace(&_state->aspace, "mmutestaspace", 0); in TEST_F_SETUP()
416 ASSERT_EQ(NO_ERROR, ret); in TEST_F_SETUP()
429 int ret; in TEST_P() local
443 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, 0, in TEST_P()
445 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
453 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr3, 0, 0, in TEST_P()
455 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
463 ret = vmm_get_obj(aspace, (vaddr_t)ptr1 - PAGE_SIZE, PAGE_SIZE, &slice); in TEST_P()
464 EXPECT_EQ(ERR_NOT_FOUND, ret); in TEST_P()
467 ret = vmm_get_obj(aspace, (vaddr_t)ptr1 + PAGE_SIZE, PAGE_SIZE, &slice); in TEST_P()
468 EXPECT_EQ(ERR_NOT_FOUND, ret); in TEST_P()
473 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
477 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
480 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
484 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
491 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, in TEST_P()
494 ASSERT_EQ(ERR_INVALID_ARGS, ret); in TEST_P()
502 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr1, 0, in TEST_P()
504 if (ret) { in TEST_P()
512 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
518 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
520 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
523 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
526 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
529 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
532 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
535 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
539 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
543 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr2, 0, in TEST_P()
546 if (ret) { in TEST_P()
549 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
555 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr3, 0, in TEST_P()
557 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
560 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr3, 0, in TEST_P()
563 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
566 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr3, 0, in TEST_P()
570 if (ret) { in TEST_P()
573 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
579 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr4, 0, in TEST_P()
581 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
584 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr4, 0, in TEST_P()
587 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
590 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr4, 0, in TEST_P()
593 if (ret) { in TEST_P()
596 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
606 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr5, 0, in TEST_P()
608 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
611 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr5, 0, in TEST_P()
614 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
617 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr5, 0, in TEST_P()
620 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
623 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr5, 0, in TEST_P()
627 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_P()
646 int ret; in TEST_P() local
667 ret = vmm_alloc(aspace, "mmutest", PAGE_SIZE, &ptr[i], 0, vmm_flags, in TEST_P()
669 if (ret) { in TEST_P()
675 ret = vmm_get_obj(aspace, (vaddr_t)ptr[i], PAGE_SIZE, &slice); in TEST_P()
676 ASSERT_EQ(NO_ERROR, ret); in TEST_P()
838 int ret; in TEST() local
841 ret = pmm_alloc(&vmm_obj, &vmm_obj_ref, 1, PMM_ALLOC_FLAG_CONTIGUOUS, 0); in TEST()
842 ASSERT_EQ(NO_ERROR, ret, "pmm_alloc failed\n"); in TEST()
845 ret = vmm_alloc_obj(aspace, "mmutest_wx", vmm_obj, 0, PAGE_SIZE, &ptr, 0, 0, in TEST()
847 EXPECT_EQ(ERR_INVALID_ARGS, ret); in TEST()
875 int ret; in TEST() local
886 ret = vmm_alloc(aspace, "ns_conflict_ns", PAGE_SIZE, &ptr_ns, in TEST()
889 if (ret == ERR_NOT_SUPPORTED) { in TEST()
892 EXPECT_EQ(NO_ERROR, ret); in TEST()
894 ret = arch_mmu_query(&aspace->arch_aspace, (vaddr_t)ptr_ns, NULL, in TEST()
896 EXPECT_EQ(NO_ERROR, ret); in TEST()
907 ret = vmm_alloc(aspace, "ns_conflict_s", PAGE_SIZE, &ptr_s, PAGE_SIZE_SHIFT, in TEST()
909 if (ret) { in TEST()
912 ret = arch_mmu_query(&aspace->arch_aspace, (vaddr_t)ptr_s, NULL, in TEST()
914 if (!ret) { in TEST()
1022 status_t ret = vmm_create_aspace_with_quota(&_state->aspace, "mmutestpmm", in TEST_F_SETUP() local
1024 ASSERT_EQ(NO_ERROR, ret); in TEST_F_SETUP()
1042 status_t ret; in TEST_F() local
1044 ret = vmm_alloc(_state->aspace, "test_reserve", PAGE_SIZE * 5002, &ptr, 0, in TEST_F()
1046 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1047 ret = vmm_alloc(_state->aspace, "test_from_reserved", PAGE_SIZE * 2, &ptr, in TEST_F()
1050 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1057 ret = vmm_alloc(_state->aspace, "test_failure", PAGE_SIZE * 5000, in TEST_F()
1059 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_F()
1060 ret = vmm_alloc(_state->aspace, "test_success", PAGE_SIZE * 2, in TEST_F()
1062 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1063 ret = vmm_alloc(temp_aspace, "test_from_reserved_success", PAGE_SIZE * 5000, in TEST_F()
1066 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1074 status_t ret; in TEST_F() local
1075 ret = vmm_alloc(_state->aspace, "test_reserve", PAGE_SIZE * 2, &ptr, 0, in TEST_F()
1077 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1078 ret = vmm_alloc_contiguous(_state->aspace, "test_from_reserved_continuous", in TEST_F()
1082 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1088 status_t ret; in TEST_F() local
1089 ret = vmm_alloc(_state->aspace, "test_reserve", PAGE_SIZE * 2, &ptr, 0, in TEST_F()
1091 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1092 ret = vmm_alloc(_state->aspace, "test_from_reserved_too_small", in TEST_F()
1096 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_F()
1102 status_t ret; in TEST_F() local
1103 ret = vmm_alloc(_state->aspace, "test_reserve", PAGE_SIZE * 2, &ptr, 0, in TEST_F()
1105 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1107 ret = vmm_alloc(_state->aspace, "test_from_reserved_outside_region", in TEST_F()
1111 ASSERT_EQ(ERR_INVALID_ARGS, ret); in TEST_F()
1123 status_t ret = vmm_create_aspace_with_quota(&_state->aspace, "mmutestrg", in TEST_F_SETUP() local
1125 ASSERT_EQ(NO_ERROR, ret); in TEST_F_SETUP()
1138 status_t ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE + 1, &ptr, in TEST_F() local
1140 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_F()
1168 status_t ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE * 2, &ptr, in TEST_F() local
1171 ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE, &ptr, 0, in TEST_F()
1176 ret = vmm_get_obj(_state->aspace, (vaddr_t)ptr, PAGE_SIZE, &slice); in TEST_F()
1177 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1187 status_t ret = in TEST_F() local
1191 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1192 ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE, &ptr, 0, in TEST_F()
1194 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1195 ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE, &ptr, 0, in TEST_F()
1197 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_F()
1205 status_t ret = in TEST_F() local
1208 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1209 ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE, &ptr, 0, in TEST_F()
1211 ASSERT_EQ(NO_ERROR, ret); in TEST_F()
1212 ret = vmm_alloc(_state->aspace, "test_alloc", PAGE_SIZE, &ptr, 0, in TEST_F()
1214 ASSERT_EQ(ERR_NO_MEMORY, ret); in TEST_F()