1 /* 2 * This program is free software; you can redistribute it and/or modify it 3 * under the terms and conditions of the GNU General Public License, 4 * version 2, as published by the Free Software Foundation. 5 * 6 * This program is distributed in the hope it will be useful, but WITHOUT 7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 8 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 9 * more details. 10 * 11 * You should have received a copy of the GNU General Public License along with 12 * this program; If not, see <http://www.gnu.org/licenses/>. 13 */ 14 #ifndef __ARCH_ARM_IOMMU_H__ 15 #define __ARCH_ARM_IOMMU_H__ 16 17 struct arch_iommu 18 { 19 /* Private information for the IOMMU drivers */ 20 void *priv; 21 }; 22 23 const struct iommu_ops *iommu_get_ops(void); 24 void iommu_set_ops(const struct iommu_ops *ops); 25 26 /* 27 * The mapping helpers below should only be used if P2M Table is shared 28 * between the CPU and the IOMMU. 29 */ 30 int __must_check arm_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn, 31 unsigned int flags, 32 unsigned int *flush_flags); 33 int __must_check arm_iommu_unmap_page(struct domain *d, dfn_t dfn, 34 unsigned int order, 35 unsigned int *flush_flags); 36 37 /* 38 * This function is not strictly ARM-specific, but it is only used by ARM 39 * as of now. So put it here to avoid creating dead code on other 40 * architectures. When usage is extended to other architectures, it should 41 * be moved to the generic header. 42 * 43 * 44 * Fills out the device's IOMMU fwspec with IOMMU ids. 45 * 46 * Return values: 47 * 0 : iommu_fwspec is filled out successfully. 48 * <0 : error while filling out the iommu_fwspec. 49 * >0 : IOMMU is not enabled/present or device is not connected to it. 50 */ 51 int iommu_add_pci_sideband_ids(struct pci_dev *pdev); 52 #endif /* __ARCH_ARM_IOMMU_H__ */ 53 54 /* 55 * Local variables: 56 * mode: C 57 * c-file-style: "BSD" 58 * c-basic-offset: 4 59 * indent-tabs-mode: nil 60 * End: 61 */ 62