Re: Help with cross-endian bitfields?
From: Josh Huber <hidden>
Date: 2000-05-05 20:45:19
On Fri, May 05, 2000 at 04:05:52PM -0400, Dan Malek wrote:
IMHO, bit fields are not normally a good thing to be using if this is describing a real device register. The compiler is able to read/write in ways that may not be proper for hardware access. For device registers and when this is a data structure in memory, the cross-platform method of using macros for reading writing 16- and 32-bit values and then 'C' operators for testing/setting bits has worked pretty well in the past.....
Yeah, I just looked in the PowerPC ABI for bitfield storage, and the relevant text said: * Bit-fields are allocated from right to left (least to most significant) on Little-Endian implementations and from left to right (most to least significant) on Big-Endian implementations. Josh ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/