This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: cs8900a for big endian targets
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Bob Koninckx <bob dot koninckx at mech dot kuleuven dot ac dot be>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Mon, 03 Mar 2003 21:10:29 +0000
- Subject: Re: cs8900a for big endian targets
- References: <1046725062.1513.7.camel@pc-002>
Bob Koninckx wrote:
Oops ... Better send it with the attachment ...
Attached patch makes a number of modifications to the code to support
both big endian and little endian targets. Thoroughly tested with big
endian target (powerpc), not been tested with a little endian target as
I don't have one.
Just a comment, that to save duplication (and therefore avoid the risk of
being out of sync) it might be slightly preferable to use a macro with the
existing values.
Perhaps #include <cyg/hal/hal_endian.h> and "just" use CYG_CPU_TO_LE16
when using/defining each value? That might be sufficient.
Similarly using the CYG_*_TO_* macros from hal_endian.h you don't need to
use CYG_SWAP16 etc. but can just use a single macro which will be a no-op
on little-endian.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine