diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-27 00:14:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-29 05:15:23 -0400 |
commit | 0ad626a2a4c3d8e565b3a6f10eeda5b43560fbdb (patch) | |
tree | e96ca6a281db172caa5317280035c855e49b2845 /arch/sparc/mm/io-unit.c | |
parent | 47a2d7288538e7f334a0be318317b138f0e3dfbe (diff) |
sparc32: Kill iounit_map_dma_*().
Unused.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/io-unit.c')
-rw-r--r-- | arch/sparc/mm/io-unit.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index caf551ad9d8c..53900230c2d2 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c | |||
@@ -267,51 +267,3 @@ void __init ld_mmu_iounit(void) | |||
267 | BTFIXUPSET_CALL(mmu_unmap_dma_area, iounit_unmap_dma_area, BTFIXUPCALL_NORM); | 267 | BTFIXUPSET_CALL(mmu_unmap_dma_area, iounit_unmap_dma_area, BTFIXUPCALL_NORM); |
268 | #endif | 268 | #endif |
269 | } | 269 | } |
270 | |||
271 | __u32 iounit_map_dma_init(struct sbus_bus *sbus, int size) | ||
272 | { | ||
273 | int i, j, k, npages; | ||
274 | unsigned long rotor, scan, limit; | ||
275 | unsigned long flags; | ||
276 | __u32 ret; | ||
277 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; | ||
278 | |||
279 | npages = (size + (PAGE_SIZE-1)) >> PAGE_SHIFT; | ||
280 | i = 0x0213; | ||
281 | spin_lock_irqsave(&iounit->lock, flags); | ||
282 | next: j = (i & 15); | ||
283 | rotor = iounit->rotor[j - 1]; | ||
284 | limit = iounit->limit[j]; | ||
285 | scan = rotor; | ||
286 | nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan); | ||
287 | if (scan + npages > limit) { | ||
288 | if (limit != rotor) { | ||
289 | limit = rotor; | ||
290 | scan = iounit->limit[j - 1]; | ||
291 | goto nexti; | ||
292 | } | ||
293 | i >>= 4; | ||
294 | if (!(i & 15)) | ||
295 | panic("iounit_map_dma_init: Couldn't find free iopte slots for %d bytes\n", size); | ||
296 | goto next; | ||
297 | } | ||
298 | for (k = 1, scan++; k < npages; k++) | ||
299 | if (test_bit(scan++, iounit->bmap)) | ||
300 | goto nexti; | ||
301 | iounit->rotor[j - 1] = (scan < limit) ? scan : iounit->limit[j - 1]; | ||
302 | scan -= npages; | ||
303 | ret = IOUNIT_DMA_BASE + (scan << PAGE_SHIFT); | ||
304 | for (k = 0; k < npages; k++, scan++) | ||
305 | set_bit(scan, iounit->bmap); | ||
306 | spin_unlock_irqrestore(&iounit->lock, flags); | ||
307 | return ret; | ||
308 | } | ||
309 | |||
310 | __u32 iounit_map_dma_page(__u32 vaddr, void *addr, struct sbus_bus *sbus) | ||
311 | { | ||
312 | int scan = (vaddr - IOUNIT_DMA_BASE) >> PAGE_SHIFT; | ||
313 | struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; | ||
314 | |||
315 | iounit->page_table[scan] = MKIOPTE(__pa(((unsigned long)addr) & PAGE_MASK)); | ||
316 | return vaddr + (((unsigned long)addr) & ~PAGE_MASK); | ||
317 | } | ||