kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: dhylands@gmail.com (Dave Hylands)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Clarification on memory mapping
Date: Wed, 1 Jun 2011 16:47:06 -0700	[thread overview]
Message-ID: <BANLkTimdFe6Y2AH5t+1Su8UA-SrZzu9r=Q@mail.gmail.com> (raw)
In-Reply-To: <BANLkTik8Zz8kxvLuAFST=8n2DtnHAh46tQ@mail.gmail.com>

Hi Prasant,

On Wed, Jun 1, 2011 at 10:38 AM, Prashant Shah <pshah.mumbai@gmail.com> wrote:
> Hi,
>
> On Wed, Jun 1, 2011 at 12:04 PM, sandeep kumar
> <coolsandyforyou@gmail.com> wrote:
>> Hi,
>>
>> ioremap() :
>> 2) ioremap does mapping of a particular i/o device to kernel logical memory
>> address.
> Please correct me if I am wrong.
>
> I think this function will remap the I/O registers location to a
> memory location, so instead of using inb/outb you can use the memory
> based functions like readb/writeb.
>
> eg : lets say I want to read from I/O port 0x80. I will have to use
> the inb() function. Now if I ioremap() it to a memory location it I
> can use the readb() instead.

I'm pretty sure thats not the case (I'm not that familiar with the x86
I/O space on modern processors). I think that if you need to use
in/out instructions then you need to do that and there is no way of
mapping this into memory space.

ioremap is primarily used with memory-mapped peripherals (very common
on most non-x86 architectures). If basically maps a chunk of physical
memory into a virtual space.

If that physical memory happens to conincide with device registers,
then that will allow the driver to manipulate those registers.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

      reply	other threads:[~2011-06-01 23:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  6:34 Clarification on memory mapping sandeep kumar
2011-06-01 16:00 ` Mulyadi Santosa
2011-06-01 17:38 ` Prashant Shah
2011-06-01 23:47   ` Dave Hylands [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='BANLkTimdFe6Y2AH5t+1Su8UA-SrZzu9r=Q@mail.gmail.com' \
    --to=dhylands@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).