Import 2.4.0-test2pre11
[davej-history.git] / include / asm-ppc / pci.h
blob26fe498dc841d81b2d29e279ceb7b5a4f5ff4e88
1 #ifndef __PPC_PCI_H
2 #define __PPC_PCI_H
4 /* Can be used to override the logic in pci_scan_bus for skipping
5 * already-configured bus numbers - to be used for buggy BIOSes
6 * or architectures with incomplete PCI setup by the loader.
7 */
8 #define pcibios_assign_all_busses() 0
10 #define PCIBIOS_MIN_IO 0x1000
11 #define PCIBIOS_MIN_MEM 0x10000000
13 extern inline void pcibios_set_master(struct pci_dev *dev)
15 /* No special bus mastering setup handling */
18 extern inline void pcibios_penalize_isa_irq(int irq)
20 /* We don't do dynamic PCI IRQ allocation */
23 /* Dynamic DMA Mapping stuff
24 * ++ajoshi
27 #include <linux/types.h>
28 #include <linux/slab.h>
29 #include <linux/string.h>
30 #include <asm/scatterlist.h>
31 #include <asm/io.h>
33 struct pci_dev;
35 extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
36 dma_addr_t *dma_handle);
37 extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
38 void *vaddr, dma_addr_t dma_handle);
39 extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
40 size_t size, int direction)
42 if (direction == PCI_DMA_NONE)
43 BUG();
44 return virt_to_bus(ptr);
46 extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
47 size_t size, int direction)
49 if (direction == PCI_DMA_NONE)
50 BUG();
51 /* nothing to do */
53 extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
54 int nents, int direction)
56 if (direction == PCI_DMA_NONE)
57 BUG();
58 return nents;
60 extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
61 int nents, int direction)
63 if (direction == PCI_DMA_NONE)
64 BUG();
65 /* nothing to do */
67 extern inline void pci_dma_sync_single(struct pci_dev *hwdev,
68 dma_addr_t dma_handle,
69 size_t size, int direction)
71 if (direction == PCI_DMA_NONE)
72 BUG();
73 /* nothing to do */
76 extern inline void pci_dma_sync_sg(struct pci_dev *hwdev,
77 struct scatterlist *sg,
78 int nelems, int direction)
80 if (direction == PCI_DMA_NONE)
81 BUG();
82 /* nothing to do */
85 /* Return whether the given PCI device DMA address mask can
86 * be supported properly. For example, if your device can
87 * only drive the low 24-bits during PCI bus mastering, then
88 * you would pass 0x00ffffff as the mask to this function.
90 extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
92 return 1;
95 #define sg_dma_address(sg) (virt_to_bus((sg)->address))
96 #define sg_dma_len(sg) ((sg)->length)
98 #endif /* __PPC_PCI_H */