From 3e193cca2c2304fc6a3db751ee0ee733eeef4839 Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Tue, 29 Jul 2014 18:06:43 -0400 Subject: [PATCH] aducrf101: Rearrange stack and heap to maximize available stack space Stack now starts at the top of RAM, heap starts after BSS, and they grow towards each other. --- cpu/arm/aducrf101/Common/GCC/ADuCRF101.ld | 7 +++++-- cpu/arm/aducrf101/Common/GCC/crt0.S | 11 ----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cpu/arm/aducrf101/Common/GCC/ADuCRF101.ld b/cpu/arm/aducrf101/Common/GCC/ADuCRF101.ld index 8d553a5f7..a6effb701 100644 --- a/cpu/arm/aducrf101/Common/GCC/ADuCRF101.ld +++ b/cpu/arm/aducrf101/Common/GCC/ADuCRF101.ld @@ -91,10 +91,8 @@ SECTIONS } > ram AT > flash .bss : { - /* Stack is in BSS */ . = ALIGN(8); __bss_start = .; - *(.bss.stack) *(.bss) *(.bss.*) *(COMMON) @@ -102,4 +100,9 @@ SECTIONS __bss_end = .; end = .; } > ram + + /* Heap grows up from "end" (after bss), and stack grows down from + the end of RAM. */ + . = ORIGIN(ram) + LENGTH(ram); + stack_end = .; } diff --git a/cpu/arm/aducrf101/Common/GCC/crt0.S b/cpu/arm/aducrf101/Common/GCC/crt0.S index 592f97902..04b868448 100644 --- a/cpu/arm/aducrf101/Common/GCC/crt0.S +++ b/cpu/arm/aducrf101/Common/GCC/crt0.S @@ -32,19 +32,8 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __STACK_SIZE -#define __STACK_SIZE 1024 -#endif - .equ SCB_VTOR, 0xE000ED08 -/* Stack */ - .section .bss.stack -stack_start: - .space __STACK_SIZE, 0 -stack_end: - .global stack_end - /* Vector table */ .macro handler name .long \name\()