Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.13-rc4 87 lines 2.1 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Copyright (C) 2014-2015 ARM Ltd. 4 */ 5#ifndef __DMA_IOMMU_H 6#define __DMA_IOMMU_H 7 8#include <linux/errno.h> 9#include <linux/types.h> 10 11#ifdef CONFIG_IOMMU_DMA 12#include <linux/dma-mapping.h> 13#include <linux/iommu.h> 14#include <linux/msi.h> 15 16/* Domain management interface for IOMMU drivers */ 17int iommu_get_dma_cookie(struct iommu_domain *domain); 18int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base); 19void iommu_put_dma_cookie(struct iommu_domain *domain); 20 21/* Setup call for arch DMA mapping code */ 22void iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size); 23 24/* The DMA API isn't _quite_ the whole story, though... */ 25/* 26 * iommu_dma_prepare_msi() - Map the MSI page in the IOMMU device 27 * 28 * The MSI page will be stored in @desc. 29 * 30 * Return: 0 on success otherwise an error describing the failure. 31 */ 32int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr); 33 34/* Update the MSI message if required. */ 35void iommu_dma_compose_msi_msg(struct msi_desc *desc, 36 struct msi_msg *msg); 37 38void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list); 39 40void iommu_dma_free_cpu_cached_iovas(unsigned int cpu, 41 struct iommu_domain *domain); 42 43extern bool iommu_dma_forcedac; 44 45#else /* CONFIG_IOMMU_DMA */ 46 47struct iommu_domain; 48struct msi_desc; 49struct msi_msg; 50struct device; 51 52static inline void iommu_setup_dma_ops(struct device *dev, u64 dma_base, 53 u64 size) 54{ 55} 56 57static inline int iommu_get_dma_cookie(struct iommu_domain *domain) 58{ 59 return -ENODEV; 60} 61 62static inline int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base) 63{ 64 return -ENODEV; 65} 66 67static inline void iommu_put_dma_cookie(struct iommu_domain *domain) 68{ 69} 70 71static inline int iommu_dma_prepare_msi(struct msi_desc *desc, 72 phys_addr_t msi_addr) 73{ 74 return 0; 75} 76 77static inline void iommu_dma_compose_msi_msg(struct msi_desc *desc, 78 struct msi_msg *msg) 79{ 80} 81 82static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) 83{ 84} 85 86#endif /* CONFIG_IOMMU_DMA */ 87#endif /* __DMA_IOMMU_H */