1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>vm_map_ram</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="ch04s03.html" title="More Memory Management Functions"><link rel="prev" href="API-vm-unmap-ram.html" title="vm_unmap_ram"><link rel="next" href="API-unmap-kernel-range-noflush.html" title="unmap_kernel_range_noflush"></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">vm_map_ram</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-vm-unmap-ram.html">Prev</a> </td><th width="60%" align="center">More Memory Management Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-unmap-kernel-range-noflush.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-vm-map-ram"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vm_map_ram — 2 map pages linearly into kernel virtual address (vmalloc space) 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">void * <b class="fsfunc">vm_map_ram </b>(</code></td><td>struct page ** <var class="pdparam">pages</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">count</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">node</var>, </td></tr><tr><td> </td><td>pgprot_t <var class="pdparam">prot</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1124362308"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>pages</code></em></span></dt><dd><p> 4 an array of pointers to the pages to be mapped 5 </p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p> 6 number of pages 7 </p></dd><dt><span class="term"><em class="parameter"><code>node</code></em></span></dt><dd><p> 8 prefer to allocate data structures on this node 9 </p></dd><dt><span class="term"><em class="parameter"><code>prot</code></em></span></dt><dd><p> 10 memory protection to use. PAGE_KERNEL for regular RAM 11 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124367068"></a><h2>Description</h2><p> 12 If you use this function for less than VMAP_MAX_ALLOC pages, it could be 13 faster than vmap so it's good. But if you mix long-life and short-life 14 objects with <code class="function">vm_map_ram</code>, it could consume lots of address space through 15 fragmentation (especially on a 32bit machine). You could see failures in 16 the end. Please use this function for short-lived objects. 17</p></div><div class="refsect1"><a name="idp1124368380"></a><h2>Returns</h2><p> 18 a pointer to the address that has been mapped, or <code class="constant">NULL</code> on failure 19</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-vm-unmap-ram.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04s03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-unmap-kernel-range-noflush.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">vm_unmap_ram</span> </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">unmap_kernel_range_noflush</span></td></tr></table></div></body></html> 20