Byte-swapping vs not byte-swapping is not usually what the programmer wants.
Usually your device's registers are defined as being big-endian or
little-endian and you want whatever is needed to give you that.
I believe that on some archs that can be either byte order, some built-in
devices will change their registers to match, and so you want "native endian"
or no swapping for these. Though that's definitely in the minority.
An accessors that always byte-swaps regardless of the endianness of the host
is never something I've seen a driver want.
IOW, there are four ways one can defined endianness/swapping:
1) Little-endian
2) Big-endian
3) Native-endian aka non-byte-swapping
4) Foreign-endian aka byte-swapping
1 and 2 are by far the most used. Some code wants 3. No one wants 4. Yet
our API is providing 3 & 4, the two which are the least useful.
Is it enough to provide only "all or none" for ordering strictness? For
instance on powerpc, one can get a speedup by dropping strict ordering for IO
vs cacheable memory, but still keeping ordering for IO vs IO and IO vs locks.
This is much easier to program for than no ordering at all. In fact, if one
doesn't use coherent DMA, it's basically the same as fully strict ordering.
--