From: kettenis Date: Sat, 21 Jan 2023 10:30:11 +0000 (+0000) Subject: Make bus_dmamem_alloc_range(9) API available. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f86ce5abc6fd95cf0189950ea84b98ffd63fa7ca;p=openbsd Make bus_dmamem_alloc_range(9) API available. ok patrick@, deraadt@, phessler@ --- diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c index 72417c2e78f..83786596fbf 100644 --- a/sys/arch/arm64/dev/mainbus.c +++ b/sys/arch/arm64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.23 2023/01/16 20:07:48 patrick Exp $ */ +/* $OpenBSD: mainbus.c,v 1.24 2023/01/21 10:30:11 kettenis Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * Copyright (c) 2017 Mark Kettenis @@ -80,6 +80,7 @@ struct machine_bus_dma_tag mainbus_dma_tag = { _dmamap_unload, _dmamap_sync, _dmamem_alloc, + _dmamem_alloc_range, _dmamem_free, _dmamem_map, _dmamem_unmap, diff --git a/sys/arch/arm64/include/bus.h b/sys/arch/arm64/include/bus.h index 092a4869212..49b5e42a7b0 100644 --- a/sys/arch/arm64/include/bus.h +++ b/sys/arch/arm64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.8 2021/02/16 12:33:22 kettenis Exp $ */ +/* $OpenBSD: bus.h,v 1.9 2023/01/21 10:30:11 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. * @@ -400,6 +400,9 @@ struct machine_bus_dma_tag { */ int (*_dmamem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int); + int (*_dmamem_alloc_range)(bus_dma_tag_t, bus_size_t, bus_size_t, + bus_size_t, bus_dma_segment_t *, int, int *, int, + bus_addr_t, bus_addr_t); void (*_dmamem_free)(bus_dma_tag_t, bus_dma_segment_t *, int); int (*_dmamem_map)(bus_dma_tag_t, bus_dma_segment_t *, int, size_t, caddr_t *, int); @@ -433,6 +436,9 @@ struct machine_bus_dma_tag { #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) +#define bus_dmamem_alloc_range(t, s, a, b, sg, n, r, f, l, h) \ + (*(t)->_dmamem_alloc_range)((t), (s), (a), (b), (sg), \ + (n), (r), (f), (l), (h)) #define bus_dmamem_free(t, sg, n) \ (*(t)->_dmamem_free)((t), (sg), (n)) #define bus_dmamem_map(t, sg, n, s, k, f) \