Commit bc4b024a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Bjorn Helgaas

PCI: Move pci_dma_* helpers to common code

For a long time all architectures implement the pci_dma_* functions using
the generic DMA API, and they all use the same header to do so.

Move this header, pci-dma-compat.h, to include/linux and include it from
the generic pci.h instead of having each arch duplicate this include.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 611609bc
...@@ -65,13 +65,6 @@ extern void pcibios_set_master(struct pci_dev *dev); ...@@ -65,13 +65,6 @@ extern void pcibios_set_master(struct pci_dev *dev);
decisions. */ decisions. */
#define PCI_DMA_BUS_IS_PHYS 0 #define PCI_DMA_BUS_IS_PHYS 0
#ifdef CONFIG_PCI
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
#endif
/* TODO: integrate with include/asm-generic/pci.h ? */ /* TODO: integrate with include/asm-generic/pci.h ? */
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{ {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define ASMARM_PCI_H #define ASMARM_PCI_H
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm-generic/pci-dma-compat.h>
#include <asm/mach/pci.h> /* for pci_sys_data */ #include <asm/mach/pci.h> /* for pci_sys_data */
extern unsigned long pcibios_min_io; extern unsigned long pcibios_min_io;
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm-generic/pci-dma-compat.h>
#define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0 #define PCIBIOS_MIN_MEM 0
......
...@@ -5,6 +5,4 @@ ...@@ -5,6 +5,4 @@
#define PCI_DMA_BUS_IS_PHYS (1) #define PCI_DMA_BUS_IS_PHYS (1)
#include <asm-generic/pci-dma-compat.h>
#endif /* __ASM_AVR32_PCI_H__ */ #endif /* __ASM_AVR32_PCI_H__ */
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#define _ASM_BFIN_PCI_H #define _ASM_BFIN_PCI_H
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <asm-generic/pci-dma-compat.h>
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
#define PCIBIOS_MIN_IO 0x00001000 #define PCIBIOS_MIN_IO 0x00001000
......
...@@ -48,9 +48,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, ...@@ -48,9 +48,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
/* generic pci stuff */ /* generic pci stuff */
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <asm-generic/pci-dma-compat.h>
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
struct pci_dev; struct pci_dev;
......
...@@ -50,8 +50,6 @@ struct pci_dev; ...@@ -50,8 +50,6 @@ struct pci_dev;
extern unsigned long ia64_max_iommu_merge_mask; extern unsigned long ia64_max_iommu_merge_mask;
#define PCI_DMA_BUS_IS_PHYS (ia64_max_iommu_merge_mask == ~0UL) #define PCI_DMA_BUS_IS_PHYS (ia64_max_iommu_merge_mask == ~0UL)
#include <asm-generic/pci-dma-compat.h>
#define HAVE_PCI_MMAP #define HAVE_PCI_MMAP
extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine); enum pci_mmap_state mmap_state, int write_combine);
......
#ifndef _ASM_M68K_PCI_H #ifndef _ASM_M68K_PCI_H
#define _ASM_M68K_PCI_H #define _ASM_M68K_PCI_H
#include <asm-generic/pci-dma-compat.h>
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
/* The PCI address space does equal the physical memory /* The PCI address space does equal the physical memory
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm-generic/pci-dma-compat.h>
#define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000 #define PCIBIOS_MIN_MEM 0x10000000
......
...@@ -124,9 +124,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) ...@@ -124,9 +124,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
/* Do platform specific device initialization at pci_enable_device() time */ /* Do platform specific device initialization at pci_enable_device() time */
extern int pcibios_plat_dev_init(struct pci_dev *dev); extern int pcibios_plat_dev_init(struct pci_dev *dev);
......
...@@ -80,9 +80,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, ...@@ -80,9 +80,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{ {
return channel ? 15 : 14; return channel ? 15 : 14;
......
...@@ -194,9 +194,6 @@ extern void pcibios_init_bridge(struct pci_dev *); ...@@ -194,9 +194,6 @@ extern void pcibios_init_bridge(struct pci_dev *);
#define PCIBIOS_MIN_IO 0x10 #define PCIBIOS_MIN_IO 0x10
#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */ #define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */
/* export the pci_ DMA API in terms of the dma_ one */
#include <asm-generic/pci-dma-compat.h>
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{ {
return channel ? 15 : 14; return channel ? 15 : 14;
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm-generic/pci-dma-compat.h>
/* Return values for pci_controller_ops.probe_mode function */ /* Return values for pci_controller_ops.probe_mode function */
#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ #define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
#include <asm-generic/pci-dma-compat.h>
#include <asm/pci_clp.h> #include <asm/pci_clp.h>
#include <asm/pci_debug.h> #include <asm/pci_debug.h>
......
...@@ -105,9 +105,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) ...@@ -105,9 +105,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
return channel ? 15 : 14; return channel ? 15 : 14;
} }
/* generic DMA-mapping stuff */
#include <asm-generic/pci-dma-compat.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __ASM_SH_PCI_H */ #endif /* __ASM_SH_PCI_H */
...@@ -5,7 +5,4 @@ ...@@ -5,7 +5,4 @@
#else #else
#include <asm/pci_32.h> #include <asm/pci_32.h>
#endif #endif
#include <asm-generic/pci-dma-compat.h>
#endif #endif
...@@ -226,7 +226,4 @@ static inline int pcibios_assign_all_busses(void) ...@@ -226,7 +226,4 @@ static inline int pcibios_assign_all_busses(void)
/* Use any cpu for PCI. */ /* Use any cpu for PCI. */
#define cpumask_of_pcibus(bus) cpu_online_mask #define cpumask_of_pcibus(bus) cpu_online_mask
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
#endif /* _ASM_TILE_PCI_H */ #endif /* _ASM_TILE_PCI_H */
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#define __UNICORE_PCI_H__ #define __UNICORE_PCI_H__
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm-generic/pci-dma-compat.h>
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
#include <mach/hardware.h> /* for PCIBIOS_MIN_* */ #include <mach/hardware.h> /* for PCIBIOS_MIN_* */
......
...@@ -105,9 +105,6 @@ void native_restore_msi_irqs(struct pci_dev *dev); ...@@ -105,9 +105,6 @@ void native_restore_msi_irqs(struct pci_dev *dev);
#include <asm/pci_64.h> #include <asm/pci_64.h>
#endif #endif
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
/* generic pci stuff */ /* generic pci stuff */
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
......
...@@ -55,9 +55,6 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, ...@@ -55,9 +55,6 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/* Implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
/* Generic PCI */ /* Generic PCI */
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
......
...@@ -2011,4 +2011,8 @@ static inline bool pci_ari_enabled(struct pci_bus *bus) ...@@ -2011,4 +2011,8 @@ static inline bool pci_ari_enabled(struct pci_bus *bus)
{ {
return bus->self && bus->self->ari_enabled; return bus->self && bus->self->ari_enabled;
} }
/* provide the legacy pci_dma_* API */
#include <linux/pci-dma-compat.h>
#endif /* LINUX_PCI_H */ #endif /* LINUX_PCI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment