- patches.rt/0001-sched-count-of-queued-RT-tasks.patch: Delete.
[linux-flexiantxendom0-3.2.10.git] / include / asm-x86 / mach-xen / asm / pci_64.h
1 #ifndef __x8664_PCI_H
2 #define __x8664_PCI_H
3
4
5 #ifdef __KERNEL__
6
7
8 #ifdef CONFIG_CALGARY_IOMMU
9 static inline void* pci_iommu(struct pci_bus *bus)
10 {
11         struct pci_sysdata *sd = bus->sysdata;
12         return sd->iommu;
13 }
14
15 static inline void set_pci_iommu(struct pci_bus *bus, void *val)
16 {
17         struct pci_sysdata *sd = bus->sysdata;
18         sd->iommu = val;
19 }
20 #endif /* CONFIG_CALGARY_IOMMU */
21
22
23 extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
24 extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
25
26
27
28 extern void pci_iommu_alloc(void);
29 extern int iommu_setup(char *opt);
30
31 /* The PCI address space does equal the physical memory
32  * address space.  The networking and block device layers use
33  * this boolean for bounce buffer decisions
34  *
35  * On AMD64 it mostly equals, but we set it to zero if a hardware
36  * IOMMU (gart) of sotware IOMMU (swiotlb) is available.
37  */
38 #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
39
40 #if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU)
41
42 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)       \
43         dma_addr_t ADDR_NAME;
44 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)         \
45         __u32 LEN_NAME;
46 #define pci_unmap_addr(PTR, ADDR_NAME)                  \
47         ((PTR)->ADDR_NAME)
48 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)         \
49         (((PTR)->ADDR_NAME) = (VAL))
50 #define pci_unmap_len(PTR, LEN_NAME)                    \
51         ((PTR)->LEN_NAME)
52 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)           \
53         (((PTR)->LEN_NAME) = (VAL))
54
55 #elif defined(CONFIG_SWIOTLB)
56
57 #define pci_dac_dma_supported(pci_dev, mask)    1
58
59 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)       \
60         dma_addr_t ADDR_NAME;
61 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)         \
62         __u32 LEN_NAME;
63 #define pci_unmap_addr(PTR, ADDR_NAME)                  \
64         ((PTR)->ADDR_NAME)
65 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)         \
66         (((PTR)->ADDR_NAME) = (VAL))
67 #define pci_unmap_len(PTR, LEN_NAME)                    \
68         ((PTR)->LEN_NAME)
69 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)           \
70         (((PTR)->LEN_NAME) = (VAL))
71
72 #else
73 /* No IOMMU */
74
75 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
76 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
77 #define pci_unmap_addr(PTR, ADDR_NAME)          (0)
78 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
79 #define pci_unmap_len(PTR, LEN_NAME)            (0)
80 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)   do { } while (0)
81
82 #endif
83
84 #endif /* __KERNEL__ */
85
86
87 #endif /* __x8664_PCI_H */