1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #4307 from haukepetersen/opt_cortex_isrstack

cpu/cortexm_common: moved ISR stack definition
This commit is contained in:
Hauke Petersen 2015-11-20 12:11:19 +01:00
commit 3fc71ef694
3 changed files with 15 additions and 6 deletions

View File

@ -64,6 +64,15 @@ extern "C" {
#endif
/** @} */
/**
* @brief Stack size used for the exception (ISR) stack
* @{
*/
#ifndef ISR_STACKSIZE
#define ISR_STACKSIZE (512U)
#endif
/** @} */
/**
* @brief Some members of the Cortex-M family have architecture specific
* atomic operations in atomic_arch.c

View File

@ -31,11 +31,6 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
SEARCH_DIR(.)
/* Define the default stack size for interrupt mode. As no context is
saved on this stack and ISRs are supposed to be short, it can be fairly
small. 512 byte should be a save assumption here */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x200; /* 512 byte */
/* Section Definitions */
SECTIONS
{
@ -134,7 +129,7 @@ SECTIONS
{
. = ALIGN(8);
_sstack = .;
. = . + STACK_SIZE;
KEEP (*(.isr_stack))
. = ALIGN(8);
_estack = .;
} > ram

View File

@ -55,6 +55,11 @@ extern uint32_t _eram;
*/
#define STACK_CANARY_WORD 0xE7FEE7FEu
/**
* @brief Allocation of the interrupt stack
*/
__attribute__((used,section(".isr_stack"))) uint8_t isr_stack[ISR_STACKSIZE];
/**
* @brief Pre-start routine for CPU-specific settings
*/