From: "Francis Litterio" <litterio@pyxsys.net>
To: "'linuxppc-embedded'" <linuxppc-embedded@lists.linuxppc.org>
Cc: <matthias.fuchs@esd-electronics.com>
Subject: RE: simple access to mem mapped peripheral
Date: Thu, 4 Oct 2001 11:34:01 -0400 [thread overview]
Message-ID: <000401c14ce9$fec3cba0$4500f98c@EMMAROSE> (raw)
In-Reply-To: <3BBC34D9.B60D1BC9@esd-electronics.com>
Matthias Fuchs wrote:
> thanks. mmap is working fine for my problem ! I wonder why
> lseek'ing and reading does not work.
Because in linux/drivers/char/mem.c the function memory_lseek(), which
implements the lseek() system call for /dev/mem, does not call
remap_page_range(), but function mmap_mem(), which implements the mmap()
system call for /dev/mem, does call remap_page_range().
remap_page_range() is a kernel function that builds virtual memory page
table entries for physical pages. In this case, the physical pages are
your device memory that is mapped into RAM by the PCI bus.
Without the PTEs for those physical pages, attempts to read from those
pages (e.g., via lseek() and read()) will segfault just as if you had
dereferenced a pointer that does not point to a valid page in your user
address space.
--
Francis Litterio
Software Engineer
Pyxsys Corproration
litterio@pyxsys.net
978-371-9115 x131
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2001-10-04 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-02 14:53 simple access to mem mapped peripheral Subodh Nijsure
2001-10-04 8:02 ` Matthias Fuchs
2001-10-04 8:15 ` Pierre AUBERT
2001-10-04 10:07 ` Matthias Fuchs
2001-10-04 15:34 ` Francis Litterio [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-10-02 9:02 Matthias Fuchs
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='000401c14ce9$fec3cba0$4500f98c@EMMAROSE' \
--to=litterio@pyxsys.net \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=matthias.fuchs@esd-electronics.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).