From: gprabhunath@gmail.com (Prabhunath G)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Ioreamp vs mmap
Date: Tue, 6 Sep 2016 23:57:51 +0530 [thread overview]
Message-ID: <CACPKTAORBqe8nnP0WK3mqXD+vEJGtBSqs0Vw7_8VjhWpFRQEgA@mail.gmail.com> (raw)
In-Reply-To: <CAMGjyMstSnc6K7xXpD5r1Ds7f8Fin41nkOJ+_Sy_QPCuqeZFHg@mail.gmail.com>
mmap() is used for the following.
1. Maps device physical address (device memory or device registers ) to
user virtual address, Of course, the completion of this will happen with
the help of the driver mmap which will actually map the user virtual
address to physical address with the help of remap_pfn_range().
2. Maps regular file contents to the user virtual address. Most likely used
instead of read(), which is expensive in time in copying data from kernel
buffers
user buffers. Use mmap cautiously, do not append the file after
mmaping.
3. Allocate address region or virtual memory region for the user
application. Can be used instead of malloc(), if you know what you are
doing.
Almost all of the libc file operations uses mmap. To verify, write
an application which uses fprintf or fwrite and check out using strace.
ioremap()
1. maps device physical address(device memory or device registers) to
kernel virtual address
Regards,
Prabhu
On Tue, Sep 6, 2016 at 8:13 PM, Er Krishna <erkrishna@gmail.com> wrote:
> > Hi all
> >
> > I am asking this question for understanding purpose:
> >
> > Please help me here:
> >
> > What are the core difference between mmap and ioreamp ?
> >
> > In which scenario one can be used for other and when it can not be ?
> >
> > Thanks
> > Krishna
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
--
Regards,
Prabhunath G
Linux Trainer
Bangalore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160906/12bc303e/attachment.html
prev parent reply other threads:[~2016-09-06 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAMGjyMu0QhYfZJgK1DTCmun=rKZgPgRMC0Misfg+ccf57-CkZA@mail.gmail.com>
2016-09-06 14:43 ` Ioreamp vs mmap Er Krishna
2016-09-06 18:27 ` Prabhunath G [this message]
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=CACPKTAORBqe8nnP0WK3mqXD+vEJGtBSqs0Vw7_8VjhWpFRQEgA@mail.gmail.com \
--to=gprabhunath@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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).