From: Frank Smith <smith@amirix.com>
To: "Mark S. Mathews" <mark@absoval.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Can't mmap the top 1MB of /dev/mem?
Date: Thu, 22 Jun 2000 15:14:31 -0300 [thread overview]
Message-ID: <00Jun22.151432adt.7305@dragon.appliedmicro.ns.ca> (raw)
In-Reply-To: <Pine.LNX.3.96.1000622130831.10550A-100000@tristar.cc.absoval.com>
On Thu, 22 Jun 2000, Mark S. Mathews wrote:
>
> Hi Dan (and all),
>
> I've been playing w/ mmap for flash and nvram access on the rpxlite(MV
> derived kernel). One thing I've noticed is that it won't let me mmap the
> top 1MB of the address space. I'm guessing that the region isn't
> represented in the MMU stuff or this is a deliberate block in the /dev/mem
> driver.
>
> I've done a little digging on my own and haven't found the cause. Can
> anyone point me to the right file/function(s)?
include/asm/processor.h: -------------------------------------------------
...
#define TASK_SIZE (0x80000000UL)
...
mm/mmap.c: ---------------------------------------------------------------
...
unsigned long do_mmap(struct file * file, unsigned long addr, unsigned
long len,
unsigned long prot, unsigned long flags, unsigned long off)
{
...
if (len > TASK_SIZE || addr > TASK_SIZE-len)
return -EINVAL;
...
-------------------------------------------------------------------------
Wouldn't this account for it? I'm not sure where your top 1M of
address space is on your board, but the DY4 board I'm working on
has flash up around 0xfe000000. And we ran into the same problem trying
to map our flash.
We solved the problem in a roundabout way by doing what we need to do
from inside the kernel, calling remap_page_range() directly like
mmap_mem() [drivers/char/mmap.c] does.
Frank.
-----
Frank Smith, MCompSci
Principal Software Designer frank.smith@amirix.com
AMIRIX Systems Inc. http://www.amirix.com/
Embedded Debian Project http://www.emdebian.org/
77 Chain Lake Drive 902-450-1700 x289 (Phone)
Halifax, N.S. B3S 1E1 902-450-1704 (FAX)
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-06-22 18:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-22 17:15 Can't mmap the top 1MB of /dev/mem? Mark S. Mathews
2000-06-22 17:43 ` Dan Malek
2000-06-22 18:47 ` Pavel Roskin
2000-06-22 18:54 ` Dan Malek
2000-06-22 19:58 ` Pavel Roskin
2000-06-22 21:46 ` Dan Malek
2000-06-22 19:00 ` Mark S. Mathews
2000-06-22 19:37 ` Pavel Roskin
2000-06-22 19:50 ` Mark S. Mathews
2000-06-22 20:24 ` Pavel Roskin
2000-06-22 17:50 ` Pavel Roskin
2000-06-22 18:14 ` Frank Smith [this message]
2000-06-22 18:37 ` Dan Malek
2000-06-22 19:06 ` Frank Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00Jun22.151432adt.7305@dragon.appliedmicro.ns.ca \
--to=smith@amirix.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=mark@absoval.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).