From 51875dac89e323d1a0eebc301a2122903bbb58ba Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 16 Jun 2011 19:56:47 +0000 Subject: Fixed bug 3317500, retested impacted ports. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3047 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/RVCT/ARMCMx/chcoreasm_v7m.s | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'os/ports/RVCT/ARMCMx/chcoreasm_v7m.s') diff --git a/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s b/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s index 6c7efeb3c..f6acf2968 100644 --- a/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s +++ b/os/ports/RVCT/ARMCMx/chcoreasm_v7m.s @@ -73,7 +73,10 @@ _port_thread_start PROC */ EXPORT _port_switch_from_isr _port_switch_from_isr PROC + bl chSchIsRescRequiredExI + cbz r0, noreschedule bl chSchDoRescheduleI +noreschedule #if CORTEX_SIMPLIFIED_PRIORITY mov r3, #SCB_ICSR :AND: 0xFFFF movt r3, #SCB_ICSR :SHR: 16 @@ -100,20 +103,16 @@ _port_irq_epilogue PROC mov r3, #SCB_ICSR :AND: 0xFFFF movt r3, #SCB_ICSR :SHR: 16 ldr r3, [r3, #0] - tst r3, #ICSR_RETTOBASE + ands r3, r3, #ICSR_RETTOBASE bne skipexit #if CORTEX_SIMPLIFIED_PRIORITY cpsie i #else - movs r3, #CORTEX_BASEPRI_DISABLED + /* Note, R3 is already zero.*/ msr BASEPRI, r3 #endif bx lr skipexit - push {r3, lr} - bl chSchIsRescRequiredExI - cmp r0, #0 - beq noreschedule mrs r3, PSP subs r3, r3, #EXTCTX_SIZE msr PSP, r3 @@ -121,15 +120,7 @@ skipexit str r2, [r3, #24] mov r2, #0x01000000 str r2, [r3, #28] - pop {r3, pc} -noreschedule -#if CORTEX_SIMPLIFIED_PRIORITY - cpsie i -#else - movs r3, #CORTEX_BASEPRI_DISABLED - msr BASEPRI, r3 -#endif - pop {r3, pc} + bx lr ENDP /* @@ -146,6 +137,7 @@ SVCallVector PROC movs r3, #CORTEX_BASEPRI_DISABLED msr BASEPRI, r3 bx lr + nop ENDP #endif -- cgit v1.2.3