[ECOS] How do I get __ARMEB__ defined ?

Jonathan Larmour jlarmour@redhat.com
Mon Dec 11 13:36:00 GMT 2000

"Edward,Yan-Chi,Lin" wrote:
> Hi
> I have a bigendian ARM cpu now, but I don't know how do I get __ARMEB__ defined ?

It's defined by the compiler when it is invoked with -EB (for big-endian).

> Also could someone explain what does the macro in hal_io.h for big endian means ?
> Why ^3 ?

Because the change of endian-ness means that for the code to read the same
byte when given the same address irrespective of endianness, then the last
two bits of the address need fiddling to compensate for the endianness

e.g. if asking for the lowest significant byte, the address supplied would
end in 00, but for this macro to return the correct byte in big-endian
mode, it has to read 11. Similarly 01->10 and 11->00, so the operation is a
bitwise XOR.

Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

More information about the Ecos-discuss mailing list