unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Page:
Section:
Apropos / Subsearch:
optional field

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

NAME
     dma_alloc, dma_free -- DMA-safe memory allocator

SYNOPSIS
     #include <&lt;sys/types.h>&gt;
     #include <&lt;sys/pool.h>&gt;

     void *
     dma_alloc(size_t size, int flags);

     void
     dma_free(void *m, size_t size);

DESCRIPTION
     This allocator provides DMA-safe memory managed using the pool(9) inter-
     face.  It is safe to call in most contexts and is typically used for tem-
     porary 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_setipl(9).

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

     The same size argument must be passed to both dma_alloc() and the subse-
     quent dma_free().  Allocations over 65536 will fail.

SEE ALSO
     bus_dma(9), mbuf(9), pool(9)

HISTORY
     The dma_alloc interface first appeared in OpenBSD 4.8.

BSD                              June 4, 2013                              BSD