some newbie questions

sebastian ssmoller sebastian.ssmoller at gmx.net
Sat Feb 14 22:00:58 UTC 2004


On Sat, 14 Feb 2004 15:38:36 +0100
"Thomas Doerfler" <Thomas.Doerfler at imd-systems.de> wrote:

hi,

> Hello Sebastian,
> 
> > $ grep -r m360_t *
> > cpukit/score/cpu/m68k/m68360.h:} m360_t;
> > cpukit/score/cpu/m68k/m68360.h:extern volatile m360_t m360;
> > 
> > 
> > this variable (m360) is havily used in console.c. so it must be
> > defined
> > somewhere, or not ?
> > 
> > 
> 
> as your findings show, it is declared in m68360.h (so the 
> compiler knows it will be defined somewhere and it is of type 
> m360_t). For this BSP family it is defined in the linker 
> command file 
> "c/src/lib/libbsp/m68k/gen68360/startup/linkcmds":
> 
>         /*
>          * On-chip memory/peripherals
>          */
>         dpram : {
>                 m360 = .;
>                 . += (8 * 1024);
>         } >dpram
> 

thx now i understand how it works. that was the missing piece of the
puzzle :) thank you for that hint

so you "map" the c struct to the memory as described there, right ?
but what about padding bits the compiler could insert/add for
optimization ? do we know that the gcc doesnt do it ? what about a
different compiler or a newer version of gcc e.g. 3.2 (i read about the
recommandation in the docs ...) ?

regards,
seb

> 
> wkr,
> 	Thomas Doerfler.
> --------------------------------------------
> IMD Ingenieurbuero fuer Microcomputertechnik
> Thomas Doerfler           Herbststrasse 8
> D-82178 Puchheim          Germany
> email:    Thomas.Doerfler at imd-systems.de
> PGP public key available at: http://www.imd-
> systems.de/pgp_keys.htm
> 


-- 
Microsoft: Where do you want to go today?
Linux: Where do you want to go tomorrow?
FreeBSD: Are you guys coming or what?
OpenBSD: Hey guys you left some holes out there!



More information about the users mailing list