Lines Matching refs:test

100 	struct test_info	*test;  in ac_mem_test_start()  local
153 for (test = test_base; test != NULL; test = test->next) { in ac_mem_test_start()
154 if (test->board == softsp->board && in ac_mem_test_start()
155 test->bank == pkt->bank) in ac_mem_test_start()
158 if (test == NULL) { in ac_mem_test_start()
169 if (ddi_copyout(&test->info, pkt->cmd_cfga.private, in ac_mem_test_start()
185 test = kmem_zalloc(sizeof (struct test_info), KM_SLEEP); in ac_mem_test_start()
186 test->va = vmem_alloc(heap_arena, PAGESIZE, VM_SLEEP); in ac_mem_test_start()
189 test->mem_info = mem_info; in ac_mem_test_start()
190 test->board = softsp->board; in ac_mem_test_start()
191 test->bank = pkt->bank; in ac_mem_test_start()
192 test->bufp = kmem_alloc(TEST_PAGESIZE, KM_SLEEP); in ac_mem_test_start()
193 test->info.handle = atomic_inc_32_nv(&mem_test_sequence_id); in ac_mem_test_start()
194 (void) drv_getparm(PPID, (ulong_t *)(&(test->info.tester_pid))); in ac_mem_test_start()
195 test->info.prev_condition = mem_info->condition; in ac_mem_test_start()
196 test->info.page_size = TEST_PAGESIZE; in ac_mem_test_start()
198 test->info.line_size = cpunodes[CPU->cpu_id].ecache_linesize; in ac_mem_test_start()
201 test->info.afar_base = GRP_REALBASE(decode); in ac_mem_test_start()
202 test->info.bank_size = GRP_UK2SPAN(decode); in ac_mem_test_start()
205 if (ddi_copyout(&test->info, pkt->cmd_cfga.private, in ac_mem_test_start()
209 kmem_free(test->bufp, TEST_PAGESIZE); in ac_mem_test_start()
210 vmem_free(heap_arena, test->va, PAGESIZE); in ac_mem_test_start()
211 kmem_free(test, sizeof (struct test_info)); in ac_mem_test_start()
221 test->next = test_base; in ac_mem_test_start()
222 test_base = test; in ac_mem_test_start()
229 test->info.handle, test->board, test->bank); in ac_mem_test_start()
237 struct test_info *test, **prev; in ac_mem_test_stop() local
251 for (test = test_base; test != NULL; test = test->next) { in ac_mem_test_stop()
252 if (test->info.handle == stop.handle) in ac_mem_test_stop()
254 prev = &test->next; in ac_mem_test_stop()
256 if (test == NULL) { in ac_mem_test_stop()
267 test->info.handle, test->board, in ac_mem_test_stop()
268 test->bank, stop.condition); in ac_mem_test_stop()
272 *prev = test->next; in ac_mem_test_stop()
275 while (test->in_test != 0) in ac_mem_test_stop()
281 vmem_free(heap_arena, test->va, PAGESIZE); in ac_mem_test_stop()
282 kmem_free(test->bufp, TEST_PAGESIZE); in ac_mem_test_stop()
285 test->mem_info->condition = stop.condition; in ac_mem_test_stop()
286 test->mem_info->status_change = ddi_get_time(); in ac_mem_test_stop()
288 test->mem_info->busy = FALSE; in ac_mem_test_stop()
291 kmem_free(test, sizeof (struct test_info)); in ac_mem_test_stop()
301 struct test_info *test, **prev; in ac_mem_test_stop_on_close() local
310 for (test = test_base; test != NULL; test = test->next) { in ac_mem_test_stop_on_close()
311 if (test->board == board && test->bank == bank) in ac_mem_test_stop_on_close()
313 prev = &test->next; in ac_mem_test_stop_on_close()
315 if (test == NULL) { in ac_mem_test_stop_on_close()
324 "board %d, bank %d, condition %d", test->info.handle, in ac_mem_test_stop_on_close()
325 test->board, test->bank, condition); in ac_mem_test_stop_on_close()
329 *prev = test->next; in ac_mem_test_stop_on_close()
331 ASSERT(test->in_test == 0); in ac_mem_test_stop_on_close()
336 vmem_free(heap_arena, test->va, PAGESIZE); in ac_mem_test_stop_on_close()
337 kmem_free(test->bufp, TEST_PAGESIZE); in ac_mem_test_stop_on_close()
340 test->mem_info->condition = condition; in ac_mem_test_stop_on_close()
341 test->mem_info->status_change = ddi_get_time(); in ac_mem_test_stop_on_close()
343 test->mem_info->busy = FALSE; in ac_mem_test_stop_on_close()
346 kmem_free(test, sizeof (struct test_info)); in ac_mem_test_stop_on_close()
354 struct test_info *test; in ac_mem_test_read() local
394 for (test = test_base; test != NULL; test = test->next) { in ac_mem_test_read()
395 if (test->info.handle == t_read.handle) in ac_mem_test_read()
398 if (test == NULL) { in ac_mem_test_read()
405 atomic_inc_32(&test->in_test); in ac_mem_test_read()
410 test->info.bank_size / test->info.page_size) || in ac_mem_test_read()
413 test->info.page_size / test->info.line_size) || in ac_mem_test_read()
415 test->info.page_size / test->info.line_size) || in ac_mem_test_read()
417 test->info.page_size / test->info.line_size)) { in ac_mem_test_read()
423 page_offset = t_read.address.line_offset * test->info.line_size; in ac_mem_test_read()
424 page_pa = test->info.afar_base + in ac_mem_test_read()
425 t_read.address.page_num * test->info.page_size; in ac_mem_test_read()
426 dst_va = test->bufp + page_offset; in ac_mem_test_read()
427 src_va = test->va + page_offset; in ac_mem_test_read()
433 ac_mapin(page_pa, test->va); in ac_mem_test_read()
443 test->info.line_size); in ac_mem_test_read()
473 ac_unmap(test->va); in ac_mem_test_read()
494 t_read.address.line_count * test->info.line_size, flag) != 0) { in ac_mem_test_read()
499 atomic_dec_32(&test->in_test); in ac_mem_test_read()
506 struct test_info *test; in ac_mem_test_write() local
541 for (test = test_base; test != NULL; test = test->next) { in ac_mem_test_write()
542 if (test->info.handle == t_write.handle) in ac_mem_test_write()
545 if (test == NULL) { in ac_mem_test_write()
551 atomic_inc_32(&test->in_test); in ac_mem_test_write()
556 test->info.bank_size / test->info.page_size) || in ac_mem_test_write()
559 test->info.page_size / test->info.line_size) || in ac_mem_test_write()
561 test->info.page_size / test->info.line_size) || in ac_mem_test_write()
563 test->info.page_size / test->info.line_size)) { in ac_mem_test_write()
569 page_offset = t_write.address.line_offset * test->info.line_size; in ac_mem_test_write()
570 page_pa = test->info.afar_base + in ac_mem_test_write()
571 t_write.address.page_num * test->info.page_size; in ac_mem_test_write()
572 src_va = test->bufp + page_offset; in ac_mem_test_write()
573 dst_va = test->va + page_offset; in ac_mem_test_write()
577 t_write.address.line_count * test->info.line_size, flag) != 0) { in ac_mem_test_write()
586 ac_mapin(page_pa, test->va); in ac_mem_test_write()
592 test->info.line_size); in ac_mem_test_write()
597 ac_unmap(test->va); in ac_mem_test_write()
603 atomic_dec_32(&test->in_test); in ac_mem_test_write()