Lines Matching refs:test

61 	caddr_t			va;		/* test target VA */
63 uint_t in_test; /* count of threads in test */
100 struct test_info *test;
135 * again, instead return the current test info.
149 * find the test entry
153 for (test = test_base; test != NULL; test = test->next) {
154 if (test->board == softsp->board &&
155 test->bank == pkt->bank)
158 if (test == NULL) {
167 * return the current test information to the new caller
169 if (ddi_copyout(&test->info, pkt->cmd_cfga.private,
182 * at this point, we have an available bank to test.
183 * create a test buffer
185 test = kmem_zalloc(sizeof (struct test_info), KM_SLEEP);
186 test->va = vmem_alloc(heap_arena, PAGESIZE, VM_SLEEP);
188 /* fill in all the test info details now */
189 test->mem_info = mem_info;
190 test->board = softsp->board;
191 test->bank = pkt->bank;
192 test->bufp = kmem_alloc(TEST_PAGESIZE, KM_SLEEP);
193 test->info.handle = atomic_inc_32_nv(&mem_test_sequence_id);
194 (void) drv_getparm(PPID, (ulong_t *)(&(test->info.tester_pid)));
195 test->info.prev_condition = mem_info->condition;
196 test->info.page_size = TEST_PAGESIZE;
198 test->info.line_size = cpunodes[CPU->cpu_id].ecache_linesize;
201 test->info.afar_base = GRP_REALBASE(decode);
202 test->info.bank_size = GRP_UK2SPAN(decode);
205 if (ddi_copyout(&test->info, pkt->cmd_cfga.private,
208 /* oh well, tear down the test now */
209 kmem_free(test->bufp, TEST_PAGESIZE);
210 vmem_free(heap_arena, test->va, PAGESIZE);
211 kmem_free(test, sizeof (struct test_info));
219 /* finally link us into the test database */
221 test->next = test_base;
222 test_base = test;
228 cmn_err(CE_NOTE, "!memtest: start test[%u]: board %d, bank %d",
229 test->info.handle, test->board, test->bank);
237 struct test_info *test, **prev;
240 /* get test result information */
248 /* find the test */
251 for (test = test_base; test != NULL; test = test->next) {
252 if (test->info.handle == stop.handle)
253 break; /* found the test */
254 prev = &test->next;
256 if (test == NULL) {
265 "!memtest: stop test[%u]: board %d, bank %d,"
267 test->info.handle, test->board,
268 test->bank, stop.condition);
271 /* first unlink us from the test list (to allow no more entries) */
272 *prev = test->next;
275 while (test->in_test != 0)
280 /* clean up the test related allocations */
281 vmem_free(heap_arena, test->va, PAGESIZE);
282 kmem_free(test->bufp, TEST_PAGESIZE);
285 test->mem_info->condition = stop.condition;
286 test->mem_info->status_change = ddi_get_time();
288 test->mem_info->busy = FALSE;
290 /* finally, delete the test element */
291 kmem_free(test, sizeof (struct test_info));
301 struct test_info *test, **prev;
307 /* find the test */
310 for (test = test_base; test != NULL; test = test->next) {
311 if (test->board == board && test->bank == bank)
312 break; /* found the test */
313 prev = &test->next;
315 if (test == NULL) {
316 /* No test running, nothing to do. */
323 cmn_err(CE_NOTE, "!memtest: stop test[%u] on close: "
324 "board %d, bank %d, condition %d", test->info.handle,
325 test->board, test->bank, condition);
328 /* first unlink us from the test list (to allow no more entries) */
329 *prev = test->next;
331 ASSERT(test->in_test == 0);
335 /* clean up the test related allocations */
336 vmem_free(heap_arena, test->va, PAGESIZE);
337 kmem_free(test->bufp, TEST_PAGESIZE);
340 test->mem_info->condition = condition;
341 test->mem_info->status_change = ddi_get_time();
343 test->mem_info->busy = FALSE;
345 /* finally, delete the test element */
346 kmem_free(test, sizeof (struct test_info));
354 struct test_info *test;
394 for (test = test_base; test != NULL; test = test->next) {
395 if (test->info.handle == t_read.handle)
398 if (test == NULL) {
405 atomic_inc_32(&test->in_test);
410 test->info.bank_size / test->info.page_size) ||
413 test->info.page_size / test->info.line_size) ||
415 test->info.page_size / test->info.line_size) ||
417 test->info.page_size / test->info.line_size)) {
423 page_offset = t_read.address.line_offset * test->info.line_size;
424 page_pa = test->info.afar_base +
425 t_read.address.page_num * test->info.page_size;
426 dst_va = test->bufp + page_offset;
427 src_va = test->va + page_offset;
433 ac_mapin(page_pa, test->va);
443 test->info.line_size);
473 ac_unmap(test->va);
494 t_read.address.line_count * test->info.line_size, flag) != 0) {
499 atomic_dec_32(&test->in_test);
506 struct test_info *test;
541 for (test = test_base; test != NULL; test = test->next) {
542 if (test->info.handle == t_write.handle)
545 if (test == NULL) {
551 atomic_inc_32(&test->in_test);
556 test->info.bank_size / test->info.page_size) ||
559 test->info.page_size / test->info.line_size) ||
561 test->info.page_size / test->info.line_size) ||
563 test->info.page_size / test->info.line_size)) {
569 page_offset = t_write.address.line_offset * test->info.line_size;
570 page_pa = test->info.afar_base +
571 t_write.address.page_num * test->info.page_size;
572 src_va = test->bufp + page_offset;
573 dst_va = test->va + page_offset;
577 t_write.address.line_count * test->info.line_size, flag) != 0) {
586 ac_mapin(page_pa, test->va);
592 test->info.line_size);
597 ac_unmap(test->va);
603 atomic_dec_32(&test->in_test);