1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * This file is derived from asm-powerpc/tce.h. 4 * 5 * Copyright (C) IBM Corporation, 2006 6 * 7 * Author: Muli Ben-Yehuda <muli@il.ibm.com> 8 * Author: Jon Mason <jdmason@us.ibm.com> 9 */ 10 11 #ifndef _ASM_X86_TCE_H 12 #define _ASM_X86_TCE_H 13 14 extern unsigned int specified_table_size; 15 struct iommu_table; 16 17 #define TCE_ENTRY_SIZE 8 /* in bytes */ 18 19 #define TCE_READ_SHIFT 0 20 #define TCE_WRITE_SHIFT 1 21 #define TCE_HUBID_SHIFT 2 /* unused */ 22 #define TCE_RSVD_SHIFT 8 /* unused */ 23 #define TCE_RPN_SHIFT 12 24 #define TCE_UNUSED_SHIFT 48 /* unused */ 25 26 #define TCE_RPN_MASK 0x0000fffffffff000ULL 27 28 extern void tce_build(struct iommu_table *tbl, unsigned long index, 29 unsigned int npages, unsigned long uaddr, int direction); 30 extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages); 31 extern void * __init alloc_tce_table(void); 32 extern void __init free_tce_table(void *tbl); 33 extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar); 34 35 #endif /* _ASM_X86_TCE_H */ 36