Lines Matching refs:npages

293 iommu_tlb_flush(struct sbus_soft_state *softsp, ioaddr_t addr, pgcnt_t npages)  in iommu_tlb_flush()  argument
300 if (npages == 1) { in iommu_tlb_flush()
306 hiaddr = addr + (ioaddr_t)(npages * IOMMU_PAGESIZE); in iommu_tlb_flush()
360 pgcnt_t npages; in iommu_remove_mappings() local
364 pgcnt_t npages = mp->dmai_ndvmapages; in iommu_remove_mappings() local
378 npages = mp->dmai_ndvmapages; in iommu_remove_mappings()
396 kmem_free(walk->pfn, sizeof (pfn_t) * (npages + 1)); in iommu_remove_mappings()
402 while (npages) { in iommu_remove_mappings()
408 npages--; in iommu_remove_mappings()
421 pgcnt_t npages; in iommu_create_vaddr_mappings() local
441 npages = iommu_btopr(mp->dmai_size + offset); in iommu_create_vaddr_mappings()
444 diag_tlb_flush = npages > tlb_flush_using_diag ? 1 : 0; in iommu_create_vaddr_mappings()
468 iomemp->npages = npages; in iommu_create_vaddr_mappings()
469 pfnp = iomemp->pfn = kmem_zalloc(sizeof (*pfnp) * (npages + 1), in iommu_create_vaddr_mappings()
476 ASSERT(npages != 0); in iommu_create_vaddr_mappings()
480 iommu_tlb_flush(softsp, ioaddr, npages); in iommu_create_vaddr_mappings()
542 npages--; in iommu_create_vaddr_mappings()
548 } while (npages != 0); in iommu_create_vaddr_mappings()
572 pgcnt_t npages; in iommu_create_pp_mappings() local
592 npages = iommu_btopr(mp->dmai_size + offset); in iommu_create_pp_mappings()
595 diag_tlb_flush = npages > tlb_flush_using_diag ? 1 : 0; in iommu_create_pp_mappings()
614 iomemp->npages = npages; in iommu_create_pp_mappings()
615 pfnp = iomemp->pfn = kmem_zalloc(sizeof (*pfnp) * (npages + 1), in iommu_create_pp_mappings()
622 ASSERT(npages != 0); in iommu_create_pp_mappings()
626 iommu_tlb_flush(softsp, ioaddr, npages); in iommu_create_pp_mappings()
653 npages--; in iommu_create_pp_mappings()
661 } while (npages != 0); in iommu_create_pp_mappings()
859 pgcnt_t npages; in iommu_dma_bindhdl() local
893 npages = iommu_btopr(OBJSIZE + offset); in iommu_dma_bindhdl()
897 npages, addr, offset, OBJSIZE)); in iommu_dma_bindhdl()
908 npages = iommu_btopr(OBJSIZE + offset); in iommu_dma_bindhdl()
935 npages = iommu_btopr(size + offset); in iommu_dma_bindhdl()
942 if (npages > MIN_DVMA_WIN_SIZE) { in iommu_dma_bindhdl()
943 npages = MIN_DVMA_WIN_SIZE + iommu_btopr(offset); in iommu_dma_bindhdl()
946 "%lx sz %x\n", OBJSIZE, npages, size)); in iommu_dma_bindhdl()
955 if (npages >= iommu_btop(softsp->iommu_dvma_size) - in iommu_dma_bindhdl()
967 mp->dmai_ndvmapages = npages; in iommu_dma_bindhdl()
971 iommu_ptob(npages), in iommu_dma_bindhdl()
982 if (npages == 1 && !addr) { in iommu_dma_bindhdl()
1033 iomemp->npages = npages; in iommu_dma_bindhdl()
1035 (npages + 1), KM_SLEEP); in iommu_dma_bindhdl()
1047 iommu_ptob(npages), in iommu_dma_bindhdl()
1105 iommu_ptob(npages)); in iommu_dma_bindhdl()
1108 iommu_ptob(npages)); in iommu_dma_bindhdl()
1127 uint_t npages; in iommu_dma_unbindhdl() local
1135 npages = mp->dmai_ndvmapages; in iommu_dma_unbindhdl()
1136 size = iommu_ptob(npages); in iommu_dma_unbindhdl()
1144 sync_stream_buf(softsp, addr, npages, (int *)&mppriv->sync_flag, in iommu_dma_unbindhdl()
1155 ASSERT(npages > (uint_t)0); in iommu_dma_unbindhdl()
1312 pgcnt_t npages; in iommu_dma_mctl() local
1428 uint_t np = npages = mp->dmai_ndvmapages; in iommu_dma_mctl()
1441 while (npages > (uint_t)0) { in iommu_dma_mctl()
1445 npages--; in iommu_dma_mctl()
1501 int npages; in iommu_dvma_kaddr_load() local
1524 npages = iommu_btopr(len + offset); in iommu_dvma_kaddr_load()
1531 iomemp->npages = npages; in iommu_dvma_kaddr_load()
1532 pfnp = iomemp->pfn = kmem_zalloc(sizeof (*pfnp) * (npages + 1), in iommu_dvma_kaddr_load()
1551 ASSERT(npages > 0); in iommu_dvma_kaddr_load()
1564 npages--; in iommu_dvma_kaddr_load()
1575 } while (npages > 0); in iommu_dvma_kaddr_load()
1591 pgcnt_t npages; in iommu_dvma_unload() local
1603 npages = iommu_fast_dvma->pagecnt[index]; in iommu_dvma_unload()
1620 kmem_free(walk->pfn, sizeof (pfn_t) * (npages + 1)); in iommu_dvma_unload()
1628 index, npages)); in iommu_dvma_unload()
1631 sync_stream_buf(softsp, ioaddr, npages, in iommu_dvma_unload()
1643 uint_t npages; in iommu_dvma_sync() local
1654 npages = iommu_fast_dvma->pagecnt[index]; in iommu_dvma_sync()
1661 sync_stream_buf(softsp, ioaddr, npages, in iommu_dvma_sync()