diff options
Diffstat (limited to 'arch/sparc/include/asm/dma.h')
-rw-r--r-- | arch/sparc/include/asm/dma.h | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/arch/sparc/include/asm/dma.h b/arch/sparc/include/asm/dma.h index b554927bbaf6..3d434ef5eae3 100644 --- a/arch/sparc/include/asm/dma.h +++ b/arch/sparc/include/asm/dma.h | |||
@@ -92,27 +92,31 @@ extern int isa_dma_bridge_buggy; | |||
92 | #ifdef CONFIG_SPARC32 | 92 | #ifdef CONFIG_SPARC32 |
93 | 93 | ||
94 | /* Routines for data transfer buffers. */ | 94 | /* Routines for data transfer buffers. */ |
95 | BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long) | ||
96 | BTFIXUPDEF_CALL(void, mmu_unlockarea, char *, unsigned long) | ||
97 | |||
98 | #define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len) | ||
99 | #define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len) | ||
100 | |||
101 | struct page; | ||
102 | struct device; | 95 | struct device; |
103 | struct scatterlist; | 96 | struct scatterlist; |
104 | 97 | ||
105 | /* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */ | 98 | struct sparc32_dma_ops { |
106 | BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, struct device *, char *, unsigned long) | 99 | __u32 (*get_scsi_one)(struct device *, char *, unsigned long); |
107 | BTFIXUPDEF_CALL(void, mmu_get_scsi_sgl, struct device *, struct scatterlist *, int) | 100 | void (*get_scsi_sgl)(struct device *, struct scatterlist *, int); |
108 | BTFIXUPDEF_CALL(void, mmu_release_scsi_one, struct device *, __u32, unsigned long) | 101 | void (*release_scsi_one)(struct device *, __u32, unsigned long); |
109 | BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct device *, struct scatterlist *, int) | 102 | void (*release_scsi_sgl)(struct device *, struct scatterlist *,int); |
110 | 103 | #ifdef CONFIG_SBUS | |
111 | #define mmu_get_scsi_one(dev,vaddr,len) BTFIXUP_CALL(mmu_get_scsi_one)(dev,vaddr,len) | 104 | int (*map_dma_area)(struct device *, dma_addr_t *, unsigned long, unsigned long, int); |
112 | #define mmu_get_scsi_sgl(dev,sg,sz) BTFIXUP_CALL(mmu_get_scsi_sgl)(dev,sg,sz) | 105 | void (*unmap_dma_area)(struct device *, unsigned long, int); |
113 | #define mmu_release_scsi_one(dev,vaddr,len) BTFIXUP_CALL(mmu_release_scsi_one)(dev,vaddr,len) | 106 | #endif |
114 | #define mmu_release_scsi_sgl(dev,sg,sz) BTFIXUP_CALL(mmu_release_scsi_sgl)(dev,sg,sz) | 107 | }; |
115 | 108 | extern const struct sparc32_dma_ops *sparc32_dma_ops; | |
109 | |||
110 | #define mmu_get_scsi_one(dev,vaddr,len) \ | ||
111 | sparc32_dma_ops->get_scsi_one(dev, vaddr, len) | ||
112 | #define mmu_get_scsi_sgl(dev,sg,sz) \ | ||
113 | sparc32_dma_ops->get_scsi_sgl(dev, sg, sz) | ||
114 | #define mmu_release_scsi_one(dev,vaddr,len) \ | ||
115 | sparc32_dma_ops->release_scsi_one(dev, vaddr,len) | ||
116 | #define mmu_release_scsi_sgl(dev,sg,sz) \ | ||
117 | sparc32_dma_ops->release_scsi_sgl(dev, sg, sz) | ||
118 | |||
119 | #ifdef CONFIG_SBUS | ||
116 | /* | 120 | /* |
117 | * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep. | 121 | * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep. |
118 | * | 122 | * |
@@ -123,17 +127,17 @@ BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct device *, struct scatterlist | |||
123 | * Second mapping is for device visible address, or "bus" address. | 127 | * Second mapping is for device visible address, or "bus" address. |
124 | * The bus address is returned at '*pba'. | 128 | * The bus address is returned at '*pba'. |
125 | * | 129 | * |
126 | * These functions seem distinct, but are hard to split. On sun4c, | 130 | * These functions seem distinct, but are hard to split. |
127 | * at least for now, 'a' is equal to bus address, and retured in *pba. | ||
128 | * On sun4m, page attributes depend on the CPU type, so we have to | 131 | * On sun4m, page attributes depend on the CPU type, so we have to |
129 | * know if we are mapping RAM or I/O, so it has to be an additional argument | 132 | * know if we are mapping RAM or I/O, so it has to be an additional argument |
130 | * to a separate mapping function for CPU visible mappings. | 133 | * to a separate mapping function for CPU visible mappings. |
131 | */ | 134 | */ |
132 | BTFIXUPDEF_CALL(int, mmu_map_dma_area, struct device *, dma_addr_t *, unsigned long, unsigned long, int len) | 135 | #define sbus_map_dma_area(dev,pba,va,a,len) \ |
133 | BTFIXUPDEF_CALL(void, mmu_unmap_dma_area, struct device *, unsigned long busa, int len) | 136 | sparc32_dma_ops->map_dma_area(dev, pba, va, a, len) |
137 | #define sbus_unmap_dma_area(dev,ba,len) \ | ||
138 | sparc32_dma_ops->unmap_dma_area(dev, ba, len) | ||
139 | #endif /* CONFIG_SBUS */ | ||
134 | 140 | ||
135 | #define mmu_map_dma_area(dev,pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(dev,pba,va,a,len) | ||
136 | #define mmu_unmap_dma_area(dev,ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(dev,ba,len) | ||
137 | #endif | 141 | #endif |
138 | 142 | ||
139 | #endif /* !(_ASM_SPARC_DMA_H) */ | 143 | #endif /* !(_ASM_SPARC_DMA_H) */ |