1 /* SPDX-License-Identifier: GPL-2.0 */
3 * SVA library for IOMMU drivers
8 #include <linux/mm_types.h>
15 #ifdef CONFIG_IOMMU_SVA
16 int iommu_queue_iopf(struct iommu_fault *fault, void *cookie);
18 int iopf_queue_add_device(struct iopf_queue *queue, struct device *dev);
19 int iopf_queue_remove_device(struct iopf_queue *queue,
21 int iopf_queue_flush_dev(struct device *dev);
22 struct iopf_queue *iopf_queue_alloc(const char *name);
23 void iopf_queue_free(struct iopf_queue *queue);
24 int iopf_queue_discard_partial(struct iopf_queue *queue);
25 enum iommu_page_response_code
26 iommu_sva_handle_iopf(struct iommu_fault *fault, void *data);
28 #else /* CONFIG_IOMMU_SVA */
29 static inline int iommu_queue_iopf(struct iommu_fault *fault, void *cookie)
34 static inline int iopf_queue_add_device(struct iopf_queue *queue,
40 static inline int iopf_queue_remove_device(struct iopf_queue *queue,
46 static inline int iopf_queue_flush_dev(struct device *dev)
51 static inline struct iopf_queue *iopf_queue_alloc(const char *name)
56 static inline void iopf_queue_free(struct iopf_queue *queue)
60 static inline int iopf_queue_discard_partial(struct iopf_queue *queue)
65 static inline enum iommu_page_response_code
66 iommu_sva_handle_iopf(struct iommu_fault *fault, void *data)
68 return IOMMU_PAGE_RESP_INVALID;
70 #endif /* CONFIG_IOMMU_SVA */
71 #endif /* _IOMMU_SVA_H */