From c5496788e53c99371c2f4a36c67dcbf556176398 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 13 Sep 2009 09:38:59 +0000 Subject: Cortex-M3 related improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1161 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCM3/chcore.c | 6 ------ os/ports/GCC/ARMCM3/chcore.h | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'os/ports') diff --git a/os/ports/GCC/ARMCM3/chcore.c b/os/ports/GCC/ARMCM3/chcore.c index ce76ffa4c..4e9874f82 100644 --- a/os/ports/GCC/ARMCM3/chcore.c +++ b/os/ports/GCC/ARMCM3/chcore.c @@ -151,13 +151,7 @@ void PendSVVector(void) { Thread *otp; register struct intctx *sp_thd asm("r12"); - asm volatile ("push {lr}"); chSysLockFromIsr(); - if (!chSchRescRequiredI()) { - chSysUnlockFromIsr(); - asm volatile ("pop {pc}"); - } - asm volatile ("pop {lr}"); PUSH_CONTEXT(sp_thd); diff --git a/os/ports/GCC/ARMCM3/chcore.h b/os/ports/GCC/ARMCM3/chcore.h index 4a6ee2695..daff52090 100644 --- a/os/ports/GCC/ARMCM3/chcore.h +++ b/os/ports/GCC/ARMCM3/chcore.h @@ -209,8 +209,11 @@ struct context { * IRQ epilogue code, inserted at the end of all IRQ handlers enabled to * invoke system APIs. */ -#define PORT_IRQ_EPILOGUE() { \ - SCB_ICSR = ICSR_PENDSVSET; \ +#define PORT_IRQ_EPILOGUE() { \ + chSysLockFromIsr(); \ + if (chSchRescRequiredI()) \ + SCB_ICSR = ICSR_PENDSVSET; \ + chSysUnlockFromIsr(); \ } /** -- cgit v1.2.3