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
master
gdisirio 2013-12-10 13:59:40 +00:00
parent 737ae06641
commit a0162be393
1 changed files with 21 additions and 18 deletions

View File

@ -99,24 +99,28 @@ _IVOR10:
lis %r3, 0x0800 /* DIS bit mask. */ lis %r3, 0x0800 /* DIS bit mask. */
mtspr 336, %r3 /* TSR register. */ 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 #if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_enter_isr bl dbg_check_enter_isr
bl dbg_check_lock_from_isr bl dbg_check_lock_from_isr
#endif #endif
/* System tick handler invocation.*/
bl chSysTimerHandlerI bl chSysTimerHandlerI
#if CH_DBG_SYSTEM_STATE_CHECK #if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_unlock_from_isr bl dbg_check_unlock_from_isr
bl dbg_check_leave_isr bl dbg_check_leave_isr
#endif #endif
/* System tick handler invocation.*/ #if PPC_USE_IRQ_PREEMPTION
#if CH_DBG_SYSTEM_STATE_CHECK /* Prevents preemption again.*/
bl dbg_check_lock wrteei 0
#endif #endif
bl chSchIsPreemptionRequired
cmpli cr0, %r3, 0 /* Jumps to the common IVOR epilogue code.*/
beq cr0, _ivor_exit
bl chSchDoReschedule
b _ivor_exit b _ivor_exit
#endif /* PPC_SUPPORTS_DECREMENTER */ #endif /* PPC_SUPPORTS_DECREMENTER */
@ -190,27 +194,26 @@ _IVOR4:
ori %r3, %r3, INTC_EOIR@l ori %r3, %r3, INTC_EOIR@l
stw %r3, 0(%r3) /* Writing any value should do. */ 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 #if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_lock bl dbg_check_lock
#endif #endif
bl chSchIsPreemptionRequired bl chSchIsPreemptionRequired
cmpli cr0, %r3, 0 cmpli cr0, %r3, 0
beq cr0, _ivor_exit beq cr0, .noresch
bl chSchDoReschedule bl chSchDoReschedule
.noresch:
/* Context restore.*/
.globl _ivor_exit
_ivor_exit:
#if CH_DBG_SYSTEM_STATE_CHECK #if CH_DBG_SYSTEM_STATE_CHECK
bl dbg_check_unlock bl dbg_check_unlock
#endif #endif
/* Decreasing the SPGR0 register.*/
mfspr %r0, 272
eaddi %r0, %r0, -1
mtspr 272, %r0
/* Restoring the external context.*/ /* Restoring the external context.*/
#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI #if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
e_lmvgprw 32(%sp) /* Restores GPR0, GPR3...GPR12. */ e_lmvgprw 32(%sp) /* Restores GPR0, GPR3...GPR12. */