aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/io-unit.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:40:38 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:15:07 -0400
commit4b1c5df2af38b2681b7c1a058534d17c54aaf6cf (patch)
tree3fd9131a506185fa942865cc5e54ecf274a3b5fb /arch/sparc/mm/io-unit.c
parentb1387c35bef6da55f6f2c27dfb748c86a4ef7ef9 (diff)
sparc32: Make mmu_map_dma_area and mmu_unmap_dma_area take a device pointer.
This lets us kill this "map it in every IOMMU" crazy code, and also some of the final references to sbus_root. 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.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 6b469820fb9..0f97ab30df3 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -186,12 +186,12 @@ static void iounit_release_scsi_sgl(struct device *dev, struct scatterlist *sg,
186} 186}
187 187
188#ifdef CONFIG_SBUS 188#ifdef CONFIG_SBUS
189static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, int len) 189static int iounit_map_dma_area(struct device *dev, dma_addr_t *pba, unsigned long va, __u32 addr, int len)
190{ 190{
191 struct iounit_struct *iounit = dev->archdata.iommu;
191 unsigned long page, end; 192 unsigned long page, end;
192 pgprot_t dvma_prot; 193 pgprot_t dvma_prot;
193 iopte_t *iopte; 194 iopte_t *iopte;
194 struct sbus_bus *sbus;
195 195
196 *pba = addr; 196 *pba = addr;
197 197
@@ -213,12 +213,8 @@ static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, in
213 213
214 i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT); 214 i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
215 215
216 for_each_sbus(sbus) { 216 iopte = (iopte_t *)(iounit->page_table + i);
217 struct iounit_struct *iounit = sbus->ofdev.dev.archdata.iommu; 217 *iopte = MKIOPTE(__pa(page));
218
219 iopte = (iopte_t *)(iounit->page_table + i);
220 *iopte = MKIOPTE(__pa(page));
221 }
222 } 218 }
223 addr += PAGE_SIZE; 219 addr += PAGE_SIZE;
224 va += PAGE_SIZE; 220 va += PAGE_SIZE;
@@ -229,7 +225,7 @@ static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, in
229 return 0; 225 return 0;
230} 226}
231 227
232static void iounit_unmap_dma_area(unsigned long addr, int len) 228static void iounit_unmap_dma_area(struct device *dev, unsigned long addr, int len)
233{ 229{
234 /* XXX Somebody please fill this in */ 230 /* XXX Somebody please fill this in */
235} 231}