Lines Matching defs:dhp

78 #define	HOLD_DHP_LOCK(dhp)  if (dhp->dh_flags & DEVMAP_ALLOW_REMAP) \
79 { mutex_enter(&dhp->dh_lock); }
81 #define RELE_DHP_LOCK(dhp) if (dhp->dh_flags & DEVMAP_ALLOW_REMAP) \
82 { mutex_exit(&dhp->dh_lock); }
142 devmap_handle_t *dhp = (devmap_handle_t *)dhc;
150 * First to check if this function has been called for this dhp.
152 if (dhp->dh_flags & DEVMAP_SETUP_DONE)
155 if ((dhp->dh_prot & dhp->dh_orig_maxprot & maxprot) != dhp->dh_prot)
175 dhp->dh_pcookie = (devmap_pmem_cookie_t)pcp;
177 dhp->dh_roff = ptob(btop(off));
179 i_ddi_cacheattr_to_hatacc(cache_attr, &dhp->dh_hat_attr);
182 dhp->dh_cookie = DEVMAP_PMEM_COOKIE;
183 dhp->dh_flags |= (flags & DEVMAP_SETUP_FLAGS);
184 dhp->dh_len = ptob(btopr(len));
186 dhp->dh_maxprot = maxprot & dhp->dh_orig_maxprot;
187 ASSERT((dhp->dh_prot & dhp->dh_orig_maxprot & maxprot) == dhp->dh_prot);
190 bcopy(callbackops, &dhp->dh_callbackops,
197 if (dhp->dh_flags & DEVMAP_ALLOW_REMAP) {
198 mutex_init(&dhp->dh_lock, NULL, MUTEX_DEFAULT, NULL);
199 dhp->dh_flags |= DEVMAP_LOCK_INITED;
202 dhp->dh_flags |= DEVMAP_SETUP_DONE;
217 devmap_handle_t *dhp = (devmap_handle_t *)dhc;
225 if ((dhp->dh_flags & DEVMAP_SETUP_DONE) == 0 ||
226 (dhp->dh_flags & DEVMAP_ALLOW_REMAP) == 0)
233 if ((dhp->dh_prot & dhp->dh_orig_maxprot & maxprot) != dhp->dh_prot)
248 HOLD_DHP_LOCK(dhp);
250 * Unload the old mapping of pages reloated with this dhp, so next
253 * the dhp lock so other faults dont reestablish the mappings.
255 hat_unload(dhp->dh_seg->s_as->a_hat, dhp->dh_uvaddr,
256 dhp->dh_len, HAT_UNLOAD|HAT_UNLOAD_OTHER);
259 i_ddi_cacheattr_to_hatacc(cache_attr, &dhp->dh_hat_attr);
261 dhp->dh_pcookie = cookie;
262 dhp->dh_roff = ptob(btop(off));
263 dhp->dh_len = ptob(btopr(len));
266 dhp->dh_flags &= ~DEVMAP_FLAG_LARGE;
268 dhp->dh_maxprot = maxprot & dhp->dh_orig_maxprot;
269 ASSERT((dhp->dh_prot & dhp->dh_orig_maxprot & maxprot) == dhp->dh_prot);
270 RELE_DHP_LOCK(dhp);