This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: How to create a new platform?
Jesper Skov wrote:
> Grant> Do you prefer the "declare a pointer and then type-cast a
> Grant> hard-wired constant value" method?
>
> Grant> const UartType Uart0Ptr = (UartType*) 0x3604000;
>
> This is the method I'm familiar with. But I'm just a dumb kid :)
If this is actually a define, ie. #define UARTBASE ((UartType *)0x3604000)
then it would be very bad if gcc could not optimize "UARTBASE->foo" to be a
direct access to a single memory address, rather than having to do the
addition.
I'm not sure I could guarantee that for "const"s though.
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault