]> err.no Git - linux-2.6/blobdiff - include/asm-sh64/dma-mapping.h
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6] / include / asm-sh64 / dma-mapping.h
index de4309960207779eb216d7d06ecc4cb9a6d32778..e661857f98dc8e83bf60bc181e35c4464b343a57 100644 (file)
@@ -42,7 +42,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
 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);
+       unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK;
+       unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK;
+
+       for (; s <= e; s += L1_CACHE_BYTES)
+               asm volatile ("ocbp     %0, 0" : : "r" (s));
 }
 
 static inline dma_addr_t dma_map_single(struct device *dev,