From: Keith Packard Date: Sat, 14 Jul 2012 08:24:14 +0000 (-0700) Subject: altos/stm: Force STM stack to start at the top of RAM X-Git-Tag: 1.1~98 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=09633cac697e37d770b2b666ab20cab30628484f altos/stm: Force STM stack to start at the top of RAM 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 --- diff --git a/src/stm/altos-ram.ld b/src/stm/altos-ram.ld index b8fffedc..1143a08b 100644 --- a/src/stm/altos-ram.ld +++ b/src/stm/altos-ram.ld @@ -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 = .); } diff --git a/src/stm/altos.ld b/src/stm/altos.ld index 7fede558..f5a84f4c 100644 --- a/src/stm/altos.ld +++ b/src/stm/altos.ld @@ -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 = .); }