Lines Matching defs:isadmap

222 	isadma_devstate_t *isadmap;	/* per isadma state pointer */
241 isadmap = ddi_get_soft_state(per_isadma_state, instance);
242 isadmap->isadma_dip = dip;
246 "reg", (caddr_t)&isadmap->isadma_regp,
247 &isadmap->isadma_reglen) != DDI_SUCCESS) {
253 mutex_init(&isadmap->isadma_access_lock, NULL, MUTEX_DRIVER,
257 cv_init(&isadmap->isadma_access_cv, NULL, CV_DRIVER, NULL);
282 isadma_devstate_t *isadmap =
287 cv_destroy(&isadmap->isadma_access_cv);
289 mutex_destroy(&isadmap->isadma_access_lock);
292 kmem_free(isadmap->isadma_regp, isadmap->isadma_reglen);
306 isadma_check_waiters(isadma_devstate_t *isadmap)
308 if (isadmap->isadma_want > isadma_max_waiter)
309 isadma_max_waiter = isadmap->isadma_want;
311 if (isadmap->isadma_want < isadma_min_waiter)
312 isadma_min_waiter = isadmap->isadma_want;
317 isadma_dmawait(isadma_devstate_t *isadmap)
320 ASSERT(mutex_owned(&isadmap->isadma_access_lock));
323 while (isadmap->isadma_ldip != NULL) {
325 isadmap->isadma_want++;
326 cv_wait(&isadmap->isadma_access_cv,
327 &isadmap->isadma_access_lock);
328 isadmap->isadma_want--;
334 isadma_wakeup(isadma_devstate_t *isadmap)
337 ASSERT(mutex_owned(&isadmap->isadma_access_lock));
343 if (isadmap->isadma_want > 0 && isadmap->isadma_ldip == NULL) {
344 cv_signal(&isadmap->isadma_access_cv);
415 isadma_devstate_t *isadmap = hdlp->ahi_common.ah_bus_private;
426 isadma_check_waiters(isadmap);
428 mutex_enter(&isadmap->isadma_access_lock);
429 isadma_dmawait(isadmap); /* wait until on-going dma completes */
441 isadma_wakeup(isadmap);
442 mutex_exit(&isadmap->isadma_access_lock);
456 isadma_devstate_t *isadmap = hdlp->ahi_common.ah_bus_private;
467 isadma_check_waiters(isadmap);
469 mutex_enter(&isadmap->isadma_access_lock);
470 isadma_dmawait(isadmap); /* wait until on-going dma completes */
483 isadma_wakeup(isadmap);
484 mutex_exit(&isadmap->isadma_access_lock);
515 isadma_devstate_t *isadmap = hdlp->ahi_common.ah_bus_private;
526 isadma_check_waiters(isadmap);
528 mutex_enter(&isadmap->isadma_access_lock);
530 if (isadmap->isadma_ldip == hdlp->ahi_common.ah_dip) { /* owned lock? */
532 isadmap->isadma_ldip = NULL; /* reset lock owner */
539 isadma_dmawait(isadmap);
542 isadmap->isadma_ldip = hdlp->ahi_common.ah_dip;
559 isadma_wakeup(isadmap);
560 mutex_exit(&isadmap->isadma_access_lock);
573 isadma_devstate_t *isadmap = hdlp->ahi_common.ah_bus_private;
584 isadma_check_waiters(isadmap);
586 mutex_enter(&isadmap->isadma_access_lock);
587 isadma_dmawait(isadmap); /* wait until on-going dma completes */
600 isadma_wakeup(isadmap);
601 mutex_exit(&isadmap->isadma_access_lock);
624 isadma_devstate_t *isadmap = ddi_get_soft_state(per_isadma_state,
645 (void *)isadmap->isadma_regp, (void *)regp));
655 !IS_SAME_REG(child_regp, isadmap->isadma_regp))
664 hp->ahi_common.ah_bus_private = isadmap;
684 if (IS_SAME_REG(child_regp, isadmap->isadma_regp)) {