This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: code optimizations
- To: Grant Edwards <grante at visi dot com>
- Subject: Re: [ECOS] code optimizations
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Thu, 23 Aug 2001 10:08:03 -0600 (MDT)
- Cc: eCos Discussion <ecos-discuss at sourceware dot cygnus dot com>,
- Cc: eCos Discussion <ecos-discuss at sourceware dot cygnus dot com>,"Trenton D. Adams" <tadams at extremeeng dot com>
- Organization: Red Hat, Inc.
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.