OpenBSD manual page server

Manual Page Search Parameters

DMA_ALLOC(9) Kernel Developer's Manual DMA_ALLOC(9)

dma_alloc, dma_freeDMA-safe memory allocator

#include <sys/types.h>
#include <sys/pool.h>

void *
dma_alloc(size_t size, int flags);

void
dma_free(void *m, size_t size);

This allocator provides DMA-safe memory managed using the pool(9) interface. It is safe to call in most contexts and is typically used for temporary buffers up to 65536 bytes. When buffers are used many times, it may be better to consider using other DMA-safe allocators.

Interrupt protection is set to IPL_VM using pool_init(9).

The flags argument is a selection of pool_get(9) flag arguments.

The same size argument must be passed to both () and the subsequent (). Allocations over 65536 will fail.

bus_dma(9), mbuf(9), pool(9)

The dma_alloc interface first appeared in OpenBSD 4.8.

March 31, 2022 OpenBSD-current