Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2008 Advanced Micro Devices, Inc.
0004  *
0005  * Author: Joerg Roedel <joerg.roedel@amd.com>
0006  */
0007 
0008 #ifndef _KERNEL_DMA_DEBUG_H
0009 #define _KERNEL_DMA_DEBUG_H
0010 
0011 #ifdef CONFIG_DMA_API_DEBUG
0012 extern void debug_dma_map_page(struct device *dev, struct page *page,
0013                    size_t offset, size_t size,
0014                    int direction, dma_addr_t dma_addr,
0015                    unsigned long attrs);
0016 
0017 extern void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
0018                  size_t size, int direction);
0019 
0020 extern void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
0021                  int nents, int mapped_ents, int direction,
0022                  unsigned long attrs);
0023 
0024 extern void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
0025                    int nelems, int dir);
0026 
0027 extern void debug_dma_alloc_coherent(struct device *dev, size_t size,
0028                      dma_addr_t dma_addr, void *virt,
0029                      unsigned long attrs);
0030 
0031 extern void debug_dma_free_coherent(struct device *dev, size_t size,
0032                     void *virt, dma_addr_t addr);
0033 
0034 extern void debug_dma_map_resource(struct device *dev, phys_addr_t addr,
0035                    size_t size, int direction,
0036                    dma_addr_t dma_addr,
0037                    unsigned long attrs);
0038 
0039 extern void debug_dma_unmap_resource(struct device *dev, dma_addr_t dma_addr,
0040                      size_t size, int direction);
0041 
0042 extern void debug_dma_sync_single_for_cpu(struct device *dev,
0043                       dma_addr_t dma_handle, size_t size,
0044                       int direction);
0045 
0046 extern void debug_dma_sync_single_for_device(struct device *dev,
0047                          dma_addr_t dma_handle,
0048                          size_t size, int direction);
0049 
0050 extern void debug_dma_sync_sg_for_cpu(struct device *dev,
0051                       struct scatterlist *sg,
0052                       int nelems, int direction);
0053 
0054 extern void debug_dma_sync_sg_for_device(struct device *dev,
0055                      struct scatterlist *sg,
0056                      int nelems, int direction);
0057 #else /* CONFIG_DMA_API_DEBUG */
0058 static inline void debug_dma_map_page(struct device *dev, struct page *page,
0059                       size_t offset, size_t size,
0060                       int direction, dma_addr_t dma_addr,
0061                       unsigned long attrs)
0062 {
0063 }
0064 
0065 static inline void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
0066                     size_t size, int direction)
0067 {
0068 }
0069 
0070 static inline void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
0071                     int nents, int mapped_ents, int direction,
0072                     unsigned long attrs)
0073 {
0074 }
0075 
0076 static inline void debug_dma_unmap_sg(struct device *dev,
0077                       struct scatterlist *sglist,
0078                       int nelems, int dir)
0079 {
0080 }
0081 
0082 static inline void debug_dma_alloc_coherent(struct device *dev, size_t size,
0083                         dma_addr_t dma_addr, void *virt,
0084                         unsigned long attrs)
0085 {
0086 }
0087 
0088 static inline void debug_dma_free_coherent(struct device *dev, size_t size,
0089                        void *virt, dma_addr_t addr)
0090 {
0091 }
0092 
0093 static inline void debug_dma_map_resource(struct device *dev, phys_addr_t addr,
0094                       size_t size, int direction,
0095                       dma_addr_t dma_addr,
0096                       unsigned long attrs)
0097 {
0098 }
0099 
0100 static inline void debug_dma_unmap_resource(struct device *dev,
0101                         dma_addr_t dma_addr, size_t size,
0102                         int direction)
0103 {
0104 }
0105 
0106 static inline void debug_dma_sync_single_for_cpu(struct device *dev,
0107                          dma_addr_t dma_handle,
0108                          size_t size, int direction)
0109 {
0110 }
0111 
0112 static inline void debug_dma_sync_single_for_device(struct device *dev,
0113                             dma_addr_t dma_handle,
0114                             size_t size, int direction)
0115 {
0116 }
0117 
0118 static inline void debug_dma_sync_sg_for_cpu(struct device *dev,
0119                          struct scatterlist *sg,
0120                          int nelems, int direction)
0121 {
0122 }
0123 
0124 static inline void debug_dma_sync_sg_for_device(struct device *dev,
0125                         struct scatterlist *sg,
0126                         int nelems, int direction)
0127 {
0128 }
0129 #endif /* CONFIG_DMA_API_DEBUG */
0130 #endif /* _KERNEL_DMA_DEBUG_H */