Subject: Cache Attributes for memory mapped pages
To: None <tech-kern@netbsd.org>
From: Kyle Unice <kyle@midnighttech.com>
List: tech-kern
Date: 06/20/2003 10:53:09
This is a multi-part message in MIME format.
------=_NextPart_000_025F_01C3371A.233AF690
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
We use mmap to get a virtual address for a physical address. It is not
clear how to set the access attributes in the page table (cacheing,
buffering, etc) for the page table entries that the kernel develops.
If the kernel is using virtual address X for a physical address Y, then
an application wants a virtual address Z for Y and calls mmap to
establish the mapping, a new page table entry is developed for the
mapping but it is unclear to me how the caching, buffering attributes
are choosen for that mapping. I assumed it was the drivers mmap routine
that would set it but that is not the case.
Could the application ask for virtual address X for Y when it calls
mmap? That would make the kernel and application share the same mapping
attributes for Y.
When the kernel boots it assigns caching and buffering attributes to the
SDRAM banks and to the memory mapped registers of several devices. What
I want to know is how can the application get those same attributes so
the application can read device registers correctly.
Thx,
Kyle
------=_NextPart_000_025F_01C3371A.233AF690
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Comic Sans MS";
panose-1:3 15 7 2 3 3 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:"Comic Sans MS";
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>We use mmap to get a virtual address for a physical =
address. It
is not clear how to set the access attributes in the page table =
(cacheing, buffering,
etc) for the page table entries that the kernel =
develops.</span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>If the kernel is using virtual address X for a physical address =
Y, then
an application wants a virtual address Z for Y and calls mmap to =
establish the
mapping, a new page table entry is developed for the mapping but it is =
unclear
to me how the caching, buffering attributes are choosen for that =
mapping.
I assumed it was the drivers mmap routine that would set it but that is =
not the
case.</span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>Could the application ask for virtual address X for Y when it =
calls mmap?
That would make the kernel and application share the same mapping =
attributes
for Y.</span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>When the kernel boots it assigns caching and buffering =
attributes to
the SDRAM banks and to the memory mapped registers of several =
devices.
What I want to know is how can the application get those same attributes =
so the
application can read device registers correctly.<br>
<br>
Thx,<br>
Kyle</span></font></p>
</div>
</body>
</html>
------=_NextPart_000_025F_01C3371A.233AF690--