]> err.no Git - linux-2.6/blobdiff - include/asm-sh64/dma-mapping.h
Merge branch 'mac80211' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
[linux-2.6] / include / asm-sh64 / dma-mapping.h
index a74a49e47922b03e223b8db5a387d93335d1bc7c..c7c0f059cdc4ff57e464d6beccef50e384dd2b17 100644 (file)
@@ -35,7 +35,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
        consistent_free(NULL, size, vaddr, dma_handle);
 }
 
-static inline void dma_cache_sync(void *vaddr, size_t size,
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+#define dma_is_consistent(d, h) (1)
+
+static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                                  enum dma_data_direction dir)
 {
        dma_cache_wback_inv((unsigned long)vaddr, size);
@@ -49,7 +53,7 @@ static inline dma_addr_t dma_map_single(struct device *dev,
        if (dev->bus == &pci_bus_type)
                return virt_to_bus(ptr);
 #endif
-       dma_cache_sync(ptr, size, dir);
+       dma_cache_sync(dev, ptr, size, dir);
 
        return virt_to_bus(ptr);
 }
@@ -63,7 +67,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
 
        for (i = 0; i < nents; i++) {
 #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-               dma_cache_sync(page_address(sg[i].page) + sg[i].offset,
+               dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
                               sg[i].length, dir);
 #endif
                sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
@@ -94,7 +98,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
        if (dev->bus == &pci_bus_type)
                return;
 #endif
-       dma_cache_sync(bus_to_virt(dma_handle), size, dir);
+       dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir);
 }
 
 static inline void dma_sync_single_range(struct device *dev,
@@ -106,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev,
        if (dev->bus == &pci_bus_type)
                return;
 #endif
-       dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir);
+       dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir);
 }
 
 static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
@@ -116,7 +120,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
 
        for (i = 0; i < nelems; i++) {
 #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
-               dma_cache_sync(page_address(sg[i].page) + sg[i].offset,
+               dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
                               sg[i].length, dir);
 #endif
                sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
@@ -126,22 +130,30 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
 static inline void dma_sync_single_for_cpu(struct device *dev,
                                           dma_addr_t dma_handle, size_t size,
                                           enum dma_data_direction dir)
-       __attribute__ ((alias("dma_sync_single")));
+{
+       dma_sync_single(dev, dma_handle, size, dir);
+}
 
 static inline void dma_sync_single_for_device(struct device *dev,
                                           dma_addr_t dma_handle, size_t size,
                                           enum dma_data_direction dir)
-       __attribute__ ((alias("dma_sync_single")));
+{
+       dma_sync_single(dev, dma_handle, size, dir);
+}
 
 static inline void dma_sync_sg_for_cpu(struct device *dev,
                                       struct scatterlist *sg, int nelems,
                                       enum dma_data_direction dir)
-       __attribute__ ((alias("dma_sync_sg")));
+{
+       dma_sync_sg(dev, sg, nelems, dir);
+}
 
 static inline void dma_sync_sg_for_device(struct device *dev,
                                       struct scatterlist *sg, int nelems,
                                       enum dma_data_direction dir)
-       __attribute__ ((alias("dma_sync_sg")));
+{
+       dma_sync_sg(dev, sg, nelems, dir);
+}
 
 static inline int dma_get_cache_alignment(void)
 {