PCI endianess
Anil K Prasad
aprasad at in.ibm.com
Wed Sep 4 18:00:14 EST 2002
>Do you mean this happens without conversion (e.g. read/write{bwl]) ?
>Then it is exactly what I need.
>If I do on my big endian machine:
> unsigned short val = 0x1234;
> x->command = val;
you must do something like this:
out_le16(x->command, val); for 16 bit data
and out_le32 for 32 bit data.
Using these out_le16/32 will ensure portability across different endian
platforms.
>Is 0x1234 stored as little endian on the cards ram ?
Yes.
>You wrote that addresses 2 and 3 are not used because of padding, but
>I didn't notice this before. My structure needs to be __packed__ which
>does work without telling this the compiler. Or will GCC on PPC64 do it
>different ?
I am not sure abt this.
Regards,
Anil.
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list