aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chsys.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-04-02 16:47:14 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-04-02 16:47:14 +0000
commit71f174d00dcd678fa9da5acea8e1454f2417810c (patch)
tree53f5b106f790e0797545ac7b91af2e0a21886720 /os/rt/src/chsys.c
parente8f67437d0007a2a4cd5a05afbd525a1960c188c (diff)
downloadChibiOS-71f174d00dcd678fa9da5acea8e1454f2417810c.tar.gz
ChibiOS-71f174d00dcd678fa9da5acea8e1454f2417810c.tar.bz2
ChibiOS-71f174d00dcd678fa9da5acea8e1454f2417810c.zip
Fixed stack limit conditions in RT4.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9224 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src/chsys.c')
-rw-r--r--os/rt/src/chsys.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c
index 82a9e78d6..f4dbbb4e2 100644
--- a/os/rt/src/chsys.c
+++ b/os/rt/src/chsys.c
@@ -98,7 +98,6 @@ static void _idle_thread(void *p) {
* @special
*/
void chSysInit(void) {
- extern stkalign_t __main_thread_stack_base__;
_scheduler_init();
_vt_init();
@@ -135,8 +134,16 @@ void chSysInit(void) {
currp = _thread_init(&ch.mainthread, "idle", IDLEPRIO);
#endif
- /* Setting up the base address of the static main thread stack.*/
- currp->stklimit = &__main_thread_stack_base__;
+#if CH_DBG_ENABLE_STACK_CHECK == TRUE
+ {
+ /* Setting up the base address of the static main thread stack, the
+ symbol must be provided externally.*/
+ extern stkalign_t __main_thread_stack_base__;
+ currp->wabase = &__main_thread_stack_base__;
+ }
+#elif CH_CFG_USE_DYNAMIC == TRUE
+ currp->wabase = NULL;
+#endif
/* Setting up the caller as current thread.*/
currp->state = CH_STATE_CURRENT;