diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-14 12:27:46 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-14 12:27:46 +0000 |
commit | 9741231ed794ed6825795e34a35c3391fbc32830 (patch) | |
tree | 2cf4b354f269ef9244f97d076e5ced54d87e18ed /os/ports | |
parent | 8de4dd0ed3f9299f51557bc230621bf0695a2327 (diff) | |
download | ChibiOS-9741231ed794ed6825795e34a35c3391fbc32830.tar.gz ChibiOS-9741231ed794ed6825795e34a35c3391fbc32830.tar.bz2 ChibiOS-9741231ed794ed6825795e34a35c3391fbc32830.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3234 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports')
-rw-r--r-- | os/ports/IAR/ARMCMx/chcore_v6m.h | 2 | ||||
-rw-r--r-- | os/ports/IAR/ARMCMx/chcore_v7m.h | 2 | ||||
-rw-r--r-- | os/ports/RVCT/ARMCMx/chcore_v6m.h | 4 | ||||
-rw-r--r-- | os/ports/RVCT/ARMCMx/chcore_v7m.h | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/os/ports/IAR/ARMCMx/chcore_v6m.h b/os/ports/IAR/ARMCMx/chcore_v6m.h index a25fde1ef..0480451c0 100644 --- a/os/ports/IAR/ARMCMx/chcore_v6m.h +++ b/os/ports/IAR/ARMCMx/chcore_v6m.h @@ -240,7 +240,7 @@ struct intctx { #define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
- if ((void *)(__get_SP() - sizeof(struct intctx)) < (void *)(otp + 1)) \
+ if ((stkalign_t *)(__get_SP() - sizeof(struct intctx)) < otp->p_stklimit) \
chDbgPanic("stack overflow"); \
_port_switch(ntp, otp); \
}
diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h index 059f29711..086a99d39 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.h +++ b/os/ports/IAR/ARMCMx/chcore_v7m.h @@ -306,7 +306,7 @@ struct intctx { #define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
- if ((void *)(__get_SP() - sizeof(struct intctx)) < (void *)(otp + 1)) \
+ if ((stkalign_t *)(__get_SP() - sizeof(struct intctx)) < otp->p_stklimit) \
chDbgPanic("stack overflow"); \
_port_switch(ntp, otp); \
}
diff --git a/os/ports/RVCT/ARMCMx/chcore_v6m.h b/os/ports/RVCT/ARMCMx/chcore_v6m.h index 7241d462f..bdeec1674 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v6m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v6m.h @@ -240,8 +240,8 @@ struct intctx { #define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
- struct intctx *r13 = (struct intctx *)__current_sp(); \
- if ((void *)(r13 - 1) < (void *)(otp + 1)) \
+ uint8_t *r13 = (uint8_t *)__current_sp(); \
+ if ((stkalign_t *)(r13 - sizeof(struct intctx)) < otp->p_stklimit) \
chDbgPanic("stack overflow"); \
_port_switch(ntp, otp); \
}
diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index fdf855f77..17447476f 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -314,8 +314,8 @@ struct intctx { #define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
- struct intctx *r13 = (struct intctx *)__current_sp(); \
- if ((void *)(r13 - 1) < (void *)(otp + 1)) \
+ uint8_t *r13 = (uint8_t *)__current_sp(); \
+ if ((stkalign_t *)(r13 - sizeof(struct intctx)) < otp->p_stklimit) \
chDbgPanic("stack overflow"); \
_port_switch(ntp, otp); \
}
|