Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Implement pci_resource_to_user()
This commit is contained in:
Linus Torvalds 2007-12-26 22:04:34 -08:00
Родитель 49eaaa1a6c bcea1db16b
Коммит b50fd73b9d
2 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -1275,4 +1275,20 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
return (device_mask & dma_addr_mask) == dma_addr_mask; return (device_mask & dma_addr_mask) == dma_addr_mask;
} }
void pci_resource_to_user(const struct pci_dev *pdev, int bar,
const struct resource *rp, resource_size_t *start,
resource_size_t *end)
{
struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
unsigned long offset;
if (rp->flags & IORESOURCE_IO)
offset = pbm->io_space.start;
else
offset = pbm->mem_space.start;
*start = rp->start - offset;
*end = rp->end - offset;
}
#endif /* !(CONFIG_PCI) */ #endif /* !(CONFIG_PCI) */

Просмотреть файл

@ -200,6 +200,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
struct device_node; struct device_node;
extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev); extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc,
resource_size_t *start, resource_size_t *end);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __SPARC64_PCI_H */ #endif /* __SPARC64_PCI_H */