aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:07:23 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 18:03:20 -0400
commitf3e6f164c2389853432454c89b316a8ab7485e2f (patch)
tree0e3074fae2e0563def88f9b50e3441f864517b1d
parenta79e4198d1effbba040e9bf407a95fc9b3418789 (diff)
PCI: merge almost all of pci_32.h and pci_64.h together
It was just duplicated code... Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--include/asm-x86/pci.h90
-rw-r--r--include/asm-x86/pci_32.h70
-rw-r--r--include/asm-x86/pci_64.h68
3 files changed, 90 insertions, 138 deletions
diff --git a/include/asm-x86/pci.h b/include/asm-x86/pci.h
index a8cac8c2cde7..e88361966347 100644
--- a/include/asm-x86/pci.h
+++ b/include/asm-x86/pci.h
@@ -1,5 +1,95 @@
1#ifndef __x86_PCI_H
2#define __x86_PCI_H
3
4#include <linux/mm.h> /* for struct page */
5#include <linux/types.h>
6#include <linux/slab.h>
7#include <linux/string.h>
8#include <asm/scatterlist.h>
9#include <asm/io.h>
10
11
12#ifdef __KERNEL__
13
14struct pci_sysdata {
15 int domain; /* PCI domain */
16 int node; /* NUMA node */
17#ifdef CONFIG_X86_64
18 void* iommu; /* IOMMU private data */
19#endif
20};
21
22/* scan a bus after allocating a pci_sysdata for it */
23extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
24
25static inline int pci_domain_nr(struct pci_bus *bus)
26{
27 struct pci_sysdata *sd = bus->sysdata;
28 return sd->domain;
29}
30
31static inline int pci_proc_domain(struct pci_bus *bus)
32{
33 return pci_domain_nr(bus);
34}
35
36
37/* Can be used to override the logic in pci_scan_bus for skipping
38 already-configured bus numbers - to be used for buggy BIOSes
39 or architectures with incomplete PCI setup by the loader */
40
41#ifdef CONFIG_PCI
42extern unsigned int pcibios_assign_all_busses(void);
43#else
44#define pcibios_assign_all_busses() 0
45#endif
46#define pcibios_scan_all_fns(a, b) 0
47
48extern unsigned long pci_mem_start;
49#define PCIBIOS_MIN_IO 0x1000
50#define PCIBIOS_MIN_MEM (pci_mem_start)
51
52#define PCIBIOS_MIN_CARDBUS_IO 0x4000
53
54void pcibios_config_init(void);
55struct pci_bus * pcibios_scan_root(int bus);
56
57void pcibios_set_master(struct pci_dev *dev);
58void pcibios_penalize_isa_irq(int irq, int active);
59struct irq_routing_table *pcibios_get_irq_routing_table(void);
60int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
61
62
63#define HAVE_PCI_MMAP
64extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
65 enum pci_mmap_state mmap_state, int write_combine);
66
67
68#ifdef CONFIG_PCI
69static inline void pci_dma_burst_advice(struct pci_dev *pdev,
70 enum pci_dma_burst_strategy *strat,
71 unsigned long *strategy_parameter)
72{
73 *strat = PCI_DMA_BURST_INFINITY;
74 *strategy_parameter = ~0UL;
75}
76#endif
77
78
79#endif /* __KERNEL__ */
80
1#ifdef CONFIG_X86_32 81#ifdef CONFIG_X86_32
2# include "pci_32.h" 82# include "pci_32.h"
3#else 83#else
4# include "pci_64.h" 84# include "pci_64.h"
5#endif 85#endif
86
87/* implement the pci_ DMA API in terms of the generic device dma_ one */
88#include <asm-generic/pci-dma-compat.h>
89
90/* generic pci stuff */
91#include <asm-generic/pci.h>
92
93
94
95#endif
diff --git a/include/asm-x86/pci_32.h b/include/asm-x86/pci_32.h
index 0d91605cd1e2..8c4c3a0368e2 100644
--- a/include/asm-x86/pci_32.h
+++ b/include/asm-x86/pci_32.h
@@ -4,62 +4,11 @@
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6 6
7struct pci_sysdata {
8 int domain; /* PCI domain */
9 int node; /* NUMA node */
10};
11
12/* scan a bus after allocating a pci_sysdata for it */
13extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
14
15static inline int pci_domain_nr(struct pci_bus *bus)
16{
17 struct pci_sysdata *sd = bus->sysdata;
18 return sd->domain;
19}
20
21static inline int pci_proc_domain(struct pci_bus *bus)
22{
23 return pci_domain_nr(bus);
24}
25
26#include <linux/mm.h> /* for struct page */
27
28/* Can be used to override the logic in pci_scan_bus for skipping
29 already-configured bus numbers - to be used for buggy BIOSes
30 or architectures with incomplete PCI setup by the loader */
31
32#ifdef CONFIG_PCI
33extern unsigned int pcibios_assign_all_busses(void);
34#else
35#define pcibios_assign_all_busses() 0
36#endif
37#define pcibios_scan_all_fns(a, b) 0
38
39extern unsigned long pci_mem_start;
40#define PCIBIOS_MIN_IO 0x1000
41#define PCIBIOS_MIN_MEM (pci_mem_start)
42
43#define PCIBIOS_MIN_CARDBUS_IO 0x4000
44
45void pcibios_config_init(void);
46struct pci_bus * pcibios_scan_root(int bus);
47
48void pcibios_set_master(struct pci_dev *dev);
49void pcibios_penalize_isa_irq(int irq, int active);
50struct irq_routing_table *pcibios_get_irq_routing_table(void);
51int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
52 7
53/* Dynamic DMA mapping stuff. 8/* Dynamic DMA mapping stuff.
54 * i386 has everything mapped statically. 9 * i386 has everything mapped statically.
55 */ 10 */
56 11
57#include <linux/types.h>
58#include <linux/slab.h>
59#include <asm/scatterlist.h>
60#include <linux/string.h>
61#include <asm/io.h>
62
63struct pci_dev; 12struct pci_dev;
64 13
65/* The PCI address space does equal the physical memory 14/* The PCI address space does equal the physical memory
@@ -76,27 +25,8 @@ struct pci_dev;
76#define pci_unmap_len(PTR, LEN_NAME) (0) 25#define pci_unmap_len(PTR, LEN_NAME) (0)
77#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 26#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
78 27
79#define HAVE_PCI_MMAP
80extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
81 enum pci_mmap_state mmap_state, int write_combine);
82
83
84#ifdef CONFIG_PCI
85static inline void pci_dma_burst_advice(struct pci_dev *pdev,
86 enum pci_dma_burst_strategy *strat,
87 unsigned long *strategy_parameter)
88{
89 *strat = PCI_DMA_BURST_INFINITY;
90 *strategy_parameter = ~0UL;
91}
92#endif
93 28
94#endif /* __KERNEL__ */ 29#endif /* __KERNEL__ */
95 30
96/* implement the pci_ DMA API in terms of the generic device dma_ one */
97#include <asm-generic/pci-dma-compat.h>
98
99/* generic pci stuff */
100#include <asm-generic/pci.h>
101 31
102#endif /* __i386_PCI_H */ 32#endif /* __i386_PCI_H */
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h
index 0a123d6a820f..9baa46d9f594 100644
--- a/include/asm-x86/pci_64.h
+++ b/include/asm-x86/pci_64.h
@@ -1,28 +1,9 @@
1#ifndef __x8664_PCI_H 1#ifndef __x8664_PCI_H
2#define __x8664_PCI_H 2#define __x8664_PCI_H
3 3
4#include <asm/io.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7 6
8struct pci_sysdata {
9 int domain; /* PCI domain */
10 int node; /* NUMA node */
11 void* iommu; /* IOMMU private data */
12};
13
14extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
15
16static inline int pci_domain_nr(struct pci_bus *bus)
17{
18 struct pci_sysdata *sd = bus->sysdata;
19 return sd->domain;
20}
21
22static inline int pci_proc_domain(struct pci_bus *bus)
23{
24 return pci_domain_nr(bus);
25}
26 7
27#ifdef CONFIG_CALGARY_IOMMU 8#ifdef CONFIG_CALGARY_IOMMU
28static inline void* pci_iommu(struct pci_bus *bus) 9static inline void* pci_iommu(struct pci_bus *bus)
@@ -38,40 +19,11 @@ static inline void set_pci_iommu(struct pci_bus *bus, void *val)
38} 19}
39#endif /* CONFIG_CALGARY_IOMMU */ 20#endif /* CONFIG_CALGARY_IOMMU */
40 21
41#include <linux/mm.h> /* for struct page */
42
43/* Can be used to override the logic in pci_scan_bus for skipping
44 already-configured bus numbers - to be used for buggy BIOSes
45 or architectures with incomplete PCI setup by the loader */
46 22
47#ifdef CONFIG_PCI
48extern unsigned int pcibios_assign_all_busses(void);
49#else
50#define pcibios_assign_all_busses() 0
51#endif
52#define pcibios_scan_all_fns(a, b) 0
53
54extern unsigned long pci_mem_start;
55#define PCIBIOS_MIN_IO 0x1000
56#define PCIBIOS_MIN_MEM (pci_mem_start)
57
58#define PCIBIOS_MIN_CARDBUS_IO 0x4000
59
60void pcibios_config_init(void);
61struct pci_bus * pcibios_scan_root(int bus);
62extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); 23extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
63extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); 24extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
64 25
65void pcibios_set_master(struct pci_dev *dev);
66void pcibios_penalize_isa_irq(int irq, int active);
67struct irq_routing_table *pcibios_get_irq_routing_table(void);
68int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
69 26
70#include <linux/types.h>
71#include <linux/slab.h>
72#include <asm/scatterlist.h>
73#include <linux/string.h>
74#include <asm/page.h>
75 27
76extern void pci_iommu_alloc(void); 28extern void pci_iommu_alloc(void);
77extern int iommu_setup(char *opt); 29extern int iommu_setup(char *opt);
@@ -112,27 +64,7 @@ extern int iommu_setup(char *opt);
112 64
113#endif 65#endif
114 66
115#include <asm-generic/pci-dma-compat.h>
116
117#ifdef CONFIG_PCI
118static inline void pci_dma_burst_advice(struct pci_dev *pdev,
119 enum pci_dma_burst_strategy *strat,
120 unsigned long *strategy_parameter)
121{
122 *strat = PCI_DMA_BURST_INFINITY;
123 *strategy_parameter = ~0UL;
124}
125#endif
126
127#define HAVE_PCI_MMAP
128extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
129 enum pci_mmap_state mmap_state, int write_combine);
130
131#endif /* __KERNEL__ */ 67#endif /* __KERNEL__ */
132 68
133/* generic pci stuff */
134#ifdef CONFIG_PCI
135#include <asm-generic/pci.h>
136#endif
137 69
138#endif /* __x8664_PCI_H */ 70#endif /* __x8664_PCI_H */