1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>dma_alloc_from_coherent</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch02s03.html" title="Device Drivers DMA Management"><link rel="prev" href="re440.html" title="include/linux/reservation.h"><link rel="next" href="API-dma-release-from-coherent.html" title="dma_release_from_coherent"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">dma_alloc_from_coherent</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re440.html">Prev</a> </td><th width="60%" align="center">Device Drivers DMA Management</th><td width="20%" align="right"> <a accesskey="n" href="API-dma-release-from-coherent.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-dma-alloc-from-coherent"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>dma_alloc_from_coherent — 
2  try to allocate memory from the per-device coherent area
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">dma_alloc_from_coherent </b>(</code></td><td><a class="link" href="API-struct-device.html" title="struct device">struct device</a> * <var class="pdparam">dev</var>, </td></tr><tr><td> </td><td>ssize_t <var class="pdparam">size</var>, </td></tr><tr><td> </td><td>dma_addr_t * <var class="pdparam">dma_handle</var>, </td></tr><tr><td> </td><td>void ** <var class="pdparam">ret</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.4.4.45.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p>
4     device from which we allocate memory
5    </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
6     size of requested memory area
7    </p></dd><dt><span class="term"><em class="parameter"><code>dma_handle</code></em></span></dt><dd><p>
8     This will be filled with the correct dma handle
9    </p></dd><dt><span class="term"><em class="parameter"><code>ret</code></em></span></dt><dd><p>
10     This pointer will be filled with the virtual address
11     to allocated area.
12    </p></dd></dl></div></div><div class="refsect1"><a name="id-1.4.4.45.6"></a><h2>Description</h2><p>
13   This function should be only called from per-arch <code class="function">dma_alloc_coherent</code>
14   to support allocation from per-device coherent memory pools.
15   </p><p>
16
17   Returns 0 if dma_alloc_coherent should continue with allocating from
18   generic memory areas, or !0 if dma_alloc_coherent should return <em class="parameter"><code>ret</code></em>.
19</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re440.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02s03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-dma-release-from-coherent.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
20   include/linux/reservation.h
21   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">dma_release_from_coherent</span></td></tr></table></div></body></html>
22