* [parisc-linux] readb/__raw_readb/gsc_readb and ioremap
@ 2004-10-31 3:39 Matthew Wilcox
2004-10-31 4:37 ` Grant Grundler
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2004-10-31 3:39 UTC (permalink / raw)
To: parisc-linux
I've been looking at asm/io.h (patch just committed).
I feel the need to explain a bit about what's going on because it seems
a little confused.
gsc_read/writeX:
- Don't byteswap
- Can be used on raw memory addresses (ie f-space)
__raw_read/writeX:
- Don't byteswap
- Should be used on ioremap'ed address
read/writeX:
- Byteswap
- Should be used on ioremap'ed address
It was the case that __raw_readl was the same as gsc_readl, but non-parisc
drivers are using __raw_readl now, so we have to change that.
At the moment, ioremap() is a nop. That really ought to change, and
it's what the USE_HPPA_IOREMAP define is for. There's at least one
problem with the USE_HPPA_IOREMAP code -- it doesn't byteswap.
So I've rearranged the code. Now:
gsc_readl returns the value found at the physical address.
If USE_HPPA_IOREMAP is set, __raw_readl returns the value found at
the virtual address. If not, it's a #define to gsc_readl. readl is a
#define to byteswap the result from __raw_readl.
There's now prototypes for readX/writeX, so there's a lot of warnings
to clean up. I suspect we should start by declaring parisc_device->hpa
to be a void __iomem * ... or maybe we should start by inventing a
parisc_iomap() interface. Anyway, maybe I'll start trying to make
USE_HPPA_IOREMAP work next ...
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [parisc-linux] readb/__raw_readb/gsc_readb and ioremap
2004-10-31 3:39 [parisc-linux] readb/__raw_readb/gsc_readb and ioremap Matthew Wilcox
@ 2004-10-31 4:37 ` Grant Grundler
0 siblings, 0 replies; 2+ messages in thread
From: Grant Grundler @ 2004-10-31 4:37 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: parisc-linux
On Sun, Oct 31, 2004 at 03:39:50AM +0000, Matthew Wilcox wrote:
> __raw_read/writeX:
> - Don't byteswap
> - Should be used on ioremap'ed address
> read/writeX:
> - Byteswap
> - Should be used on ioremap'ed address
Willy confirmed there is another subtle difference between the
two sets of functions:
__raw_read/writeX relax PCI ordering requirements.
read/writeX enforce PCI Ordering requirements.
Willy correctly ignored this topic since parisc machines are strongly
ordered for IO as well (so far at least).
But I didn't want folks to think byte swapping was the only difference.
Be VERY careful of using __raw_XXX forms outside of parisc specific code.
grant
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-10-31 4:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-31 3:39 [parisc-linux] readb/__raw_readb/gsc_readb and ioremap Matthew Wilcox
2004-10-31 4:37 ` Grant Grundler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.