From: Linus Torvalds <torvalds@cs.Helsinki.FI>
Subject: Re: MMIO for new NCR810 driver?
Date: Sat, 13 Jul 1996 10:09:43 +0300 (EET DST) [thread overview]
Message-ID: <5eacd0cb2005c75fdf480fbcb91e0fb5.axp-list@archive.invalid> (raw)
In-Reply-To: <Pine.LNX.3.91.960712212833.116B-100000@gerard>
On Fri, 12 Jul 1996, Gerard Roudier wrote:
>
> I have understand something like that too. I think that this address
> calculation allows to acces the video memory directly, without calling
> some readx() function.
Don't follow that path too closely.
You MUST NOT access IO memory any other way than read/write[bwl]().
or memcpy_fromio/toio(). EVER.
There are other considerations than just address calculations. Using the
address calculation stuff for 32- and 64-bit stuff can work on PCI alpha's
(and on the new ev56 alphas you may even be able to use it for 8- and 16-bit
accesses if you have a compiler that generates those instructions), but it's
STILL not correct.
It's simply not portable. On some architectures the IO space may be in a
totally different address space than the kernel, so that you have to use
special instructions and/or "segment overrides" (in x86 parlance) etc.
On other architectures you'll only see a _window_ into the IO space, so that
the IO access functions have to set up the window correctly, and the same
processor virtual address can actually be _different_ IO ports depending on
where the window happens to be. Or look at the Jensen, for example: it has
_no_ support for dense memory, and you _cannot_ make the IO memory look like
a memory access.
In short, don't even try to make IO memory look like real memory: it
isn't real memory, and it will never work reliably and portably if you
try.
Use "read[bwl]/write[bwl]/memcpy_toio/memcpy_fromio". On the x86, they
translate to the obvious thing anyway so there is no performance impact,
and on other architectures they may do strange things, but those strange
things are _needed_.
Linus
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
next parent reply other threads:[~1996-07-13 7:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.91.960712212833.116B-100000@gerard>
1996-07-13 7:09 ` Linus Torvalds [this message]
[not found] <Pine.LNX.3.91.960713100009.10237E-100000@linux.cs.Helsinki.FI>
1996-07-13 11:50 ` MMIO for new NCR810 driver? Gerard Roudier
[not found] <199607120948.LAA11973@ceres.tat.physik.uni-tuebingen.de>
1996-07-12 22:32 ` Gerard Roudier
1996-07-12 20:47 David Mosberger-Tang
[not found] <Pine.LNX.3.91.960711230857.6399C-100000@gerard>
1996-07-12 9:35 ` Harald Koenig
-- strict thread matches above, loose matches on Subject: below --
1996-07-11 19:13 Harald Koenig
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox