Lines Matching refs:map
36 test_mem_map_notify(void *cb_ctx, struct spdk_mem_map *map,
73 test_mem_map_notify_fail(void *cb_ctx, struct spdk_mem_map *map,
87 CU_ASSERT(spdk_mem_map_set_translation(map, (uint64_t)vaddr, (uint64_t)size, (uint64_t)vaddr) == 0);
92 reg_addr = spdk_mem_map_translate(map, (uint64_t)vaddr, ®_size);
94 spdk_mem_map_clear_translation(map, (uint64_t)vaddr, size);
108 test_mem_map_notify_checklen(void *cb_ctx, struct spdk_mem_map *map,
160 struct spdk_mem_map *map, *failed_map;
164 map = spdk_mem_map_alloc(default_translation, &test_mem_map_ops, NULL);
165 SPDK_CU_ASSERT_FATAL(map != NULL);
166 spdk_mem_map_free(&map);
167 CU_ASSERT(map == NULL);
169 map = spdk_mem_map_alloc(default_translation, NULL, NULL);
170 SPDK_CU_ASSERT_FATAL(map != NULL);
183 failed_map = spdk_mem_map_alloc(default_translation, &test_map_ops_notify_fail, map);
189 reg = spdk_mem_map_translate(map, 2 * i * VALUE_2MB, &size);
198 spdk_mem_map_free(&map);
199 CU_ASSERT(map == NULL);
205 struct spdk_mem_map *map;
211 map = spdk_mem_map_alloc(default_translation, &test_mem_map_ops, NULL);
212 SPDK_CU_ASSERT_FATAL(map != NULL);
215 addr = spdk_mem_map_translate(map, 10, NULL);
219 rc = spdk_mem_map_set_translation(map, VALUE_2MB, 1234, VALUE_2MB);
223 rc = spdk_mem_map_set_translation(map, 1234, VALUE_2MB, VALUE_2MB);
227 rc = spdk_mem_map_set_translation(map, VALUE_2MB, VALUE_2MB, VALUE_2MB);
231 rc = spdk_mem_map_set_translation(map, 0, 3 * VALUE_2MB, 0);
236 addr = spdk_mem_map_translate(map, 0, &mapping_length);
242 addr = spdk_mem_map_translate(map, VALUE_4KB, &mapping_length);
247 rc = spdk_mem_map_clear_translation(map, VALUE_2MB, VALUE_2MB);
251 addr = spdk_mem_map_translate(map, 0, NULL);
256 addr = spdk_mem_map_translate(map, 0, &mapping_length);
262 addr = spdk_mem_map_translate(map, VALUE_2MB, &mapping_length);
267 addr = spdk_mem_map_translate(map, VALUE_2MB, NULL);
271 addr = spdk_mem_map_translate(map, 2 * VALUE_2MB, NULL);
281 addr = spdk_mem_map_translate(map, 0, &mapping_length);
287 addr = spdk_mem_map_translate(map, VALUE_4KB, &mapping_length);
293 addr = spdk_mem_map_translate(map, 3 * VALUE_2MB - 196, &mapping_length);
298 rc = spdk_mem_map_clear_translation(map, 0, VALUE_2MB);
302 addr = spdk_mem_map_translate(map, 0, NULL);
306 rc = spdk_mem_map_clear_translation(map, 2 * VALUE_2MB, VALUE_2MB);
310 addr = spdk_mem_map_translate(map, 2 * VALUE_2MB, NULL);
314 rc = spdk_mem_map_set_translation(map, 0xffffffe00000ULL, VALUE_2MB, 0x1234);
318 addr = spdk_mem_map_translate(map, 0xffffffe00000ULL, NULL);
322 rc = spdk_mem_map_set_translation(map, 0x1000000000000ULL, VALUE_2MB, 0x5678);
326 rc = spdk_mem_map_set_translation(map, 0xffffffe00000ULL, VALUE_2MB * 2, 0x123123);
329 spdk_mem_map_free(&map);
330 CU_ASSERT(map == NULL);
332 /* Allocate a map without a contiguous region checker */
333 map = spdk_mem_map_alloc(default_translation, &test_mem_map_ops_no_contig, NULL);
334 SPDK_CU_ASSERT_FATAL(map != NULL);
336 /* map three contiguous regions */
337 rc = spdk_mem_map_set_translation(map, 0, 3 * VALUE_2MB, 0);
342 addr = spdk_mem_map_translate(map, 0, &mapping_length);
348 addr = spdk_mem_map_translate(map, 0, &mapping_length);
353 rc = spdk_mem_map_clear_translation(map, 0, VALUE_2MB * 3);
356 spdk_mem_map_free(&map);
357 CU_ASSERT(map == NULL);
364 struct spdk_mem_map *map;
367 map = spdk_mem_map_alloc(default_translation, &test_mem_map_ops, NULL);
368 SPDK_CU_ASSERT_FATAL(map != NULL);
414 spdk_mem_map_free(&map);
415 CU_ASSERT(map == NULL);
421 struct spdk_mem_map *map, *newmap;
428 map = spdk_mem_map_alloc(default_translation,
430 SPDK_CU_ASSERT_FATAL(map != NULL);
464 spdk_mem_map_free(&map);
465 CU_ASSERT(map == NULL);
481 /* Initialize the memory map */
497 CU_add_test(suite, "alloc and free memory map", test_mem_map_alloc_free) == NULL ||
498 CU_add_test(suite, "mem map translation", test_mem_map_translation) == NULL ||
499 CU_add_test(suite, "mem map registration", test_mem_map_registration) == NULL ||
500 CU_add_test(suite, "mem map adjacent registrations", test_mem_map_registration_adjacent) == NULL