From: Gerard Roudier <groudier@club-internet.fr>
Subject: Re: MMIO for new NCR810 driver?
Date: Sat, 13 Jul 1996 11:50:47 +0000 (GMT) [thread overview]
Message-ID: <7fc8ea5b5129cdcd8a2166fa6cf3f548.axp-list@archive.invalid> (raw)
In-Reply-To: <Pine.LNX.3.91.960713100009.10237E-100000@linux.cs.Helsinki.FI>
On Sat, 13 Jul 1996, Linus Torvalds wrote:
>
> 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.
>
I always try to follow allowed pathes for kernel code.
Harald was speaking about X servers and I (wrongly?) imagine that, in user
space, this formula was some kind of reverse ingenieering of kernel
architecture dependant implementation for performances considerations.
> You MUST NOT access IO memory any other way than read/write[bwl]().
> or memcpy_fromio/toio(). EVER.
It is what I had understood and I have changed direct memory
references to "read[bwl]()" function calls in the driver in january.
I am a little aware of portability considerations and constraints but I
have to learn about architectures.
> 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_.
Thank a lot for your explanations.
The questions I asked me were the following:
- Do read[bwl]() functions expect addresses relative to the base reported by
the PCI BIOS or something else (vremap(ed) for example)?
- Is there some advantage (or not) to try to use the BASE1 window (memory
mapped for i386 PCI implementation) for NCR chips on alpha hardwares?
> Linus
>
Gerard.
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
next parent reply other threads:[~1996-07-13 11:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.91.960713100009.10237E-100000@linux.cs.Helsinki.FI>
1996-07-13 11:50 ` Gerard Roudier [this message]
[not found] <Pine.LNX.3.91.960712212833.116B-100000@gerard>
1996-07-13 7:09 ` MMIO for new NCR810 driver? Linus Torvalds
[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