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_32.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_32.c')
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 132cd80afa21..c6368506455f 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/prom.h> | 20 | #include <asm/prom.h> |
21 | #include <asm/sections.h> | 21 | #include <asm/sections.h> |
22 | #include <asm/pci-bridge.h> | 22 | #include <asm/pci-bridge.h> |
23 | #include <asm/ppc-pci.h> | ||
23 | #include <asm/byteorder.h> | 24 | #include <asm/byteorder.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
25 | #include <asm/machdep.h> | 26 | #include <asm/machdep.h> |
@@ -43,8 +44,6 @@ static u8* pci_to_OF_bus_map; | |||
43 | */ | 44 | */ |
44 | static int pci_assign_all_buses; | 45 | static int pci_assign_all_buses; |
45 | 46 | ||
46 | LIST_HEAD(hose_list); | ||
47 | |||
48 | static int pci_bus_count; | 47 | static int pci_bus_count; |
49 | 48 | ||
50 | /* This will remain NULL for now, until isa-bridge.c is made common | 49 | /* This will remain NULL for now, until isa-bridge.c is made common |
@@ -491,24 +490,6 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) | |||
491 | return result; | 490 | return result; |
492 | } | 491 | } |
493 | 492 | ||
494 | unsigned long pci_address_to_pio(phys_addr_t address) | ||
495 | { | ||
496 | struct pci_controller *hose, *tmp; | ||
497 | |||
498 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { | ||
499 | unsigned int size = hose->io_resource.end - | ||
500 | hose->io_resource.start + 1; | ||
501 | if (address >= hose->io_base_phys && | ||
502 | address < (hose->io_base_phys + size)) { | ||
503 | unsigned long base = | ||
504 | (unsigned long)hose->io_base_virt - _IO_BASE; | ||
505 | return base + (address - hose->io_base_phys); | ||
506 | } | ||
507 | } | ||
508 | return (unsigned int)-1; | ||
509 | } | ||
510 | EXPORT_SYMBOL(pci_address_to_pio); | ||
511 | |||
512 | /* | 493 | /* |
513 | * Null PCI config access functions, for the case when we can't | 494 | * Null PCI config access functions, for the case when we can't |
514 | * find a hose. | 495 | * find a hose. |