aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/rt/ports/ARMCMx/chcore_v6m.h3
-rw-r--r--os/rt/ports/ARMCMx/chcore_v7m.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.h b/os/rt/ports/ARMCMx/chcore_v6m.h
index 3ac78b926..9750308d4 100644
--- a/os/rt/ports/ARMCMx/chcore_v6m.h
+++ b/os/rt/ports/ARMCMx/chcore_v6m.h
@@ -251,8 +251,9 @@ struct port_intctx {
#else
#define port_switch(ntp, otp) { \
struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \
- if ((stkalign_t *)(r13 - 1) < (otp)->p_stklimit) \
+ if ((stkalign_t *)(r13 - 1) < (otp)->p_stklimit) { \
chSysHalt("stack overflow"); \
+ } \
_port_switch(ntp, otp); \
}
#endif
diff --git a/os/rt/ports/ARMCMx/chcore_v7m.h b/os/rt/ports/ARMCMx/chcore_v7m.h
index d6befaf72..2e49c1895 100644
--- a/os/rt/ports/ARMCMx/chcore_v7m.h
+++ b/os/rt/ports/ARMCMx/chcore_v7m.h
@@ -343,8 +343,9 @@ struct port_intctx {
#else
#define port_switch(ntp, otp) { \
struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \
- if ((stkalign_t *)(r13 - 1) < (otp)->p_stklimit) \
+ if ((stkalign_t *)(r13 - 1) < (otp)->p_stklimit) { \
chSysHalt("stack overflow"); \
+ } \
_port_switch(ntp, otp); \
}
#endif