treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
[linux-block.git] / arch / x86 / include / asm / tce.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
e465058d 2/*
e465058d
JM
3 * This file is derived from asm-powerpc/tce.h.
4 *
aa0a9f37
MBY
5 * Copyright (C) IBM Corporation, 2006
6 *
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
8 * Author: Jon Mason <jdmason@us.ibm.com>
e465058d
JM
9 */
10
1965aae3
PA
11#ifndef _ASM_X86_TCE_H
12#define _ASM_X86_TCE_H
e465058d 13
e465058d
JM
14extern unsigned int specified_table_size;
15struct 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
28extern void tce_build(struct iommu_table *tbl, unsigned long index,
7c4d4784 29 unsigned int npages, unsigned long uaddr, int direction);
e465058d 30extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages);
e6b33220
RD
31extern void * __init alloc_tce_table(void);
32extern void __init free_tce_table(void *tbl);
33extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar);
e465058d 34
1965aae3 35#endif /* _ASM_X86_TCE_H */