Lines Matching defs:hm

151 hment_put_reserve(hment_t *hm)
155 hm->hm_next = hment_reserve_pool;
156 hment_reserve_pool = hm;
167 hment_t *hm = NULL;
179 hm = hment_reserve_pool;
180 hment_reserve_pool = hm->hm_next;
184 return (hm);
194 hment_t *hm = NULL;
205 hm = kmem_cache_alloc(hment_cache, km_flag);
206 if (hm == NULL ||
210 hment_put_reserve(hm);
217 if (hm == NULL) {
219 hm = hment_get_reserve();
225 if (hm == NULL && can_steal_post_boot)
226 hm = hment_steal();
231 if (hm == NULL)
232 hm = hment_get_reserve();
237 if (hm == NULL)
242 hm->hm_entry = 0;
243 hm->hm_htable = NULL;
244 hm->hm_hashlink = null_avl_link;
245 hm->hm_next = NULL;
246 hm->hm_prev = NULL;
247 hm->hm_pfn = PFN_INVALID;
248 return (hm);
258 hment_free(hment_t *hm)
264 bzero(hm, sizeof (*hm));
269 hment_put_reserve(hm);
271 kmem_cache_free(hment_cache, hm);
310 hment_insert(hment_t *hm, page_t *pp)
321 hm->hm_next = pp->p_mapping;
323 ((hment_t *)pp->p_mapping)->hm_prev = hm;
324 pp->p_mapping = hm;
329 idx = HMENT_HASH(hm->hm_htable->ht_pfn, hm->hm_entry);
332 avl_add(&hment_table[idx], hm);
355 hment_t *hm = NULL;
369 if (hm == NULL)
393 if (hm == NULL)
402 if (hm != NULL) {
403 hm->hm_htable = pp->p_mapping;
404 hm->hm_entry = pp->p_mlentry;
405 hm->hm_pfn = pp->p_pagenum;
409 hment_insert(hm, pp);
424 if (hm != NULL)
428 hm = hment_alloc();
437 hment_free(hm);
438 hm = NULL;
442 return (hm);
451 hment_assign(htable_t *htable, uint_t entry, page_t *pp, hment_t *hm)
461 ASSERT(hm == NULL);
478 ASSERT(hm != NULL);
479 hm->hm_htable = htable;
480 hm->hm_entry = entry;
481 hm->hm_pfn = pp->p_pagenum;
482 hment_insert(hm, pp);
493 hment_t *hm;
501 hm = HMENT_EMBEDDED;
504 hm = NULL;
509 hm = (hment_t *)pp->p_mapping;
511 hm = prev->hm_next;
514 if (hm != NULL) {
515 *ht = hm->hm_htable;
516 *entry = hm->hm_entry;
519 return (hm);
533 hment_t *hm;
561 hm = avl_find(&hment_table[idx], &dummy, &where);
562 if (hm == NULL)
566 avl_remove(&hment_table[idx], hm);
572 if (hm->hm_next)
573 hm->hm_next->hm_prev = hm->hm_prev;
574 if (hm->hm_prev)
575 hm->hm_prev->hm_next = hm->hm_next;
577 pp->p_mapping = hm->hm_next;
580 hm->hm_hashlink = null_avl_link;
581 hm->hm_next = NULL;
582 hm->hm_prev = NULL;
584 return (hm);
593 hment_t *hm;
598 hm = kmem_cache_alloc(hment_cache, KM_NOSLEEP);
599 if (hm == NULL)
601 hment_put_reserve(hm);
611 hment_t *hm;
618 hm = hment_get_reserve();
619 if (hm == NULL)
621 kmem_cache_free(hment_cache, hm);
675 hment_t *hm;
700 for (hm = larger->p_mapping; hm;
701 hm = hm->hm_next) {
702 if (hm->hm_htable->ht_level == szc)
725 hment_t *hm = NULL;
757 for (hm = pp->p_mapping; hm; hm = hm->hm_next) {
758 ht = hm->hm_htable;
775 hm2 = hati_page_unmap(pp, ht, hm->hm_entry);
776 ASSERT(hm2 == hm);
778 return (hm);