Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2001 17:35:37 -0800
From:      Jeff Roberson <jeff@midstream.com>
To:        "'freebsd-current@freebsd.org'" <freebsd-current@freebsd.org>
Subject:   Broken mmap in current?
Message-ID:  <31E4B6337A4FD411BD45000102472E0C05E729@EMAIL_SERVER>

next in thread | raw e-mail | index | archive | help
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C07C37.FA49D1D0
Content-Type: text/plain;
	charset="iso-8859-1"

I have written a character device driver for a proprietary PCI device that
has a large sum of mapable memory.  The character device supports mmap()
which I use to export the memory into a user process.  I have no problems
accessing the memory on this device, but I notice that my mmap routine is
called for every access!  Is this a problem with current, or a problem with
my mmap?

I use bus_alloc_resource and then rman_get_start to get the physical address
in my attach, and then the mmap just returns atop(physical address).  I
assumed this is correct since I have verified with a logical analyzer that I
am indeed writing to the memory on the device.  Also, I noticed that the
device's mmap interface does not provide any way to limit the size of the
block being mapped?  Can I specify the length of the region?

Thanks,
Jeff

------_=_NextPart_001_01C07C37.FA49D1D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>Broken mmap in current?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>I have written a character device driver for a =
proprietary PCI device that has a large sum of mapable memory.&nbsp; =
The character device supports mmap() which I use to export the memory =
into a user process.&nbsp; I have no problems accessing the memory on =
this device, but I notice that my mmap routine is called for every =
access!&nbsp; Is this a problem with current, or a problem with my =
mmap?</FONT></P>

<P><FONT SIZE=3D2>I use bus_alloc_resource and then rman_get_start to =
get the physical address in my attach, and then the mmap just returns =
atop(physical address).&nbsp; I assumed this is correct since I have =
verified with a logical analyzer that I am indeed writing to the memory =
on the device.&nbsp; Also, I noticed that the device's mmap interface =
does not provide any way to limit the size of the block being =
mapped?&nbsp; Can I specify the length of the region?</FONT></P>

<P><FONT SIZE=3D2>Thanks,</FONT>
<BR><FONT SIZE=3D2>Jeff</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C07C37.FA49D1D0--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31E4B6337A4FD411BD45000102472E0C05E729>