[PATCH] PCI: Clear abnormal poweroff flag on VIA southbridges, fix resume
[linux-2.6/mini2440.git] / include / asm-x86_64 / tce.h
blob53e9a68b33360bcf372d04b4586231d9b94311b1
1 /*
2 * This file is derived from asm-powerpc/tce.h.
4 * Copyright (C) IBM Corporation, 2006
6 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
7 * Author: Jon Mason <jdmason@us.ibm.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef _ASM_X86_64_TCE_H
25 #define _ASM_X86_64_TCE_H
27 extern void* tce_table_kva[];
28 extern unsigned int specified_table_size;
29 struct iommu_table;
31 #define TCE_ENTRY_SIZE 8 /* in bytes */
33 #define TCE_READ_SHIFT 0
34 #define TCE_WRITE_SHIFT 1
35 #define TCE_HUBID_SHIFT 2 /* unused */
36 #define TCE_RSVD_SHIFT 8 /* unused */
37 #define TCE_RPN_SHIFT 12
38 #define TCE_UNUSED_SHIFT 48 /* unused */
40 #define TCE_RPN_MASK 0x0000fffffffff000ULL
42 extern void tce_build(struct iommu_table *tbl, unsigned long index,
43 unsigned int npages, unsigned long uaddr, int direction);
44 extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages);
45 extern void* alloc_tce_table(void);
46 extern void free_tce_table(void *tbl);
47 extern int build_tce_table(struct pci_dev *dev, void __iomem *bbar);
49 #endif /* _ASM_X86_64_TCE_H */