Re: [PATCH] fix ppc ioremap prototype

From: Linus Torvalds
Date: Thu Sep 04 2003 - 12:10:04 EST



On Thu, 4 Sep 2003, David S. Miller wrote:
>
> > So clearly ioremap() has to work for other buses too.
>
> What if they are like I/O ports on x86 and require special
> instructions to access?

ioremap() is very easy to explain to a mathematician: its "domain" is
_exactly_ that which is in the "iomem_resource" tree. The "range" is a
virtual address.

In other words, something like I/O ports, that aren't in the
iomem_resource, are not covered by ioremap(). It's that simple.

Another way opf saying it: "iomem_resource" is one special set of
"physical resource mappings". The way you make sure they are accessible is
"ioremap()".

This is how it has always been on x86, and it is self-consistent.

NOTE! That doesn't preclude having other resource trees, and other ways to
map those. We've never needed to have a "ioportremap()" for the
"ioport_resource" tree, because that resource is so limited that it can be
statically mapped (on x86 it's mapped by hardware, and on other
architectures it is often mapped into the virtual address space like iomem
is).

And some architectures may end up deciding that "iomem_resource" isn't
sufficient for them, and want to maybe have _multiple_ totally independent
address trees. Then you'd have to do something else.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/