X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fpci.h;h=e0d2983b7a3b0dc1fb58bbe00553e35953165148;hb=a2f44b27303a5353859d77a3e96a1d3f33f56ab7;hp=8a05af264d1865d57e429ce69e696cc379b2dc95;hpb=134734d875a0a48d994ef20b9905209b4b8b6f75;p=linux-2.6.git diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index 8a05af264..e0d2983b7 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h @@ -1,7 +1,6 @@ #ifndef __x8664_PCI_H #define __x8664_PCI_H -#include #include #ifdef __KERNEL__ @@ -40,8 +39,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); #include #include #include -#include /* for have_iommu */ +extern void pci_iommu_alloc(void); extern int iommu_setup(char *opt); /* The PCI address space does equal the physical memory @@ -53,7 +52,7 @@ extern int iommu_setup(char *opt); */ #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) -#ifdef CONFIG_GART_IOMMU +#if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU) /* * x86-64 always supports DAC, but sometimes it is useful to force @@ -63,6 +62,23 @@ extern int iommu_setup(char *opt); extern int iommu_sac_force; #define pci_dac_dma_supported(pci_dev, mask) (!iommu_sac_force) +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ + dma_addr_t ADDR_NAME; +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ + __u32 LEN_NAME; +#define pci_unmap_addr(PTR, ADDR_NAME) \ + ((PTR)->ADDR_NAME) +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ + (((PTR)->ADDR_NAME) = (VAL)) +#define pci_unmap_len(PTR, LEN_NAME) \ + ((PTR)->LEN_NAME) +#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ + (((PTR)->LEN_NAME) = (VAL)) + +#elif defined(CONFIG_SWIOTLB) + +#define pci_dac_dma_supported(pci_dev, mask) 1 + #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ dma_addr_t ADDR_NAME; #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ @@ -147,4 +163,13 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) #include #endif +#ifdef CONFIG_XEN +/* On Xen we have to scan all functions since Xen hides bridges from + * us. If a bridge is at fn=0 and that slot has a multifunction + * device, we won't find the additional devices without scanning all + * functions. */ +#undef pcibios_scan_all_fns +#define pcibios_scan_all_fns(a, b) 1 +#endif + #endif /* __x8664_PCI_H */