pci.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * pcibios_resource_to_bus - convert resource to PCI bus address
  10. * @dev: device which owns this resource
  11. * @region: converted bus-centric region (start,end)
  12. * @res: resource to convert
  13. *
  14. * Convert a resource to a PCI device bus address or bus window.
  15. */
  16. static inline void
  17. pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
  18. struct resource *res)
  19. {
  20. region->start = res->start;
  21. region->end = res->end;
  22. }
  23. static inline void
  24. pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
  25. struct pci_bus_region *region)
  26. {
  27. res->start = region->start;
  28. res->end = region->end;
  29. }
  30. #define pcibios_scan_all_fns(a, b) 0
  31. #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
  32. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  33. {
  34. return channel ? 15 : 14;
  35. }
  36. #endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */
  37. /*
  38. * By default, assume that no iommu is in use and that the PCI
  39. * space is mapped to address physical 0.
  40. */
  41. #ifndef PCI_DMA_BUS_IS_PHYS
  42. #define PCI_DMA_BUS_IS_PHYS (1)
  43. #endif
  44. #endif /* _ASM_GENERIC_PCI_H */