aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC/ARMCMx/chcore_v6m.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/ports/GCC/ARMCMx/chcore_v6m.h')
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v6m.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h
index 4b4ef04f6..bb20cb4be 100644
--- a/os/ports/GCC/ARMCMx/chcore_v6m.h
+++ b/os/ports/GCC/ARMCMx/chcore_v6m.h
@@ -128,16 +128,18 @@ struct intctx {
* enabled to invoke system APIs.
*/
#define PORT_IRQ_EPILOGUE() { \
- port_lock_from_isr(); \
- if ((_saved_lr != (regarm_t)0xFFFFFFF1) && chSchIsRescRequiredExI()) { \
- register struct cmxctx *ctxp; \
+ if (_saved_lr != (regarm_t)0xFFFFFFF1) { \
+ port_lock_from_isr(); \
+ if (chSchIsRescRequiredExI()) { \
+ register struct cmxctx *ctxp; \
\
- asm volatile ("mrs %0, PSP" : "=r" (ctxp) : ); \
- _port_saved_pc = ctxp->pc; \
- ctxp->pc = _port_switch_from_isr; \
- return; \
+ asm volatile ("mrs %0, PSP" : "=r" (ctxp) : ); \
+ _port_saved_pc = ctxp->pc; \
+ ctxp->pc = _port_switch_from_isr; \
+ return; \
+ } \
+ port_unlock_from_isr(); \
} \
- port_unlock_from_isr(); \
}
/**