summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/include/bus.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sparc64/include/bus.h')
-rw-r--r--sys/sparc64/include/bus.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/sparc64/include/bus.h b/sys/sparc64/include/bus.h
index 95089fa..2a90c01 100644
--- a/sys/sparc64/include/bus.h
+++ b/sys/sparc64/include/bus.h
@@ -971,8 +971,12 @@ struct bus_dma_tag {
/*
* DMA memory utility functions.
*/
+ int (*dt_dmamem_alloc_size)(bus_dma_tag_t, bus_dma_tag_t, void **,
+ int, bus_dmamap_t *, bus_size_t size);
int (*dt_dmamem_alloc)(bus_dma_tag_t, bus_dma_tag_t, void **, int,
bus_dmamap_t *);
+ void (*dt_dmamem_free_size)(bus_dma_tag_t, bus_dma_tag_t, void *,
+ bus_dmamap_t, bus_size_t size);
void (*dt_dmamem_free)(bus_dma_tag_t, bus_dma_tag_t, void *,
bus_dmamap_t);
};
@@ -1084,6 +1088,19 @@ sparc64_dmamap_sync(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t m,
sparc64_dmamap_sync((t), (t), (m), (op))
static __inline int
+sparc64_dmamem_alloc_size(bus_dma_tag_t pt, bus_dma_tag_t dt, void **v, int f,
+ bus_dmamap_t *m, bus_size_t s)
+{
+ bus_dma_tag_t lt;
+
+ for (lt = pt; lt->dmamem_alloc == NULL; lt = lt->parent)
+ ;
+ return ((*lt->dmamem_alloc_size)(lt, dt, v, f, m, s));
+}
+#define bus_dmamem_alloc_size(t, v, f, m, s) \
+ sparc64_dmamem_alloc_size((t), (t), (v), (f), (m), (s))
+
+static __inline int
sparc64_dmamem_alloc(bus_dma_tag_t pt, bus_dma_tag_t dt, void **v, int f,
bus_dmamap_t *m)
{
@@ -1097,6 +1114,19 @@ sparc64_dmamem_alloc(bus_dma_tag_t pt, bus_dma_tag_t dt, void **v, int f,
sparc64_dmamem_alloc((t), (t), (v), (f), (m))
static __inline void
+sparc64_dmamem_free_size(bus_dma_tag_t pt, bus_dma_tag_t dt, void *v,
+ bus_dmamap_t m, bus_size_t s)
+{
+ bus_dma_tag_t lt;
+
+ for (lt = pt; lt->dmamem_free == NULL; lt = lt->parent)
+ ;
+ (*lt->dmamem_free_size)(lt, dt, v, m, s);
+}
+#define bus_dmamem_free_size(t, v, m, s) \
+ sparc64_dmamem_free_size((t), (t), (v), (m), (s))
+
+static __inline void
sparc64_dmamem_free(bus_dma_tag_t pt, bus_dma_tag_t dt, void *v,
bus_dmamap_t m)
{
OpenPOWER on IntegriCloud