aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r--arch/powerpc/kernel/pci-common.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index fe7d1255e11e..083cfbdbe0b2 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -65,7 +65,7 @@ static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
65 spin_unlock(&hose_spinlock); 65 spin_unlock(&hose_spinlock);
66} 66}
67 67
68struct pci_controller * pcibios_alloc_controller(struct device_node *dev) 68__init_refok struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
69{ 69{
70 struct pci_controller *phb; 70 struct pci_controller *phb;
71 71
@@ -101,6 +101,29 @@ void pcibios_free_controller(struct pci_controller *phb)
101 kfree(phb); 101 kfree(phb);
102} 102}
103 103
104int pcibios_vaddr_is_ioport(void __iomem *address)
105{
106 int ret = 0;
107 struct pci_controller *hose;
108 unsigned long size;
109
110 spin_lock(&hose_spinlock);
111 list_for_each_entry(hose, &hose_list, list_node) {
112#ifdef CONFIG_PPC64
113 size = hose->pci_io_size;
114#else
115 size = hose->io_resource.end - hose->io_resource.start + 1;
116#endif
117 if (address >= hose->io_base_virt &&
118 address < (hose->io_base_virt + size)) {
119 ret = 1;
120 break;
121 }
122 }
123 spin_unlock(&hose_spinlock);
124 return ret;
125}
126
104/* 127/*
105 * Return the domain number for this bus. 128 * Return the domain number for this bus.
106 */ 129 */