-DXXX on the linker command line overrides the defaults

On Nov 29, 2013 7:30 PM, Gedare Bloom <ged...@rtems.org> wrote:
Does the NGMP allow for variant sizes of ROM and RAM? If so will we
provide separate BSP variants for all possibilities, or how does the
user select the right size for their board?

On Fri, Nov 29, 2013 at 8:20 AM, Sebastian Huber
<sebastian.hu...@embedded-brains.de> wrote:
> Hello,
>
> most SPARC BSPs use current the following linker provided symbols to specify
> the memory layout:
>
> _PROM_SIZE = DEFINED (_PROM_SIZE) ? _PROM_SIZE : 2M;
> _PROM_START = DEFINED (_PROM_START) ? _PROM_START : 0x00000000;
>
> _RAM_SIZE = DEFINED (_RAM_SIZE) ? _RAM_SIZE : 4M;
> _RAM_START = DEFINED (_RAM_START) ? _RAM_START : 0x40000000;
>
> So it is possible to define them as command line parameters.  There are two
> problems with this approach.
>
> Firstly start address must be consistent with the memory area definition.
> Due to this reason the NGMP linker command file looks like this:
>
> _PROM_SIZE = DEFINED (_PROM_SIZE) ? _PROM_SIZE : 0;
> _RAM_SIZE = DEFINED (_RAM_SIZE) ? _RAM_SIZE : 64M;
>
> MEMORY {
>   rom     : ORIGIN = 0xC0000000, LENGTH = 256M
>   ram     : ORIGIN = 0x00000000, LENGTH = 2048M
>   sram    : ORIGIN = 0xD0000000, LENGTH = 256M
> }
>
> _PROM_START = ORIGIN (rom);
> _RAM_START = ORIGIN (ram);
>
> INCLUDE linkcmds.base
>
> Secondly the size symbols don't allow region overflow checks by the linker.
>
> A better approach would be to remove the ability to define these symbols on
> the command line and use a memory map definition via memory regions only.
> For the NGMP as an example this would look like:
>
> MEMORY {
>   rom     : ORIGIN = 0xC0000000, LENGTH = 8M
>   ram     : ORIGIN = 0x00000000, LENGTH = 64M
> }
>
> INCLUDE linkcmds.base
>
> This change makes it necessary to adopt user Makefiles to this new approach.
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> _______________________________________________
> rtems-devel mailing list
> rtems-devel@rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel

_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to