~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/include/asm/mach-generic/dma-coherence.h

Version: ~ [ linux-5.12-rc7 ] ~ [ linux-5.11.13 ] ~ [ linux-5.10.29 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.111 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.186 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.230 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.266 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.266 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 2006  Ralf Baechle <ralf@linux-mips.org>
  7  *
  8  */
  9 #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H
 10 #define __ASM_MACH_GENERIC_DMA_COHERENCE_H
 11 
 12 struct device;
 13 
 14 static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
 15         size_t size)
 16 {
 17         return virt_to_phys(addr);
 18 }
 19 
 20 static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
 21         struct page *page)
 22 {
 23         return page_to_phys(page);
 24 }
 25 
 26 static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
 27         dma_addr_t dma_addr)
 28 {
 29         return dma_addr;
 30 }
 31 
 32 static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
 33         size_t size, enum dma_data_direction direction)
 34 {
 35 }
 36 
 37 static inline int plat_dma_supported(struct device *dev, u64 mask)
 38 {
 39         /*
 40          * we fall back to GFP_DMA when the mask isn't all 1s,
 41          * so we can't guarantee allocations that must be
 42          * within a tighter range than GFP_DMA..
 43          */
 44         if (mask < DMA_BIT_MASK(24))
 45                 return 0;
 46 
 47         return 1;
 48 }
 49 
 50 static inline int plat_device_is_coherent(struct device *dev)
 51 {
 52         return coherentio;
 53 }
 54 
 55 #ifndef plat_post_dma_flush
 56 static inline void plat_post_dma_flush(struct device *dev)
 57 {
 58 }
 59 #endif
 60 
 61 #ifdef CONFIG_SWIOTLB
 62 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
 63 {
 64         return paddr;
 65 }
 66 
 67 static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
 68 {
 69         return daddr;
 70 }
 71 #endif
 72 
 73 #endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
 74 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp