hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/sparc/include/asm/dma.h
....@@ -91,54 +91,10 @@
9191 #endif
9292
9393 #ifdef CONFIG_SPARC32
94
-
95
-/* Routines for data transfer buffers. */
9694 struct device;
97
-struct scatterlist;
9895
99
-struct sparc32_dma_ops {
100
- __u32 (*get_scsi_one)(struct device *, char *, unsigned long);
101
- void (*get_scsi_sgl)(struct device *, struct scatterlist *, int);
102
- void (*release_scsi_one)(struct device *, __u32, unsigned long);
103
- void (*release_scsi_sgl)(struct device *, struct scatterlist *,int);
104
-#ifdef CONFIG_SBUS
105
- int (*map_dma_area)(struct device *, dma_addr_t *, unsigned long, unsigned long, int);
106
- void (*unmap_dma_area)(struct device *, unsigned long, int);
107
-#endif
108
-};
109
-extern const struct sparc32_dma_ops *sparc32_dma_ops;
110
-
111
-#define mmu_get_scsi_one(dev,vaddr,len) \
112
- sparc32_dma_ops->get_scsi_one(dev, vaddr, len)
113
-#define mmu_get_scsi_sgl(dev,sg,sz) \
114
- sparc32_dma_ops->get_scsi_sgl(dev, sg, sz)
115
-#define mmu_release_scsi_one(dev,vaddr,len) \
116
- sparc32_dma_ops->release_scsi_one(dev, vaddr,len)
117
-#define mmu_release_scsi_sgl(dev,sg,sz) \
118
- sparc32_dma_ops->release_scsi_sgl(dev, sg, sz)
119
-
120
-#ifdef CONFIG_SBUS
121
-/*
122
- * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep.
123
- *
124
- * The mmu_map_dma_area establishes two mappings in one go.
125
- * These mappings point to pages normally mapped at 'va' (linear address).
126
- * First mapping is for CPU visible address at 'a', uncached.
127
- * This is an alias, but it works because it is an uncached mapping.
128
- * Second mapping is for device visible address, or "bus" address.
129
- * The bus address is returned at '*pba'.
130
- *
131
- * These functions seem distinct, but are hard to split.
132
- * On sun4m, page attributes depend on the CPU type, so we have to
133
- * know if we are mapping RAM or I/O, so it has to be an additional argument
134
- * to a separate mapping function for CPU visible mappings.
135
- */
136
-#define sbus_map_dma_area(dev,pba,va,a,len) \
137
- sparc32_dma_ops->map_dma_area(dev, pba, va, a, len)
138
-#define sbus_unmap_dma_area(dev,ba,len) \
139
- sparc32_dma_ops->unmap_dma_area(dev, ba, len)
140
-#endif /* CONFIG_SBUS */
141
-
96
+unsigned long sparc_dma_alloc_resource(struct device *dev, size_t len);
97
+bool sparc_dma_free_resource(void *cpu_addr, size_t size);
14298 #endif
14399
144100 #endif /* !(_ASM_SPARC_DMA_H) */