altos/stm: Force STM stack to start at the top of RAM
authorKeith Packard <keithp@keithp.com>
Sat, 14 Jul 2012 08:24:14 +0000 (01:24 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 14 Jul 2012 08:24:14 +0000 (01:24 -0700)
Using a fixed size means crashing if there's not enough space for
that, or wasting memory if there's too much.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/altos-ram.ld
src/stm/altos.ld

index b8fffedc0dac6bec93af2ccfa3ba000671099892..1143a08b8cc178a1aacd0f7403a3faad004dea4b 100644 (file)
@@ -19,8 +19,6 @@ MEMORY {
        ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K
 }
 
-C_STACK_SIZE = 512;
-
 INCLUDE registers.ld
 
 SECTIONS {
@@ -59,7 +57,7 @@ SECTIONS {
                __bss_end__ = .;
        } >ram
 
-       PROVIDE(__stack__ = . + C_STACK_SIZE);
+       PROVIDE(__stack__ = ORIGIN(ram) + LENGTH(ram));
        PROVIDE(end = .);
 
 }
index 7fede5589206ec5a3cd000cfc4dd4f904fb1c8d0..f5a84f4c2c658931dd409351b4c1b8e1c1a90ec6 100644 (file)
@@ -23,7 +23,6 @@ MEMORY {
 INCLUDE registers.ld
 
 EXTERN (stm_interrupt_vector)
-C_STACK_SIZE = 512;
 
 SECTIONS {
        . = ORIGIN(rom);
@@ -62,7 +61,7 @@ SECTIONS {
                __bss_end__ = .;
        } >ram
 
-       PROVIDE(__stack__ = . + C_STACK_SIZE);
+       PROVIDE(__stack__ = ORIGIN(ram) + LENGTH(ram));
        PROVIDE(end = .);
 
 }