diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-19 22:54:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:18:08 -0500 |
commit | fe2d338cdcc628e0abdb4f70570a7fa864c617db (patch) | |
tree | fbcaeabc2cd7f0a8d564b2e32c54254a71116de9 /arch/powerpc/kernel/pci_32.c | |
parent | fa462f2d75e2437b5757069d3d7d27b1e50285cb (diff) |
[POWERPC] Merge pcibios_resource_to_bus/bus_to_resource
This merges the PowerPC 32 and 64 bits version of pcibios_resource_to_bus
and pcibios_bus_to_resource().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 9a79a3d700ba..f05ef5b17892 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -145,38 +145,6 @@ pcibios_fixup_resources(struct pci_dev *dev) | |||
145 | } | 145 | } |
146 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources); | 146 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources); |
147 | 147 | ||
148 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | ||
149 | struct resource *res) | ||
150 | { | ||
151 | resource_size_t offset = 0, mask = (resource_size_t)-1; | ||
152 | struct pci_controller *hose = dev->sysdata; | ||
153 | |||
154 | if (hose && res->flags & IORESOURCE_IO) { | ||
155 | offset = (unsigned long)hose->io_base_virt - isa_io_base; | ||
156 | mask = 0xffffffffu; | ||
157 | } else if (hose && res->flags & IORESOURCE_MEM) | ||
158 | offset = hose->pci_mem_offset; | ||
159 | region->start = (res->start - offset) & mask; | ||
160 | region->end = (res->end - offset) & mask; | ||
161 | } | ||
162 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
163 | |||
164 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
165 | struct pci_bus_region *region) | ||
166 | { | ||
167 | resource_size_t offset = 0, mask = (resource_size_t)-1; | ||
168 | struct pci_controller *hose = dev->sysdata; | ||
169 | |||
170 | if (hose && res->flags & IORESOURCE_IO) { | ||
171 | offset = (unsigned long)hose->io_base_virt - isa_io_base; | ||
172 | mask = 0xffffffffu; | ||
173 | } else if (hose && res->flags & IORESOURCE_MEM) | ||
174 | offset = hose->pci_mem_offset; | ||
175 | res->start = (region->start + offset) & mask; | ||
176 | res->end = (region->end + offset) & mask; | ||
177 | } | ||
178 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
179 | |||
180 | static int skip_isa_ioresource_align(struct pci_dev *dev) | 148 | static int skip_isa_ioresource_align(struct pci_dev *dev) |
181 | { | 149 | { |
182 | if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) && | 150 | if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) && |