1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * Copyright (C) 2008 Advanced Micro Devices, 3 * Copyright (C) 2008 Advanced Micro Devices, Inc. 4 * 4 * 5 * Author: Joerg Roedel <joerg.roedel@amd.com> 5 * Author: Joerg Roedel <joerg.roedel@amd.com> 6 */ 6 */ 7 7 8 #ifndef _KERNEL_DMA_DEBUG_H 8 #ifndef _KERNEL_DMA_DEBUG_H 9 #define _KERNEL_DMA_DEBUG_H 9 #define _KERNEL_DMA_DEBUG_H 10 10 11 #ifdef CONFIG_DMA_API_DEBUG 11 #ifdef CONFIG_DMA_API_DEBUG 12 extern void debug_dma_map_page(struct device * 12 extern void debug_dma_map_page(struct device *dev, struct page *page, 13 size_t offset, 13 size_t offset, size_t size, 14 int direction, !! 14 int direction, dma_addr_t dma_addr); 15 unsigned long a << 16 15 17 extern void debug_dma_unmap_page(struct device 16 extern void debug_dma_unmap_page(struct device *dev, dma_addr_t addr, 18 size_t size, 17 size_t size, int direction); 19 18 20 extern void debug_dma_map_sg(struct device *de 19 extern void debug_dma_map_sg(struct device *dev, struct scatterlist *sg, 21 int nents, int ma !! 20 int nents, int mapped_ents, int direction); 22 unsigned long att << 23 21 24 extern void debug_dma_unmap_sg(struct device * 22 extern void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, 25 int nelems, int 23 int nelems, int dir); 26 24 27 extern void debug_dma_alloc_coherent(struct de 25 extern void debug_dma_alloc_coherent(struct device *dev, size_t size, 28 dma_addr_ !! 26 dma_addr_t dma_addr, void *virt); 29 unsigned << 30 27 31 extern void debug_dma_free_coherent(struct dev 28 extern void debug_dma_free_coherent(struct device *dev, size_t size, 32 void *virt 29 void *virt, dma_addr_t addr); 33 30 34 extern void debug_dma_map_resource(struct devi 31 extern void debug_dma_map_resource(struct device *dev, phys_addr_t addr, 35 size_t size 32 size_t size, int direction, 36 dma_addr_t !! 33 dma_addr_t dma_addr); 37 unsigned lo << 38 34 39 extern void debug_dma_unmap_resource(struct de 35 extern void debug_dma_unmap_resource(struct device *dev, dma_addr_t dma_addr, 40 size_t si 36 size_t size, int direction); 41 37 42 extern void debug_dma_sync_single_for_cpu(stru 38 extern void debug_dma_sync_single_for_cpu(struct device *dev, 43 dma_ 39 dma_addr_t dma_handle, size_t size, 44 int 40 int direction); 45 41 46 extern void debug_dma_sync_single_for_device(s 42 extern void debug_dma_sync_single_for_device(struct device *dev, 47 d 43 dma_addr_t dma_handle, 48 s 44 size_t size, int direction); 49 45 50 extern void debug_dma_sync_sg_for_cpu(struct d 46 extern void debug_dma_sync_sg_for_cpu(struct device *dev, 51 struct s 47 struct scatterlist *sg, 52 int nele 48 int nelems, int direction); 53 49 54 extern void debug_dma_sync_sg_for_device(struc 50 extern void debug_dma_sync_sg_for_device(struct device *dev, 55 struc 51 struct scatterlist *sg, 56 int n 52 int nelems, int direction); 57 #else /* CONFIG_DMA_API_DEBUG */ 53 #else /* CONFIG_DMA_API_DEBUG */ 58 static inline void debug_dma_map_page(struct d 54 static inline void debug_dma_map_page(struct device *dev, struct page *page, 59 size_t o 55 size_t offset, size_t size, 60 int dire !! 56 int direction, dma_addr_t dma_addr) 61 unsigned << 62 { 57 { 63 } 58 } 64 59 65 static inline void debug_dma_unmap_page(struct 60 static inline void debug_dma_unmap_page(struct device *dev, dma_addr_t addr, 66 size_t 61 size_t size, int direction) 67 { 62 { 68 } 63 } 69 64 70 static inline void debug_dma_map_sg(struct dev 65 static inline void debug_dma_map_sg(struct device *dev, struct scatterlist *sg, 71 int nents, !! 66 int nents, int mapped_ents, int direction) 72 unsigned l << 73 { 67 { 74 } 68 } 75 69 76 static inline void debug_dma_unmap_sg(struct d 70 static inline void debug_dma_unmap_sg(struct device *dev, 77 struct s 71 struct scatterlist *sglist, 78 int nele 72 int nelems, int dir) 79 { 73 { 80 } 74 } 81 75 82 static inline void debug_dma_alloc_coherent(st 76 static inline void debug_dma_alloc_coherent(struct device *dev, size_t size, 83 dm !! 77 dma_addr_t dma_addr, void *virt) 84 un << 85 { 78 { 86 } 79 } 87 80 88 static inline void debug_dma_free_coherent(str 81 static inline void debug_dma_free_coherent(struct device *dev, size_t size, 89 voi 82 void *virt, dma_addr_t addr) 90 { 83 { 91 } 84 } 92 85 93 static inline void debug_dma_map_resource(stru 86 static inline void debug_dma_map_resource(struct device *dev, phys_addr_t addr, 94 size 87 size_t size, int direction, 95 dma_ !! 88 dma_addr_t dma_addr) 96 unsi << 97 { 89 { 98 } 90 } 99 91 100 static inline void debug_dma_unmap_resource(st 92 static inline void debug_dma_unmap_resource(struct device *dev, 101 dm 93 dma_addr_t dma_addr, size_t size, 102 in 94 int direction) 103 { 95 { 104 } 96 } 105 97 106 static inline void debug_dma_sync_single_for_c 98 static inline void debug_dma_sync_single_for_cpu(struct device *dev, 107 99 dma_addr_t dma_handle, 108 100 size_t size, int direction) 109 { 101 { 110 } 102 } 111 103 112 static inline void debug_dma_sync_single_for_d 104 static inline void debug_dma_sync_single_for_device(struct device *dev, 113 105 dma_addr_t dma_handle, 114 106 size_t size, int direction) 115 { 107 { 116 } 108 } 117 109 118 static inline void debug_dma_sync_sg_for_cpu(s 110 static inline void debug_dma_sync_sg_for_cpu(struct device *dev, 119 s 111 struct scatterlist *sg, 120 i 112 int nelems, int direction) 121 { 113 { 122 } 114 } 123 115 124 static inline void debug_dma_sync_sg_for_devic 116 static inline void debug_dma_sync_sg_for_device(struct device *dev, 125 117 struct scatterlist *sg, 126 118 int nelems, int direction) 127 { 119 { 128 } 120 } 129 #endif /* CONFIG_DMA_API_DEBUG */ 121 #endif /* CONFIG_DMA_API_DEBUG */ 130 #endif /* _KERNEL_DMA_DEBUG_H */ 122 #endif /* _KERNEL_DMA_DEBUG_H */ 131 123
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.