aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/drivers/pci/pci-lib.c')
-rw-r--r--arch/sh/drivers/pci/pci-lib.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/sh/drivers/pci/pci-lib.c b/arch/sh/drivers/pci/pci-lib.c
index 654ffcc67d0a..9fd3af9db462 100644
--- a/arch/sh/drivers/pci/pci-lib.c
+++ b/arch/sh/drivers/pci/pci-lib.c
@@ -39,6 +39,37 @@ void pcibios_align_resource(void *data, struct resource *res,
39 res->start = start; 39 res->start = start;
40} 40}
41 41
42void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
43 struct resource *res)
44{
45 struct pci_channel *hose = dev->sysdata;
46 unsigned long offset = 0;
47
48 if (res->flags & IORESOURCE_IO)
49 offset = hose->io_offset;
50 else if (res->flags & IORESOURCE_MEM)
51 offset = hose->mem_offset;
52
53 region->start = res->start - offset;
54 region->end = res->end - offset;
55}
56
57void __devinit
58pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
59 struct pci_bus_region *region)
60{
61 struct pci_channel *hose = dev->sysdata;
62 unsigned long offset = 0;
63
64 if (res->flags & IORESOURCE_IO)
65 offset = hose->io_offset;
66 else if (res->flags & IORESOURCE_MEM)
67 offset = hose->mem_offset;
68
69 res->start = region->start + offset;
70 res->end = region->end + offset;
71}
72
42int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 73int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
43 enum pci_mmap_state mmap_state, int write_combine) 74 enum pci_mmap_state mmap_state, int write_combine)
44{ 75{