summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-06-14 11:15:55 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-17 08:25:43 +0200
commitc50731ebca48c6216b183bd1e0272dd75033ba41 (patch)
treea7378917dab0fa9a25c3f3632b569b640348de46 /include
parent339737fcf0a7c4be1d1984283619cb14aaee6aff (diff)
downloadbarebox-c50731ebca48c6216b183bd1e0272dd75033ba41.tar.gz
barebox-c50731ebca48c6216b183bd1e0272dd75033ba41.tar.xz
dma: avoid clash between static inline and extern dma_alloc declarations
dma_alloc/dma_sync/dma_free can be either either static inline definitions usually supplied per arch or extern definitions that can be either generic or supplied per arch. To avoid clashes, expect static inline definitions to define a preprocessor symbol for now. There is much duplication in the static inline helpers, which we can remove in future. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220614091556.1018102-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/dma.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/dma.h b/include/dma.h
index 90f9254ea8..2a271044f6 100644
--- a/include/dma.h
+++ b/include/dma.h
@@ -57,14 +57,26 @@ static inline int dma_mapping_error(struct device_d *dev, dma_addr_t dma_addr)
}
/* streaming DMA - implement the below calls to support HAS_DMA */
+#ifndef dma_sync_single_for_cpu
void dma_sync_single_for_cpu(dma_addr_t address, size_t size,
enum dma_data_direction dir);
+#endif
+#ifndef dma_sync_single_for_device
void dma_sync_single_for_device(dma_addr_t address, size_t size,
enum dma_data_direction dir);
+#endif
+#ifndef dma_alloc_coherent
void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle);
+#endif
+
+#ifndef dma_free_coherent
void dma_free_coherent(void *mem, dma_addr_t dma_handle, size_t size);
+#endif
+
+#ifndef dma_alloc_writecombine
void *dma_alloc_writecombine(size_t size, dma_addr_t *dma_handle);
+#endif
#endif /* __DMA_H */