[ECOS] code optimizations

Trenton D. Adams tadams@theone.dnsalias.com
Thu Aug 23 09:10:00 GMT 2001


Screw optimizations.  My CDL thing did work, and I changed to -O0.  This
didn't have any affect on whether my driver works or not as was
suggested by some people a few weeks ago! :(



-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[ mailto:ecos-discuss-owner@sources.redhat.com ] On Behalf Of Gary Thomas
Sent: Thursday, August 23, 2001 10:08 AM
To: Grant Edwards
Cc: eCos Discussion; eCos Discussion; Trenton D. Adams
Subject: Re: [ECOS] code optimizations



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