diff options
author | Milton Miller <miltonm@bga.com> | 2009-01-07 21:19:46 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-02-11 00:00:07 -0500 |
commit | c3bd517de67d33c44059656194e316facef181a5 (patch) | |
tree | 8b61341ac8aec4d18499ce7a99d545b2912abb9a /arch/powerpc/kernel/pci_64.c | |
parent | 6071ed0487c6ea8dcfadd9844b9b90944cd9de1e (diff) |
powerpc/pci: Move hose_list and pci_address_to_pio to pci-common
move the definition of hose_list next to its hotplug spinlock.
create pcibios_io_size to encapsulate ifdef in existing pci-common
function pcibios_vaddr_is_ioport
move pci_address_to_pio to pci-common, using new pcibios_io_size, and
protect this GPL exported function against concurrent hotplug removal
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index ea8eda8c87cf..be574fc0d92f 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -43,8 +43,6 @@ unsigned long pci_probe_only = 1; | |||
43 | unsigned long pci_io_base = ISA_IO_BASE; | 43 | unsigned long pci_io_base = ISA_IO_BASE; |
44 | EXPORT_SYMBOL(pci_io_base); | 44 | EXPORT_SYMBOL(pci_io_base); |
45 | 45 | ||
46 | LIST_HEAD(hose_list); | ||
47 | |||
48 | static void fixup_broken_pcnet32(struct pci_dev* dev) | 46 | static void fixup_broken_pcnet32(struct pci_dev* dev) |
49 | { | 47 | { |
50 | if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { | 48 | if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { |
@@ -524,23 +522,6 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus) | |||
524 | } | 522 | } |
525 | EXPORT_SYMBOL_GPL(pcibios_map_io_space); | 523 | EXPORT_SYMBOL_GPL(pcibios_map_io_space); |
526 | 524 | ||
527 | unsigned long pci_address_to_pio(phys_addr_t address) | ||
528 | { | ||
529 | struct pci_controller *hose, *tmp; | ||
530 | |||
531 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { | ||
532 | if (address >= hose->io_base_phys && | ||
533 | address < (hose->io_base_phys + hose->pci_io_size)) { | ||
534 | unsigned long base = | ||
535 | (unsigned long)hose->io_base_virt - _IO_BASE; | ||
536 | return base + (address - hose->io_base_phys); | ||
537 | } | ||
538 | } | ||
539 | return (unsigned int)-1; | ||
540 | } | ||
541 | EXPORT_SYMBOL_GPL(pci_address_to_pio); | ||
542 | |||
543 | |||
544 | #define IOBASE_BRIDGE_NUMBER 0 | 525 | #define IOBASE_BRIDGE_NUMBER 0 |
545 | #define IOBASE_MEMORY 1 | 526 | #define IOBASE_MEMORY 1 |
546 | #define IOBASE_IO 2 | 527 | #define IOBASE_IO 2 |