Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs into...
[deliverable/linux.git] / arch / x86 / include / asm / pci_64.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_PCI_64_H
2#define _ASM_X86_PCI_64_H
1da177e4 3
1da177e4
LT
4#ifdef __KERNEL__
5
08f1c192 6#ifdef CONFIG_CALGARY_IOMMU
3cb47d79 7static inline void *pci_iommu(struct pci_bus *bus)
08f1c192
MBY
8{
9 struct pci_sysdata *sd = bus->sysdata;
10 return sd->iommu;
11}
12
13static inline void set_pci_iommu(struct pci_bus *bus, void *val)
14{
15 struct pci_sysdata *sd = bus->sysdata;
16 sd->iommu = val;
17}
18#endif /* CONFIG_CALGARY_IOMMU */
19
3cb47d79
JP
20extern int (*pci_config_read)(int seg, int bus, int dev, int fn,
21 int reg, int len, u32 *value);
22extern int (*pci_config_write)(int seg, int bus, int dev, int fn,
23 int reg, int len, u32 value);
1da177e4 24
752bea4a 25extern void dma32_reserve_bootmem(void);
0dc243ae 26extern void pci_iommu_alloc(void);
1da177e4 27
1da177e4
LT
28/* The PCI address space does equal the physical memory
29 * address space. The networking and block device layers use
30 * this boolean for bounce buffer decisions
31 *
17a941d8
MBY
32 * On AMD64 it mostly equals, but we set it to zero if a hardware
33 * IOMMU (gart) of sotware IOMMU (swiotlb) is available.
1da177e4 34 */
17a941d8
MBY
35#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
36
966396d3 37#if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU)
1da177e4 38
1da177e4
LT
39#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
40 dma_addr_t ADDR_NAME;
41#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
42 __u32 LEN_NAME;
43#define pci_unmap_addr(PTR, ADDR_NAME) \
44 ((PTR)->ADDR_NAME)
45#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
46 (((PTR)->ADDR_NAME) = (VAL))
47#define pci_unmap_len(PTR, LEN_NAME) \
48 ((PTR)->LEN_NAME)
49#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
50 (((PTR)->LEN_NAME) = (VAL))
51
52#else
53/* No IOMMU */
54
1da177e4
LT
55#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
56#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
57#define pci_unmap_addr(PTR, ADDR_NAME) (0)
58#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
59#define pci_unmap_len(PTR, LEN_NAME) (0)
60#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
61
62#endif
63
1da177e4
LT
64#endif /* __KERNEL__ */
65
1965aae3 66#endif /* _ASM_X86_PCI_64_H */
This page took 0.367655 seconds and 5 git commands to generate.