This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]