Commit beab46e5 authored by schneider's avatar schneider
Browse files

change(startup): Move stack sizes to linker scripts

parent 3804e445
......@@ -57,6 +57,8 @@ SRAM_ADDR = DEFINED(ARM_SRAM_START) ? ARM_SRAM_START : (SDMA_CODE_ADDR + SDMA_CO
/* SRAM_SIZE must be defined */
SRAM_LEN = SRAM_SIZE + SRAM_ORIGIN - SRAM_ADDR;
STACK_SIZE = 0x1000;
/* SPID and SPIX Sections here are maximum possible sizes */
/* If used, they should be adjusted for the external Flash/RAM size */
MEMORY {
......@@ -191,18 +193,11 @@ SECTIONS {
_ebss = ALIGN(., 4);
} > SRAM
/* Setup the stack for Core 1, it will only be used if the user code
* includes a definition of Stack_Size_Core1, which defines the space
* reserved above the main core's stack for core 1's stack */
__StackTop_Core1 = ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit_Core1 = DEFINED(Stack_Size_Core1) ? __StackTop_Core1 - Stack_Size_Core1 : __StackTop_Core1;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size.
* If core 1 is used, set the stack to the bottom of Core 1's stack region */
__StackTop = DEFINED(Stack_Size_Core1) ? __StackLimit_Core1 : ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit = __StackTop - Stack_Size;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size. */
__StackTop = ORIGIN(SRAM) + LENGTH(SRAM);
/*__StackLimit = __StackTop - Stack_Size; */
__StackLimit = __StackTop - STACK_SIZE;
.heap (COPY):
{
......
......@@ -34,6 +34,8 @@
*
******************************************************************************/
STACK_SIZE = 0x1000;
/* SPID and SPIX Sections here are maximum possible sizes */
/* If used, they should be adjusted for the external Flash/RAM size */
MEMORY {
......@@ -120,18 +122,11 @@ SECTIONS {
_ebss = ALIGN(., 4);
} > SRAM
/* Setup the stack for Core 1, it will only be used if the user code
* includes a definition of Stack_Size_Core1, which defines the space
* reserved above the main core's stack for core 1's stack */
__StackTop_Core1 = ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit_Core1 = DEFINED(Stack_Size_Core1) ? __StackTop_Core1 - Stack_Size_Core1 : __StackTop_Core1;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size.
* If core 1 is used, set the stack to the bottom of Core 1's stack region */
__StackTop = DEFINED(Stack_Size_Core1) ? __StackLimit_Core1 : ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit = __StackTop - Stack_Size;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size. */
__StackTop = ORIGIN(SRAM) + LENGTH(SRAM);
/*__StackLimit = __StackTop - Stack_Size; */
__StackLimit = __StackTop - STACK_SIZE;
.heap (COPY):
{
......
......@@ -34,6 +34,8 @@
*
******************************************************************************/
STACK_SIZE = 0x1000;
/* SPID and SPIX Sections here are maximum possible sizes */
/* If used, they should be adjusted for the external Flash/RAM size */
MEMORY {
......@@ -120,18 +122,11 @@ SECTIONS {
_ebss = ALIGN(., 4);
} > SRAM
/* Setup the stack for Core 1, it will only be used if the user code
* includes a definition of Stack_Size_Core1, which defines the space
* reserved above the main core's stack for core 1's stack */
__StackTop_Core1 = ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit_Core1 = DEFINED(Stack_Size_Core1) ? __StackTop_Core1 - Stack_Size_Core1 : __StackTop_Core1;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size.
* If core 1 is used, set the stack to the bottom of Core 1's stack region */
__StackTop = DEFINED(Stack_Size_Core1) ? __StackLimit_Core1 : ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit = __StackTop - Stack_Size;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size. */
__StackTop = ORIGIN(SRAM) + LENGTH(SRAM);
/*__StackLimit = __StackTop - Stack_Size; */
__StackLimit = __StackTop - STACK_SIZE;
.heap (COPY):
{
......
......@@ -34,6 +34,8 @@
*
******************************************************************************/
STACK_SIZE = 0x2000;
/* SPID and SPIX Sections here are maximum possible sizes */
/* If used, they should be adjusted for the external Flash/RAM size */
MEMORY {
......@@ -120,18 +122,11 @@ SECTIONS {
_ebss = ALIGN(., 4);
} > SRAM
/* Setup the stack for Core 1, it will only be used if the user code
* includes a definition of Stack_Size_Core1, which defines the space
* reserved above the main core's stack for core 1's stack */
__StackTop_Core1 = ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit_Core1 = DEFINED(Stack_Size_Core1) ? __StackTop_Core1 - Stack_Size_Core1 : __StackTop_Core1;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size.
* If core 1 is used, set the stack to the bottom of Core 1's stack region */
__StackTop = DEFINED(Stack_Size_Core1) ? __StackLimit_Core1 : ORIGIN(SRAM) + LENGTH(SRAM);
__StackLimit = __StackTop - Stack_Size;
/* Set stack top to end of RAM, and stack limit move down by Stack_Size. */
__StackTop = ORIGIN(SRAM) + LENGTH(SRAM);
/*__StackLimit = __StackTop - Stack_Size; */
__StackLimit = __StackTop - STACK_SIZE;
.heap (COPY):
{
......
......@@ -63,12 +63,16 @@
.equ ARM_SRAM_START, __ARM_SRAM_START
#endif
/*
XXX: card10: Stack size moved to linker scripts.
.globl Stack_Size
#ifdef __STACK_SIZE
.equ Stack_Size, __STACK_SIZE
#else
.equ Stack_Size, 0x00001000
#endif
.globl __StackTop
.globl __StackLimit
__StackLimit:
......@@ -76,7 +80,7 @@ __StackLimit:
.size __StackLimit, . - __StackLimit
__StackTop:
.size __StackTop, . - __StackTop
*/
.section .heap
.align 3
#ifdef __HEAP_SIZE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment