Lines Matching refs:npages
204 unsigned long start_addr, unsigned int npages) in iommu_range_reserve() argument
216 end = index + npages; in iommu_range_reserve()
222 bitmap_set(tbl->it_map, index, npages); in iommu_range_reserve()
229 unsigned int npages) in iommu_range_alloc() argument
238 BUG_ON(npages == 0); in iommu_range_alloc()
243 npages, 0, boundary_size, 0); in iommu_range_alloc()
248 npages, 0, boundary_size, 0); in iommu_range_alloc()
259 tbl->it_hint = offset + npages; in iommu_range_alloc()
268 void *vaddr, unsigned int npages, int direction) in iommu_alloc() argument
273 entry = iommu_range_alloc(dev, tbl, npages); in iommu_alloc()
277 npages, tbl); in iommu_alloc()
285 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK, in iommu_alloc()
291 unsigned int npages) in iommu_free() argument
307 BUG_ON(entry + npages > tbl->it_size); in iommu_free()
309 tce_free(tbl, entry, npages); in iommu_free()
313 bitmap_clear(tbl->it_map, entry, npages); in iommu_free()
353 unsigned int npages; in calgary_unmap_sg() local
360 npages = iommu_num_pages(dma, dmalen, PAGE_SIZE); in calgary_unmap_sg()
361 iommu_free(tbl, dma, npages); in calgary_unmap_sg()
372 unsigned int npages; in calgary_map_sg() local
380 npages = iommu_num_pages(vaddr, s->length, PAGE_SIZE); in calgary_map_sg()
382 entry = iommu_range_alloc(dev, tbl, npages); in calgary_map_sg()
392 tce_build(tbl, entry, npages, vaddr & PAGE_MASK, dir); in calgary_map_sg()
414 unsigned int npages; in calgary_map_page() local
418 npages = iommu_num_pages(uaddr, size, PAGE_SIZE); in calgary_map_page()
420 return iommu_alloc(dev, tbl, vaddr, npages, dir); in calgary_map_page()
428 unsigned int npages; in calgary_unmap_page() local
430 npages = iommu_num_pages(dma_addr, size, PAGE_SIZE); in calgary_unmap_page()
431 iommu_free(tbl, dma_addr, npages); in calgary_unmap_page()
439 unsigned int npages, order; in calgary_alloc_coherent() local
443 npages = size >> PAGE_SHIFT; in calgary_alloc_coherent()
455 mapping = iommu_alloc(dev, tbl, ret, npages, DMA_BIDIRECTIONAL); in calgary_alloc_coherent()
471 unsigned int npages; in calgary_free_coherent() local
475 npages = size >> PAGE_SHIFT; in calgary_free_coherent()
477 iommu_free(tbl, dma_handle, npages); in calgary_free_coherent()
730 unsigned int npages; in calgary_reserve_regions() local
741 npages = ((1024 - 640) * 1024) >> PAGE_SHIFT; in calgary_reserve_regions()
744 npages = (1 * 1024 * 1024) >> PAGE_SHIFT; in calgary_reserve_regions()
746 iommu_range_reserve(tbl, start, npages); in calgary_reserve_regions()
1546 unsigned int npages; in calgary_fixup_one_tce_space() local
1563 npages = resource_size(r) >> PAGE_SHIFT; in calgary_fixup_one_tce_space()
1564 npages++; in calgary_fixup_one_tce_space()
1566 iommu_range_reserve(tbl, r->start, npages); in calgary_fixup_one_tce_space()