Lines Matching refs:npages
206 unsigned long start_addr, unsigned int npages) in iommu_range_reserve() argument
218 end = index + npages; in iommu_range_reserve()
224 bitmap_set(tbl->it_map, index, npages); in iommu_range_reserve()
231 unsigned int npages) in iommu_range_alloc() argument
240 BUG_ON(npages == 0); in iommu_range_alloc()
245 npages, 0, boundary_size, 0); in iommu_range_alloc()
250 npages, 0, boundary_size, 0); in iommu_range_alloc()
261 tbl->it_hint = offset + npages; in iommu_range_alloc()
270 void *vaddr, unsigned int npages, int direction) in iommu_alloc() argument
275 entry = iommu_range_alloc(dev, tbl, npages); in iommu_alloc()
279 npages, tbl); in iommu_alloc()
287 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK, in iommu_alloc()
293 unsigned int npages) in iommu_free() argument
309 BUG_ON(entry + npages > tbl->it_size); in iommu_free()
311 tce_free(tbl, entry, npages); in iommu_free()
315 bitmap_clear(tbl->it_map, entry, npages); in iommu_free()
355 unsigned int npages; in calgary_unmap_sg() local
362 npages = iommu_num_pages(dma, dmalen, PAGE_SIZE); in calgary_unmap_sg()
363 iommu_free(tbl, dma, npages); in calgary_unmap_sg()
374 unsigned int npages; in calgary_map_sg() local
382 npages = iommu_num_pages(vaddr, s->length, PAGE_SIZE); in calgary_map_sg()
384 entry = iommu_range_alloc(dev, tbl, npages); in calgary_map_sg()
394 tce_build(tbl, entry, npages, vaddr & PAGE_MASK, dir); in calgary_map_sg()
416 unsigned int npages; in calgary_map_page() local
420 npages = iommu_num_pages(uaddr, size, PAGE_SIZE); in calgary_map_page()
422 return iommu_alloc(dev, tbl, vaddr, npages, dir); in calgary_map_page()
430 unsigned int npages; in calgary_unmap_page() local
432 npages = iommu_num_pages(dma_addr, size, PAGE_SIZE); in calgary_unmap_page()
433 iommu_free(tbl, dma_addr, npages); in calgary_unmap_page()
441 unsigned int npages, order; in calgary_alloc_coherent() local
445 npages = size >> PAGE_SHIFT; in calgary_alloc_coherent()
457 mapping = iommu_alloc(dev, tbl, ret, npages, DMA_BIDIRECTIONAL); in calgary_alloc_coherent()
473 unsigned int npages; in calgary_free_coherent() local
477 npages = size >> PAGE_SHIFT; in calgary_free_coherent()
479 iommu_free(tbl, dma_handle, npages); in calgary_free_coherent()
739 unsigned int npages; in calgary_reserve_regions() local
750 npages = ((1024 - 640) * 1024) >> PAGE_SHIFT; in calgary_reserve_regions()
753 npages = (1 * 1024 * 1024) >> PAGE_SHIFT; in calgary_reserve_regions()
755 iommu_range_reserve(tbl, start, npages); in calgary_reserve_regions()
1554 unsigned int npages; in calgary_fixup_one_tce_space() local
1571 npages = resource_size(r) >> PAGE_SHIFT; in calgary_fixup_one_tce_space()
1572 npages++; in calgary_fixup_one_tce_space()
1574 iommu_range_reserve(tbl, r->start, npages); in calgary_fixup_one_tce_space()