dma_mmap_from_coherent(9)

dma_mmap_from_coherent9

Try to mmap the memory allocated from per-device coherent memory pool to userspace

Usage

int dma_mmap_from_coherent(struct device * dev, struct vm_area_struct * vma, void * vaddr, size_t size, int * ret);

Arguments

dev

device from which the memory was allocated

vma

vm_area for the userspace memory

vaddr

cpu address returned by dma_alloc_from_coherent

size

size of the memory buffer allocated by dma_alloc_from_coherent

ret

result from remap_pfn_range

Overview

This checks whether the memory was allocated from the per-device coherent memory pool and if so, maps that memory to the provided vma.

Returns 1 if we correctly mapped the memory, or 0 if the caller should proceed with mapping memory from generic pools.

From linux-manual-3.16 3.16.56-1+deb8u1 in Debian 8 (Jessie). Parsed by carta from the page's man source.