aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-12-10 13:59:40 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-12-10 13:59:40 +0000
commita0162be393ed95c60baf59b773e6649673972e4d (patch)
treea3d7d87b06e4bb079a3cbffe5b3eca3c137a624b /os
parent737ae066414de5c640db950ec049b1a04ba33daa (diff)
downloadChibiOS-a0162be393ed95c60baf59b773e6649673972e4d.tar.gz
ChibiOS-a0162be393ed95c60baf59b773e6649673972e4d.tar.bz2
ChibiOS-a0162be393ed95c60baf59b773e6649673972e4d.zip
Improved IRQ handling for e200 cores.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6567 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/rt/ports/e200/compilers/GCC/ivor.s39
1 files changed, 21 insertions, 18 deletions
diff --git a/os/rt/ports/e200/compilers/GCC/ivor.s b/os/rt/ports/e200/compilers/GCC/ivor.s
index f26917252..ae478b49f 100644
--- a/os/rt/ports/e200/compilers/GCC/ivor.s
+++ b/os/rt/ports/e200/compilers/GCC/ivor.s
@@ -99,24 +99,28 @@ _IVOR10:
lis %r3, 0x0800 /* DIS bit mask. */
mtspr 336, %r3 /* TSR register. */
+#if PPC_USE_IRQ_PREEMPTION
+ /* Allows preemption while executing the software handler.*/
+ wrteei 1
+#endif
+
#if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_enter_isr
bl dbg_check_lock_from_isr
#endif
+ /* System tick handler invocation.*/
bl chSysTimerHandlerI
#if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_unlock_from_isr
bl dbg_check_leave_isr
#endif
- /* System tick handler invocation.*/
-#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_lock
+#if PPC_USE_IRQ_PREEMPTION
+ /* Prevents preemption again.*/
+ wrteei 0
#endif
- bl chSchIsPreemptionRequired
- cmpli cr0, %r3, 0
- beq cr0, _ivor_exit
- bl chSchDoReschedule
+
+ /* Jumps to the common IVOR epilogue code.*/
b _ivor_exit
#endif /* PPC_SUPPORTS_DECREMENTER */
@@ -190,27 +194,26 @@ _IVOR4:
ori %r3, %r3, INTC_EOIR@l
stw %r3, 0(%r3) /* Writing any value should do. */
- /* Verifies if a reschedule is required.*/
+ /* Common IVOR epilogue code, context restore.*/
+ .globl _ivor_exit
+_ivor_exit:
+ /* Decreasing the SPGR0 register.*/
+ mfspr %r0, 272
+ eaddi %r0, %r0, -1
+ mtspr 272, %r0
+
#if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_lock
#endif
bl chSchIsPreemptionRequired
cmpli cr0, %r3, 0
- beq cr0, _ivor_exit
+ beq cr0, .noresch
bl chSchDoReschedule
-
- /* Context restore.*/
- .globl _ivor_exit
-_ivor_exit:
+.noresch:
#if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_unlock
#endif
- /* Decreasing the SPGR0 register.*/
- mfspr %r0, 272
- eaddi %r0, %r0, -1
- mtspr 272, %r0
-
/* Restoring the external context.*/
#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
e_lmvgprw 32(%sp) /* Restores GPR0, GPR3...GPR12. */