This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: code optimizations
- To: "'Gary Thomas'" <gthomas at redhat dot com>,"'Grant Edwards'" <grante at visi dot com>
- Subject: RE: [ECOS] code optimizations
- From: "Trenton D. Adams" <tadams at theone dot dnsalias dot com>
- Date: Thu, 23 Aug 2001 10:09:53 -0600
- Cc: "'eCos Discussion'" <ecos-discuss at sourceware dot cygnus dot com>
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.