RE: insw(), insl(), outsw(), outsl() behaviour on big-endian proc

Patrick Lerda (LERDA@microprocess.com)
Tue, 8 Jun 1999 09:24:29 +0200


> >
> > The functions: insw(), insl(), outsw(), outsl() perform memory
> block
> > copy, and are used in
> > a lot of drivers. In the PowerPC version of linux theses fuinctions
> are
> > defined to change the endianess
> > of data being proceeded (the endianess is changed with a byte
> swapping
> > operator).
> >
>
> These do not perform memory block copy.
>
> insw inputs words from a port to memory with auto-increment.
> insl inputs longwords from a port to memory with auto-increment.
> outsw outputs words from memory to a port with auto-increment.
> outsl outputs lonwords from memory to a port with auto-increment.
>
> "auto-increment" bumps the memory pointer address by the size of the
> memory oprand. It can also decrement if the direction flag is set.
>
> Intel machines have, in addition to memory addresses, ports. Ports
> exist in I/O space entirely different than memory space. Many devices
> are connected to I/O ports, some to both memory and I/O ports.
>
>
> Cheers,
> Dick Johnson
> ***** FILE SYSTEM WAS MODIFIED *****
> Penguin : Linux version 2.2.6 on an i686 machine (400.59 BogoMips).
> Warning : It's hard to remain at the trailing edge of technology.
>
I work on a Power-PC PCI linux architecture and I'm not sure of the
actual implementation of theses functions in this architecture.
The Power-PC is a big-endian processor and theses functions are in the
actual code implemented as doing byte
swapping to change the endianess of data. A lot of linux driver rely on
the fact that theses functions doesn't swap data.
In my opinion changing theses functions to copy data as-is in the
Power-PC allows to get more driver in a working state
without too much code change. Is this the right thing ?, and, is there a
linux specification to explain how to make a driver
working in little-endian and big endian environment properly.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/