projects/linux·blob v6.17 · refs

150 lines · 4.2 KiB

1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2008 Advanced Micro Devices, Inc.
4 *
5 * Author: Joerg Roedel <[email protected]>
6 */
7
8#ifndef _KERNEL_DMA_DEBUG_H
9#define _KERNEL_DMA_DEBUG_H
10
11#ifdef CONFIG_DMA_API_DEBUG
12extern void debug_dma_map_page(struct device *dev, struct page *page,
13 size_t offset, size_t size,
14 int direction, dma_addr_t dma_addr,
15 unsigned long attrs);
16
17extern void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
18 size_t size, int direction);
19
20extern void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
21 int nents, int mapped_ents, int direction,
22 unsigned long attrs);
23
24extern void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
25 int nelems, int dir);
26
27extern void debug_dma_alloc_coherent(struct device *dev, size_t size,
28 dma_addr_t dma_addr, void *virt,
29 unsigned long attrs);
30
31extern void debug_dma_free_coherent(struct device *dev, size_t size,
32 void *virt, dma_addr_t addr);
33
34extern void debug_dma_map_resource(struct device *dev, phys_addr_t addr,
35 size_t size, int direction,
36 dma_addr_t dma_addr,
37 unsigned long attrs);
38
39extern void debug_dma_unmap_resource(struct device *dev, dma_addr_t dma_addr,
40 size_t size, int direction);
41
42extern void debug_dma_sync_single_for_cpu(struct device *dev,
43 dma_addr_t dma_handle, size_t size,
44 int direction);
45
46extern void debug_dma_sync_single_for_device(struct device *dev,
47 dma_addr_t dma_handle,
48 size_t size, int direction);
49
50extern void debug_dma_sync_sg_for_cpu(struct device *dev,
51 struct scatterlist *sg,
52 int nelems, int direction);
53
54extern void debug_dma_sync_sg_for_device(struct device *dev,
55 struct scatterlist *sg,
56 int nelems, int direction);
57extern void debug_dma_alloc_pages(struct device *dev, struct page *page,
58 size_t size, int direction,
59 dma_addr_t dma_addr,
60 unsigned long attrs);
61extern void debug_dma_free_pages(struct device *dev, struct page *page,
62 size_t size, int direction,
63 dma_addr_t dma_addr);
64#else /* CONFIG_DMA_API_DEBUG */
65static inline void debug_dma_map_page(struct device *dev, struct page *page,
66 size_t offset, size_t size,
67 int direction, dma_addr_t dma_addr,
68 unsigned long attrs)
69{
70}
71
72static inline void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
73 size_t size, int direction)
74{
75}
76
77static inline void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
78 int nents, int mapped_ents, int direction,
79 unsigned long attrs)
80{
81}
82
83static inline void debug_dma_unmap_sg(struct device *dev,
84 struct scatterlist *sglist,
85 int nelems, int dir)
86{
87}
88
89static inline void debug_dma_alloc_coherent(struct device *dev, size_t size,
90 dma_addr_t dma_addr, void *virt,
91 unsigned long attrs)
92{
93}
94
95static inline void debug_dma_free_coherent(struct device *dev, size_t size,
96 void *virt, dma_addr_t addr)
97{
98}
99
100static inline void debug_dma_map_resource(struct device *dev, phys_addr_t addr,
101 size_t size, int direction,
102 dma_addr_t dma_addr,
103 unsigned long attrs)
104{
105}
106
107static inline void debug_dma_unmap_resource(struct device *dev,
108 dma_addr_t dma_addr, size_t size,
109 int direction)
110{
111}
112
113static inline void debug_dma_sync_single_for_cpu(struct device *dev,
114 dma_addr_t dma_handle,
115 size_t size, int direction)
116{
117}
118
119static inline void debug_dma_sync_single_for_device(struct device *dev,
120 dma_addr_t dma_handle,
121 size_t size, int direction)
122{
123}
124
125static inline void debug_dma_sync_sg_for_cpu(struct device *dev,
126 struct scatterlist *sg,
127 int nelems, int direction)
128{
129}
130
131static inline void debug_dma_sync_sg_for_device(struct device *dev,
132 struct scatterlist *sg,
133 int nelems, int direction)
134{
135}
136
137static inline void debug_dma_alloc_pages(struct device *dev, struct page *page,
138 size_t size, int direction,
139 dma_addr_t dma_addr,
140 unsigned long attrs)
141{
142}
143
144static inline void debug_dma_free_pages(struct device *dev, struct page *page,
145 size_t size, int direction,
146 dma_addr_t dma_addr)
147{
148}
149#endif /* CONFIG_DMA_API_DEBUG */
150#endif /* _KERNEL_DMA_DEBUG_H */