[lkml]   [2004]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: readl/writel: swap or not to swap
Yasushi SHOJI wrote:
> At Sat, 13 Nov 2004 21:20:03 +0900,
> yashi wrote:
> [...]
>>>Why not just use __raw_readl/__raw_writel?
>>>That's what they exist for, and they still do any IO accesses correctly,
>>>which a direct store does not do (it would seriously break on older
>>>alphas, for example).
>>sorry for a dumb question but should readl/writel on big endian system
>>swap like ppc does?
> I guess everyone is busy hacking. but can at least someone give me a
> hit?
> I'm worring about this issue because I'm about to use two deferent
> linux arch on same board. it's based on reconfigurable device so I
> can configure to have deferent cpu on it.
> if you are using two deferent arch of linux, it's natual to think you
> want to share all device drivers. but if one arch swap with readl and
> the other doesn't, I have to abstruct these low level access
> methods. (given that those to arch are same endian and connected with
> same bus and to the same devices)
> is there any rule we should follow? Is the ppc way the right
> direction to follow? I can ifdef anytime for my own use but I just
> want to know what _should_ be done.

readl()/writel() are defined as being for the PCI bus (little endian).
As such, they should swap on big endian platforms.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:08    [W:0.068 / U:0.784 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site