From a7ce64bb324a4d56808a806070de42adbef9a215 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Feb 2011 12:44:06 +0000 Subject: Fixed bug 3193062 (IAR). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2765 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore_v6m.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'os/ports/GCC/ARMCMx') 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(); \ } /** -- cgit v1.2.3