Re: When to use ioremap?

Philip Blundell (philb@gnu.org)
Sun, 25 Apr 1999 12:02:59 +0100


>IO-mapping.txt describes reading from I/O space like
> unsigned value = readl(0xc0000);
>but it describes writing with ioremap().
>
>Why does reading not require ioremap, while writing does?

0xc0000 is in the ISA memory space. This area is special in that (on PC
machines at least) you can access it without ioremap, and in fact ioremap will
just return the original address. It's still good practice to use ioremap for
this sort of memory though. The example of writing is to a different memory
area for which ioremap is always needed.

>And the file seems to imply that read/write[bwl] should be the sole way
>to address I/O memory.

That's correct, though you can get away with just dereferencing a pointer
under some circumstances on some architectures.

p.

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