[parisc-linux] to swap or not to swap

Randolph Chung Randolph Chung <randolph@tausq.org>
Tue, 13 Nov 2001 11:42:48 -0800


> depends on the PCI bridge and MMU whether you need to do bytesexswapping
> in software or not.  see section 9 in the Dino ERS, page 61 for how PA
> does this.

Empirically I've found this not to be the case. For example, if i need
to write 0x01 to byte 0 of a 16-bit PCI register, I've found I need to
do:

writew(0x0100, addr) on parisc
vs
writew(0x0001, addr) on x86

Grant also seems to be of the opinion that cpu data needs to be swapped
before written to PCI devices... so does that mean that if i wrote
something like:

writew(cpu_to_le16(foo), addr)

then on things like parisc it gets swapped once, and on things like
sparc it gets swapped twice?

randolph
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^