mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 17:44:14 +08:00
f5079a9a2a
Newer Xen versions expose two Xen feature flags to tell us if the domain is directly mapped or not. Only when a domain is directly mapped it makes sense to enable swiotlb-xen on ARM. Introduce a function on ARM to check the new Xen feature flags and also to deal with the legacy case. Call the function xen_swiotlb_detect. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Link: https://lore.kernel.org/r/20210319200140.12512-1-sstabellini@kernel.org Signed-off-by: Juergen Gross <jgross@suse.com>
17 lines
537 B
C
17 lines
537 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __LINUX_SWIOTLB_XEN_H
|
|
#define __LINUX_SWIOTLB_XEN_H
|
|
|
|
#include <linux/swiotlb.h>
|
|
#include <asm/xen/swiotlb-xen.h>
|
|
|
|
void xen_dma_sync_for_cpu(struct device *dev, dma_addr_t handle,
|
|
size_t size, enum dma_data_direction dir);
|
|
void xen_dma_sync_for_device(struct device *dev, dma_addr_t handle,
|
|
size_t size, enum dma_data_direction dir);
|
|
|
|
extern int xen_swiotlb_init(int verbose, bool early);
|
|
extern const struct dma_map_ops xen_swiotlb_dma_ops;
|
|
|
|
#endif /* __LINUX_SWIOTLB_XEN_H */
|