]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/iommu.c
powerpc: Update remaining dma_mapping_ops to use map/unmap_page
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / iommu.c
index 45f47c97fd1400363c6d1b0b6552d2bb6da934ba..1bfa706b96e74df4957ccbae5d02a566fe65f5e0 100644 (file)
@@ -565,21 +565,23 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name)
 }
 
 /* Creates TCEs for a user provided buffer.  The user buffer must be
- * contiguous real kernel storage (not vmalloc).  The address of the buffer
- * passed here is the kernel (virtual) address of the buffer.  The buffer
- * need not be page aligned, the dma_addr_t returned will point to the same
- * byte within the page as vaddr.
+ * contiguous real kernel storage (not vmalloc).  The address passed here
+ * comprises a page address and offset into that page. The dma_addr_t
+ * returned will point to the same byte within the page as was passed in.
  */
-dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl,
-                           void *vaddr, size_t size, unsigned long mask,
-               enum dma_data_direction direction, struct dma_attrs *attrs)
+dma_addr_t iommu_map_page(struct device *dev, struct iommu_table *tbl,
+                         struct page *page, unsigned long offset, size_t size,
+                         unsigned long mask, enum dma_data_direction direction,
+                         struct dma_attrs *attrs)
 {
        dma_addr_t dma_handle = DMA_ERROR_CODE;
+       void *vaddr;
        unsigned long uaddr;
        unsigned int npages, align;
 
        BUG_ON(direction == DMA_NONE);
 
+       vaddr = page_address(page) + offset;
        uaddr = (unsigned long)vaddr;
        npages = iommu_num_pages(uaddr, size, IOMMU_PAGE_SIZE);
 
@@ -605,9 +607,9 @@ dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl,
        return dma_handle;
 }
 
-void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
-               size_t size, enum dma_data_direction direction,
-               struct dma_attrs *attrs)
+void iommu_unmap_page(struct iommu_table *tbl, dma_addr_t dma_handle,
+                     size_t size, enum dma_data_direction direction,
+                     struct dma_attrs *attrs)
 {
        unsigned int npages;