Centralyzed ARM scatter files too, new stack checking implemented in ARM port.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3210 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2011-08-08 10:01:14 +00:00
parent cb54f8224b
commit 26eabc0db1
7 changed files with 22 additions and 28 deletions

View File

@ -102,3 +102,4 @@ _end = .;
__heap_base__ = _end; __heap_base__ = _end;
__heap_end__ = __ram_end__ - __stacks_total_size__; __heap_end__ = __ram_end__ - __stacks_total_size__;
__main_thread_stack_base__ = __ram_end__ - __stacks_total_size__;

View File

@ -102,3 +102,4 @@ _end = .;
__heap_base__ = _end; __heap_base__ = _end;
__heap_end__ = __ram_end__ - __stacks_total_size__; __heap_end__ = __ram_end__ - __stacks_total_size__;
__main_thread_stack_base__ = __ram_end__ - __stacks_total_size__;

View File

@ -105,3 +105,4 @@ _end = .;
__heap_base__ = _end; __heap_base__ = _end;
__heap_end__ = __ram_end__ - __stacks_total_size__; __heap_end__ = __ram_end__ - __stacks_total_size__;
__main_thread_stack_base__ = __ram_end__ - __stacks_total_size__;

View File

@ -438,14 +438,10 @@ struct context {
#ifdef THUMB #ifdef THUMB
#if CH_DBG_ENABLE_STACK_CHECK #if CH_DBG_ENABLE_STACK_CHECK
#define port_switch(ntp, otp) { \ #define port_switch(ntp, otp) { \
register Thread *_ntp asm ("r0") = (ntp); \ register struct intctx *r13 asm ("r13"); \
register Thread *_otp asm ("r1") = (otp); \ if ((stkalign_t *)(r13 - 1) < otp->p_stklimit) \
register char *sp asm ("sp"); \ chDbgPanic("stack overflow"); \
if (sp - sizeof(struct intctx) - sizeof(Thread) < (char *)_otp) \ _port_switch_thumb(ntp, otp); \
asm volatile ("mov r0, #0 \n\t" \
"ldr r1, =chDbgPanic \n\t" \
"bx r1"); \
_port_switch_thumb(_ntp, _otp); \
} }
#else /* !CH_DBG_ENABLE_STACK_CHECK */ #else /* !CH_DBG_ENABLE_STACK_CHECK */
#define port_switch(ntp, otp) _port_switch_thumb(ntp, otp) #define port_switch(ntp, otp) _port_switch_thumb(ntp, otp)
@ -453,13 +449,10 @@ struct context {
#else /* !THUMB */ #else /* !THUMB */
#if CH_DBG_ENABLE_STACK_CHECK #if CH_DBG_ENABLE_STACK_CHECK
#define port_switch(ntp, otp) { \ #define port_switch(ntp, otp) { \
register Thread *_ntp asm ("r0") = (ntp); \ register struct intctx *r13 asm ("r13"); \
register Thread *_otp asm ("r1") = (otp); \ if ((stkalign_t *)(r13 - 1) < otp->p_stklimit) \
register char *sp asm ("sp"); \ chDbgPanic("stack overflow"); \
if (sp - sizeof(struct intctx) - sizeof(Thread) < (char *)_otp) \ _port_switch_arm(ntp, otp); \
asm volatile ("mov r0, #0 \n\t" \
"b chDbgPanic"); \
_port_switch_arm(_ntp, _otp); \
} }
#else /* !CH_DBG_ENABLE_STACK_CHECK */ #else /* !CH_DBG_ENABLE_STACK_CHECK */
#define port_switch(ntp, otp) _port_switch_arm(ntp, otp) #define port_switch(ntp, otp) _port_switch_arm(ntp, otp)

View File

@ -92,7 +92,6 @@
- NEW: Removed all the ch.ld files from the ARMCMx demos, now the makefiles - NEW: Removed all the ch.ld files from the ARMCMx demos, now the makefiles
point to common ld files under the various ports. Less duplication and point to common ld files under the various ports. Less duplication and
easier maintenance. easier maintenance.
(do this to the other GCC ports too)
- NEW: Improved stack checking and reorganized memory map for the Cortex-Mx - NEW: Improved stack checking and reorganized memory map for the Cortex-Mx
demos. Now stacks are allocated at the start of the RAM, an overflow of the demos. Now stacks are allocated at the start of the RAM, an overflow of the
exception stack now triggers an exception (it could went unnoticed before). exception stack now triggers an exception (it could went unnoticed before).
@ -100,7 +99,6 @@
threads. Now all threads have an explicit stack boundary pointer. threads. Now all threads have an explicit stack boundary pointer.
(documentation to be updated) (documentation to be updated)
(change to be ported to IAR and Keil ports) (change to be ported to IAR and Keil ports)
(change to be ported to ARM and other ports)
- NEW: Added debug plugin for Eclipse under ./tools/eclipse (backported to - NEW: Added debug plugin for Eclipse under ./tools/eclipse (backported to
2.2.7). 2.2.7).
- NEW: The debug macros chDbgCheck() and chDbgAssert() now can be externally - NEW: The debug macros chDbgCheck() and chDbgAssert() now can be externally