Yosemite/440EP why are readl()/ioread32() setuptoreadlittle-endian?

Eugene Surovegin ebs at ebshome.net
Fri Feb 3 04:16:46 EST 2006


On Thu, Feb 02, 2006 at 11:26:22AM -0000, Jenkins, Clive wrote:
> Regardless of what standards or hardware might exist, I would be
> happy if Linux provided alternatives to readl()... that converted
> between big-endian and cpu-endian, so that I could write in my
> driver, for example:
> 
> static inline my_readl(...)
> {
> #if (my interconnect is PCI or other little-endian)
>     return(readl(...));
> #else
>     return(readl_be(...));
> #endif
> }
> 
> That must make my driver more portable in future circumstances

Huh?

If you re-read this thread, you'll notice that I was responding to 
e-mail where original poster did NOT want to do exactly this in his 
driver. But you are suggesting what we were discussing on how to  
_avoid_. I'm really confused, what is your point?

What I was talking, in short, that if we _really_ want generic non-PCI 
accessors, we need something similar to the way IDE layer defines its 
I/O operations - bunch of per-bus/device function pointers which can 
be overridden depending on arch, bus and the way peripheral is wired.

-- 
Eugene




More information about the Linuxppc-embedded mailing list