All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.