From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5eacd0cb2005c75fdf480fbcb91e0fb5.axp-list@archive.invalid> X-Archive-Original-Message-ID: <9607130004.AA09948@ives.amt.tay1.dec.com> Date: Sat, 13 Jul 1996 10:09:43 +0300 (EET DST) From: Linus Torvalds Subject: Re: MMIO for new NCR810 driver? In-Reply-To: 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