diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-06-30 06:49:38 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-30 06:49:38 +0200 |
commit | e9dd2561793c05d70c9df1bc16a2dde6f23388df (patch) | |
tree | 20099972569cc0748133a6351600fff9cbb15f4a /arch/ppc/kernel/pci.c | |
parent | Merge /spare/repo/netdev-2.6 branch 'ieee80211' (diff) | |
parent | Merge upstream 2.6.13-rc1-git1 into 'ieee80211' branch of netdev-2.6. (diff) | |
download | linux-e9dd2561793c05d70c9df1bc16a2dde6f23388df.tar.xz linux-e9dd2561793c05d70c9df1bc16a2dde6f23388df.zip |
Merge /spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'arch/ppc/kernel/pci.c')
-rw-r--r-- | arch/ppc/kernel/pci.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 6d7b92d72458..70cfb6ffd877 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c @@ -1495,7 +1495,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev, *offset += hose->pci_mem_offset; res_bit = IORESOURCE_MEM; } else { - io_offset = (unsigned long)hose->io_base_virt; + io_offset = hose->io_base_virt - ___IO_BASE; *offset += io_offset; res_bit = IORESOURCE_IO; } @@ -1522,7 +1522,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev, /* found it! construct the final physical address */ if (mmap_state == pci_mmap_io) - *offset += hose->io_base_phys - _IO_BASE; + *offset += hose->io_base_phys - io_offset; return rp; } @@ -1739,6 +1739,23 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) return result; } +void pci_resource_to_user(const struct pci_dev *dev, int bar, + const struct resource *rsrc, + u64 *start, u64 *end) +{ + struct pci_controller *hose = pci_bus_to_hose(dev->bus->number); + unsigned long offset = 0; + + if (hose == NULL) + return; + + if (rsrc->flags & IORESOURCE_IO) + offset = ___IO_BASE - hose->io_base_virt + hose->io_base_phys; + + *start = rsrc->start + offset; + *end = rsrc->end + offset; +} + void __init pci_init_resource(struct resource *res, unsigned long start, unsigned long end, int flags, char *name) |