[ECOS] code optimizations
Gary Thomas
gthomas@redhat.com
Thu Aug 23 09:02:00 GMT 2001
On 23-Aug-2001 Grant Edwards wrote:
> <pet peeve>
>
> Personally, I think that addresses should be assigned to
> objects by the linker, so I prefer this:
>
> extern volatile unsigned foo;
>
> foo = 0x12345678;
>
> Then assign an address to foo at link time.
>
> However, that's not the standard eCos idiom. Rather, putting
> peripheral addresses in the source code seems to be the way
> it's usually done in eCos HAL and drivers.
>
> </pet peeve>
Why? I don't see any advantage - in fact there could be major
code generation/optimization disadvantages. Having the actual
addresses in header files (the eCos custom) also provides an
additional level of documentation, however bleak.
Note: I doubt that you'll find any addresses in actual code, but
rather in header files which can be easily manipulated allowing
for the additional flexibility I feel you seek.
More information about the Ecos-discuss
mailing list