Lines Matching refs:intrmap
46 #define INTRMAP_PRIVATE(intrmap) ((intrmap_private_t *)intrmap)
232 alloc_tbl_entry(intrmap_t *intrmap)
237 mutex_enter(&intrmap->intrmap_lock);
238 idx = intrmap->intrmap_free;
240 bitset_add(&intrmap->intrmap_map, idx);
241 intrmap->intrmap_free =
242 bitset_find_free(&intrmap->intrmap_map, idx + 1);
243 mutex_exit(&intrmap->intrmap_lock);
248 mutex_exit(&intrmap->intrmap_lock);
266 alloc_tbl_multi_entries(intrmap_t *intrmap, uint_t cnt)
271 mutex_enter(&intrmap->intrmap_lock);
272 pos = intrmap->intrmap_free;
273 idx = bitset_find_multi_free(&intrmap->intrmap_map, pos, cnt);
277 intrmap->intrmap_free = bitset_find_free(
278 &intrmap->intrmap_map, idx + cnt);
281 bitset_add(&intrmap->intrmap_map, idx + i);
283 mutex_exit(&intrmap->intrmap_lock);
287 mutex_exit(&intrmap->intrmap_lock);
304 intrmap_t *intrmap;
346 intrmap = kmem_zalloc(sizeof (intrmap_t), KM_SLEEP);
352 &(intrmap->intrmap_dma_hdl)) != DDI_SUCCESS) {
353 kmem_free(intrmap, sizeof (intrmap_t));
357 intrmap->intrmap_size = 1 << (intrmap_irta_s + 1);
358 size = intrmap->intrmap_size * INTRMAP_RTE_SIZE;
359 if (ddi_dma_mem_alloc(intrmap->intrmap_dma_hdl,
365 &(intrmap->intrmap_vaddr),
367 &(intrmap->intrmap_acc_hdl)) != DDI_SUCCESS) {
368 ddi_dma_free_handle(&(intrmap->intrmap_dma_hdl));
369 kmem_free(intrmap, sizeof (intrmap_t));
373 ASSERT(!((uintptr_t)intrmap->intrmap_vaddr & MMU_PAGEOFFSET));
374 bzero(intrmap->intrmap_vaddr, size);
375 intrmap->intrmap_paddr = pfn_to_pa(
376 hat_getpfnum(kas.a_hat, intrmap->intrmap_vaddr));
378 mutex_init(&(intrmap->intrmap_lock), NULL, MUTEX_DRIVER, NULL);
379 bitset_init(&intrmap->intrmap_map);
380 bitset_resize(&intrmap->intrmap_map, intrmap->intrmap_size);
381 intrmap->intrmap_free = 0;
383 immu->immu_intrmap = intrmap;
481 intrmap_t *intrmap;
484 intrmap = immu->immu_intrmap;
486 irta_reg = intrmap->intrmap_paddr | intrmap_irta_s;
670 intrmap_t *intrmap;
692 intrmap = immu->immu_intrmap;
695 idx = alloc_tbl_entry(intrmap);
697 idx = alloc_tbl_multi_entries(intrmap, count);
751 intrmap_t *intrmap;
765 intrmap = immu->immu_intrmap;
801 bcopy(&irte, intrmap->intrmap_vaddr +
813 bcopy(&irte, intrmap->intrmap_vaddr +
830 intrmap_t *intrmap;
840 intrmap = immu->immu_intrmap;
843 bzero(intrmap->intrmap_vaddr + idx * INTRMAP_RTE_SIZE,
848 mutex_enter(&intrmap->intrmap_lock);
849 bitset_del(&intrmap->intrmap_map, idx);
850 if (intrmap->intrmap_free == INTRMAP_IDX_FULL) {
851 intrmap->intrmap_free = idx;
853 mutex_exit(&intrmap->intrmap_lock);