Lines Matching refs:npages
60 size_t npages, pg_index; in pci_fdvma_load() local
66 npages = IOMMU_BTOPR(len + offset); in pci_fdvma_load()
67 if (!npages) in pci_fdvma_load()
72 if (index + npages > mp->dmai_ndvmapages) { in pci_fdvma_load()
76 index, npages); in pci_fdvma_load()
93 for (i = 0, a = baseaddr; i < npages; i++, a += IOMMU_PAGE_SIZE) { in pci_fdvma_load()
118 fdvma_p->pagecnt[index] = npages; in pci_fdvma_load()
184 size_t npages; in pci_fdvma_reserve() local
206 npages = dmareq->dmar_object.dmao_size; in pci_fdvma_reserve()
208 -npages) < 0) { in pci_fdvma_reserve()
209 atomic_add_long(&iommu_p->iommu_dvma_reserve, npages); in pci_fdvma_reserve()
225 IOMMU_PTOB(npages), IOMMU_PAGE_SIZE, 0, in pci_fdvma_reserve()
229 atomic_add_long(&iommu_p->iommu_dvma_reserve, npages); in pci_fdvma_reserve()
238 fdvma_p->kvbase = kmem_zalloc(npages * sizeof (caddr_t), KM_SLEEP); in pci_fdvma_reserve()
239 fdvma_p->pagecnt = kmem_zalloc(npages * sizeof (uint_t), KM_SLEEP); in pci_fdvma_reserve()
240 fdvma_p->cbcookie = kmem_zalloc(npages * sizeof (void *), KM_SLEEP); in pci_fdvma_reserve()
258 mp->dmai_ndvmapages = npages; in pci_fdvma_reserve()
259 mp->dmai_size = npages * IOMMU_PAGE_SIZE; in pci_fdvma_reserve()
265 mp, mp->dmai_mapping, npages, fdvma_p); in pci_fdvma_reserve()
274 size_t npages; in pci_fdvma_release() local
289 npages = mp->dmai_ndvmapages; in pci_fdvma_release()
290 pci_vmem_free(iommu_p, mp, (void *)mp->dmai_mapping, npages); in pci_fdvma_release()
292 atomic_add_long(&iommu_p->iommu_dvma_reserve, npages); in pci_fdvma_release()
302 kmem_free(fdvma_p->kvbase, npages * sizeof (caddr_t)); in pci_fdvma_release()
303 kmem_free(fdvma_p->pagecnt, npages * sizeof (uint_t)); in pci_fdvma_release()
304 kmem_free(fdvma_p->cbcookie, npages * sizeof (void *)); in pci_fdvma_release()