PCI: add generic pcibios_resource_to_bus()
[linux-2.6-microblaze.git] / include / asm-generic / pci.h
1 /*
2  * linux/include/asm-generic/pci.h
3  *
4  *  Copyright (C) 2003 Russell King
5  */
6 #ifndef _ASM_GENERIC_PCI_H
7 #define _ASM_GENERIC_PCI_H
8
9 #define ARCH_HAS_GENERIC_PCI_OFFSETS
10
11 static inline struct resource *
12 pcibios_select_root(struct pci_dev *pdev, struct resource *res)
13 {
14         struct resource *root = NULL;
15
16         if (res->flags & IORESOURCE_IO)
17                 root = &ioport_resource;
18         if (res->flags & IORESOURCE_MEM)
19                 root = &iomem_resource;
20
21         return root;
22 }
23
24 #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
25 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
26 {
27         return channel ? 15 : 14;
28 }
29 #endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */
30
31 /*
32  * By default, assume that no iommu is in use and that the PCI
33  * space is mapped to address physical 0.
34  */
35 #ifndef PCI_DMA_BUS_IS_PHYS
36 #define PCI_DMA_BUS_IS_PHYS     (1)
37 #endif
38
39 #endif /* _ASM_GENERIC_PCI_H */