All of lore.kernel.org
 help / color / mirror / Atom feed
From: prabhum@msys-tech.com (prabhu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: iomem and ioports
Date: Wed, 16 Feb 2011 13:15:19 +0530	[thread overview]
Message-ID: <4D5B808F.8010509@msys-tech.com> (raw)

HI All,

I started to understand output of /proc/oiports and /proc/iomem. I 
confused to relate these two's output. 

Below is the kernel source for Mapping of io-port to io-mem. Could 
anyone please explain below code.

/* We encode the physical PIO addresses (0-0xffff) into the
                                           (0-
 * pointer by offsetting them with a constant (0x10000) and
 * assuming that all the low addresses are always PIO. That means
                                                            means
 * we can do some sanity checks on the low bits, and don't
 * need to just take things for granted.
 */
#define PIO_OFFSET              0x10000UL
#define PIO_MASK                0x0ffffUL
#define PIO_RESERVED            0x40000UL
void __iomem *ioport_map(unsigned long port, unsigned int nr) {
     __iomem
           if (port > PIO_MASK) return NULL;
           return (void __iomem *) (unsigned long) (port + PIO_OFFSET);
                        __iomem
}

Thanks,
Prabhu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110216/27ef056e/attachment.html 

             reply	other threads:[~2011-02-16  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16  7:45 prabhu [this message]
2011-02-16 11:43 ` iomem and ioports Rajat Jain
2011-02-16 15:27   ` anish singh
2011-02-17  8:08     ` Rajat Jain

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=4D5B808F.8010509@msys-tech.com \
    --to=prabhum@msys-tech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.