Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / include / asm-ppc / pci.h
blob1a661f050cc84b01a4f755acdbe18f3f2130be0b
1 #ifndef __PPC_PCI_H
2 #define __PPC_PCI_H
3 #ifdef __KERNEL__
5 /* Values for the `which' argument to sys_pciconfig_iobase syscall. */
6 #define IOBASE_BRIDGE_NUMBER 0
7 #define IOBASE_MEMORY 1
8 #define IOBASE_IO 2
11 /* Can be used to override the logic in pci_scan_bus for skipping
12 * already-configured bus numbers - to be used for buggy BIOSes
13 * or architectures with incomplete PCI setup by the loader.
15 #define pcibios_assign_all_busses() 0
17 #define PCIBIOS_MIN_IO 0x1000
18 #define PCIBIOS_MIN_MEM 0x10000000
20 extern inline void pcibios_set_master(struct pci_dev *dev)
22 /* No special bus mastering setup handling */
25 extern inline void pcibios_penalize_isa_irq(int irq)
27 /* We don't do dynamic PCI IRQ allocation */
30 /* Dynamic DMA Mapping stuff
31 * ++ajoshi
34 #include <linux/types.h>
35 #include <linux/slab.h>
36 #include <linux/string.h>
37 #include <asm/scatterlist.h>
38 #include <asm/io.h>
40 struct pci_dev;
42 extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
43 dma_addr_t *dma_handle);
44 extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
45 void *vaddr, dma_addr_t dma_handle);
46 extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
47 size_t size, int direction)
49 if (direction == PCI_DMA_NONE)
50 BUG();
51 return virt_to_bus(ptr);
53 extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
54 size_t size, int direction)
56 if (direction == PCI_DMA_NONE)
57 BUG();
58 /* nothing to do */
60 extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
61 int nents, int direction)
63 if (direction == PCI_DMA_NONE)
64 BUG();
65 return nents;
67 extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
68 int nents, int direction)
70 if (direction == PCI_DMA_NONE)
71 BUG();
72 /* nothing to do */
74 extern inline void pci_dma_sync_single(struct pci_dev *hwdev,
75 dma_addr_t dma_handle,
76 size_t size, int direction)
78 if (direction == PCI_DMA_NONE)
79 BUG();
80 /* nothing to do */
83 extern inline void pci_dma_sync_sg(struct pci_dev *hwdev,
84 struct scatterlist *sg,
85 int nelems, int direction)
87 if (direction == PCI_DMA_NONE)
88 BUG();
89 /* nothing to do */
92 /* Return whether the given PCI device DMA address mask can
93 * be supported properly. For example, if your device can
94 * only drive the low 24-bits during PCI bus mastering, then
95 * you would pass 0x00ffffff as the mask to this function.
97 extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
99 return 1;
102 #define sg_dma_address(sg) (virt_to_bus((sg)->address))
103 #define sg_dma_len(sg) ((sg)->length)
105 #endif /* __KERNEL__ */
107 #endif /* __PPC_PCI_H */