aboutsummaryrefslogtreecommitdiffstats
path: root/os/common
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/common
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/common')
-rw-r--r--os/common/ports/ARM/chcore.h4
-rw-r--r--os/common/ports/ARMCMx/chcore_v6m.h2
-rw-r--r--os/common/ports/ARMCMx/chcore_v7m.h4
-rw-r--r--os/common/ports/e200/chcore.h2
-rw-r--r--os/common/ports/templates/chcore.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/os/common/ports/ARM/chcore.h b/os/common/ports/ARM/chcore.h
index 532fb0d11..3aa31eedc 100644
--- a/os/common/ports/ARM/chcore.h
+++ b/os/common/ports/ARM/chcore.h
@@ -337,7 +337,7 @@ struct port_context {
#if CH_DBG_ENABLE_STACK_CHECK == TRUE
#define port_switch(ntp, otp) { \
register struct port_intctx *r13 asm ("r13"); \
- if ((stkalign_t *)(r13 - 1) < otp->p_stklimit) \
+ if ((stkalign_t *)(r13 - 1) < otp->wabase) \
chSysHalt("stack overflow"); \
_port_switch_thumb(ntp, otp); \
}
@@ -350,7 +350,7 @@ struct port_context {
#if CH_DBG_ENABLE_STACK_CHECK == TRUE
#define port_switch(ntp, otp) { \
register struct port_intctx *r13 asm ("r13"); \
- if ((stkalign_t *)(r13 - 1) < otp->stklimit) \
+ if ((stkalign_t *)(r13 - 1) < otp->wabase) \
chSysHalt("stack overflow"); \
_port_switch_arm(ntp, otp); \
}
diff --git a/os/common/ports/ARMCMx/chcore_v6m.h b/os/common/ports/ARMCMx/chcore_v6m.h
index 0afeeabe9..06039ecc6 100644
--- a/os/common/ports/ARMCMx/chcore_v6m.h
+++ b/os/common/ports/ARMCMx/chcore_v6m.h
@@ -285,7 +285,7 @@ struct port_intctx {
#else
#define port_switch(ntp, otp) { \
struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \
- if ((stkalign_t *)(r13 - 1) < (otp)->stklimit) { \
+ if ((stkalign_t *)(r13 - 1) < (otp)->wabase) { \
chSysHalt("stack overflow"); \
} \
_port_switch(ntp, otp); \
diff --git a/os/common/ports/ARMCMx/chcore_v7m.h b/os/common/ports/ARMCMx/chcore_v7m.h
index 5dbbed8bd..bf6a998f3 100644
--- a/os/common/ports/ARMCMx/chcore_v7m.h
+++ b/os/common/ports/ARMCMx/chcore_v7m.h
@@ -440,7 +440,7 @@ struct port_intctx {
#if PORT_ENABLE_GUARD_PAGES == FALSE
#define port_switch(ntp, otp) { \
struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \
- if ((stkalign_t *)(r13 - 1) < (otp)->stklimit) { \
+ if ((stkalign_t *)(r13 - 1) < (otp)->wabase) { \
chSysHalt("stack overflow"); \
} \
_port_switch(ntp, otp); \
@@ -451,7 +451,7 @@ struct port_intctx {
\
/* Setting up the guard page for the switched-in thread.*/ \
mpuConfigureRegion(MPU_REGION_0, \
- chThdGetSelfX()->stklimit, \
+ chThdGetSelfX()->wabase, \
MPU_RASR_ATTR_AP_NA_NA | \
MPU_RASR_ATTR_NON_CACHEABLE | \
MPU_RASR_SIZE_32 | \
diff --git a/os/common/ports/e200/chcore.h b/os/common/ports/e200/chcore.h
index d031f1c28..453f955bb 100644
--- a/os/common/ports/e200/chcore.h
+++ b/os/common/ports/e200/chcore.h
@@ -392,7 +392,7 @@ struct port_context {
#else
#define port_switch(ntp, otp) { \
register struct port_intctx *sp asm ("%r1"); \
- if ((stkalign_t *)(sp - 1) < otp->stklimit) \
+ if ((stkalign_t *)(sp - 1) < otp->wabase) \
chSysHalt("stack overflow"); \
_port_switch(ntp, otp); \
}
diff --git a/os/common/ports/templates/chcore.h b/os/common/ports/templates/chcore.h
index 4b92a3a23..8faf4ec35 100644
--- a/os/common/ports/templates/chcore.h
+++ b/os/common/ports/templates/chcore.h
@@ -272,7 +272,7 @@ struct port_context {
#else
#define port_switch(ntp, otp) { \
register struct port_intctx *sp asm ("%r1"); \
- if ((stkalign_t *)(sp - 1) < otp->stklimit) \
+ if ((stkalign_t *)(sp - 1) < otp->wabase) \
chSysHalt("stack overflow"); \
_port_switch(ntp, otp); \
}