<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="cid:filelist.xml@01C9CCC0.04F6F390">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;
        text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;
        text-underline:single;}
p.code, li.code, div.code
        {mso-style-name:code;
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:Arial;
        color:navy;}
span.EmailStyle18
        {mso-style-type:personal-compose;
        mso-style-noshow:yes;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:windowtext;}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:"Table Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0in 5.4pt 0in 5.4pt;
        mso-para-margin:0in;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
<div class=Section1>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>Hello Everyone,<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>This is my first post to this list, so hopefully I
read all the instructions correctly and am posting to the correct list.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>I have a driver which maps some kernel allocated
memory to user space which works, and now I am trying to set that memory non-cacheable,
on a power PC using the <span class=SpellE>Denx</span> ELDK (linux-2.6.24) on a
PPC460ex.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>I have attempted several ways of doing this:<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>1. Calling the macro <span class=SpellE><span
class=GramE>SetPageUncached</span></span><span class=GramE>(</span>) in <span
class=SpellE>linux/page-flags.h</span>. This fails because for some reason the
bit <span class=SpellE>PG_uncached</span> is only defined for processors whose
BITS_PER_LONG > 32.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>2. Calling the macro <span class=SpellE>pgprot_<span
class=GramE>noncached</span></span><span class=GramE>(</span>) in
asm/pgtable-ppc32.h. This just doesn't seem to have any effect.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>3. Setting flags in the <span class=SpellE>struct</span>
<span class=SpellE>vm_area_struct</span>-><span class=SpellE>vm_flags</span>
before calling <span class=SpellE>remap_pfn_<span class=GramE>range</span></span><span
class=GramE>(</span>). This doesn't work because the flag I expected to find
VM_NONCACHED is not defined anywhere.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>4. Calling the function <span class=SpellE>dma_alloc_<span
class=GramE>coherent</span></span><span class=GramE>(</span>) instead of <span
class=SpellE>kmalloc</span>() to allocate the memory(). This causes some kind of
bus error or exception in the kernel - I believe because I passed in NULL for
the device which I read is a bug with the kernel.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>Has anyone done this <span class=SpellE>successfuly</span>
on a PPC440 or PPC460?<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>Any tips would be appreciated. Code snippets below…<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>Thanks!<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>//<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>// allocating the memory in the kernel<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>//<o:p></o:p></span></font></p>
<p class=code><span class=GramE><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>static</span></font></span> <span class=SpellE>int</span>
__init <span class=SpellE>mapper_init_module</span>(void)<o:p></o:p></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>{<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>int</span></span> <span class=SpellE>rc</span>;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>unsigned</span> <span class=SpellE>int</span> <span class=SpellE>i</span>
= 0;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE>phys_addr_t</span> <span class=SpellE>phys_addr</span>;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>MDEBUG(</span>"Initializing module...\n");<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/*
allocate the memory and pad with pages so that we can <o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>*
make sure to page align<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>*/<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE>km.raw</span> = <span class=SpellE><span class=GramE>kmalloc</span></span><span
class=GramE>(</span>(2*PAGE_COUNT+1)*PAGE_SIZE, GFP_KERNEL);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>if</span> (!<span class=SpellE>km.raw</span>) <o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'>
</span><span class=GramE>return</span> -ENOMEM;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* now
need to adjust our other pointer to page align to 64 Kb boundary*/<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* Note,
that we just do the mal and set pal to it since if it is 64Kb aligned<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>* <span
class=GramE>then</span> it is also page aligned<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>*/<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE>km.mal</span> <span class=GramE>=<span
style='mso-spacerun:yes'> </span>(</span><span class=SpellE>int</span>
*)((((unsigned long)<span class=SpellE>km.raw</span>) + ((1<<16) - 1))
& 0xFFFF0000);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/*<span
class=SpellE>km.pal</span> <span class=GramE>=<span
style='mso-spacerun:yes'> </span>(</span><span class=SpellE>int</span>
*)((((unsigned long)<span class=SpellE>km.raw</span>) + (PAGE_SIZE - 1)) &
PAGE_MASK);*/<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE>km.pal</span> = <span class=SpellE>km.mal</span>;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>MDEBUG(</span>"Allocated %ld bytes of kernel space for driver
at kernel logical address %p...\n", <o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'>
</span><span
style='mso-spacerun:yes'> </span>PAGE_COUNT*PAGE_SIZE,
<span class=SpellE>km.raw</span>);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>MDEBUG(</span>"page aligned = %p<span
style='mso-spacerun:yes'> </span>64k aligned = %p\n", <span
class=SpellE>km.pal</span>, <span class=SpellE>km.mal</span>);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>MDEBUG(</span>"Physical address = 0x%lx...\n", __pa(<span
class=SpellE>km.raw</span>));<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<span
style='mso-spacerun:yes'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* lock
down / reserve the pages in memory */<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>{<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'>
</span><span class=SpellE><span class=GramE>int</span></span> k;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'>
</span><span class=GramE>for</span> (k=0; k<PAGE_COUNT*PAGE_SIZE;
k+=PAGE_SIZE)<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span
style='mso-spacerun:yes'> </span>{<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span
style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>struct</span></span> page* pg = <span
class=SpellE>virt_to_page</span>(((unsigned long)<span class=SpellE>km.pal</span>)
+ k);<span style='mso-spacerun:yes'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span
style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>SetPageReserved</span></span><span class=GramE>(</span>pg);<span
style='mso-spacerun:yes'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span><span
style='mso-spacerun:yes'> </span>//<span class=SpellE><span class=GramE>SetPageUncached</span></span><span
class=GramE>(</span>pg);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span
style='mso-spacerun:yes'> </span>}<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>}<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<span
style='mso-tab-count:1'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:1'> </span>.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>}<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>//<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>// mapping the kernel space to user space<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>//<o:p></o:p></span></font></p>
<p class=code><span class=GramE><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>static</span></font></span> <span class=SpellE>int</span>
<span class=SpellE>mapper_mmap</span>(<span class=SpellE>struct</span> file *<span
class=SpellE>fip</span>, <span class=SpellE>struct</span> <span class=SpellE>vm_area_struct</span>
*<span class=SpellE>vma</span>)<o:p></o:p></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>{<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>int</span></span> <span class=SpellE>rc</span>;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* <o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>*
make sure to allocate the proper number of pages when using<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>* <span
class=SpellE><span class=GramE>mmap</span></span>.<span
style='mso-spacerun:yes'> </span>We check it for correctness here.<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>*/<span
style='mso-spacerun:yes'> </span><o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>unsigned</span> long <span class=SpellE>len</span> = <span
class=SpellE>vma</span>-><span class=SpellE>vm_end</span> - <span
class=SpellE>vma</span>-><span class=SpellE>vm_start</span>;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* if
user tries to map bigger space than we have, error */<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>if</span> (PAGE_COUNT * PAGE_SIZE < <span class=SpellE>len</span>)
<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'>
</span><span class=GramE>return</span> -EIO;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE>pgprot_<span class=GramE>noncached</span></span><span class=GramE>(</span><span
class=SpellE>vma</span>-><span class=SpellE>vm_page_prot</span>);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>//<span
class=SpellE>vma</span>-><span class=SpellE>vm_flags</span> |= VM_NONCACHED |
VM_RESERVED;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>vma</span></span>-><span class=SpellE>vm_flags</span>
|= VM_RESERVED;<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* map
the physical area into one buffer */<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>rc</span></span> = <span class=SpellE>remap_pfn_range</span>(<span
class=SpellE>vma</span>, <span class=SpellE>vma</span>-><span class=SpellE>vm_start</span>,
<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:2'> </span><span
style='mso-spacerun:yes'> </span><span
class=SpellE>virt_to_<span class=GramE>phys</span></span><span class=GramE>(</span>
(void*)<span class=SpellE>km.pal</span>)>>PAGE_SHIFT,<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:2'> </span><span
style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>len</span></span>,<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-tab-count:2'> </span><span
style='mso-spacerun:yes'> </span><span
class=SpellE><span class=GramE>vma</span></span>-><span class=SpellE>vm_page_prot</span>);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>MDEBUG(</span>"Mapped %ld bytes at <span class=SpellE>virt</span>
address 0x%lx to <span class=SpellE>mapper</span> file descriptor...\n", <span
class=SpellE>len</span>, <span class=SpellE>vma</span>-><span class=SpellE>vm_start</span>);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span>/* return
an error to the caller if remap fails */<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'><span style='mso-spacerun:yes'> </span><span
class=GramE>return</span> (<span class=SpellE>rc</span> < 0 ? <span
class=SpellE>rc</span> : 0);<o:p></o:p></span></font></p>
<p class=code><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt'>}</span></font><font color=black><span
style='color:windowtext'><o:p></o:p></span></font></p>
</div>
</body>
</html>