mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
e0c6584df9
sh does not implement DMA_ATTR_NON_CONSISTENT allocations, so it doesn't make any sense to do any work in dma_cache_sync given that it must be a no-op when dma_alloc_attrs returns coherent memory. On the other hand sh uses dma_cache_sync internally in the dma_ops implementation and for the maple bus that does not use the DMA API, so a the old functionality for dma_cache_sync is still provided under the name sh_sync_dma_for_device, and without the redundant dev argument. While at it two of the syncing dma_ops also go the proper _for_device postfix. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
29 lines
805 B
C
29 lines
805 B
C
#ifndef __ASM_SH_DMA_MAPPING_H
|
|
#define __ASM_SH_DMA_MAPPING_H
|
|
|
|
extern const struct dma_map_ops *dma_ops;
|
|
extern void no_iommu_init(void);
|
|
|
|
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
|
|
{
|
|
return dma_ops;
|
|
}
|
|
|
|
static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
}
|
|
|
|
/* arch/sh/mm/consistent.c */
|
|
extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
|
|
dma_addr_t *dma_addr, gfp_t flag,
|
|
unsigned long attrs);
|
|
extern void dma_generic_free_coherent(struct device *dev, size_t size,
|
|
void *vaddr, dma_addr_t dma_handle,
|
|
unsigned long attrs);
|
|
|
|
void sh_sync_dma_for_device(void *vaddr, size_t size,
|
|
enum dma_data_direction dir);
|
|
|
|
#endif /* __ASM_SH_DMA_MAPPING_H */
|