Add configCLEAR_TICK_INTERRUPT() to the IAR and RVDS Cortex-A9 ports.

Replace LDMFD with POP instructions in IAR and RVDS Cortex-A9 ports.
Replace branch to address with indirect branch and exchange to address in register in the IAR and RVDS Cortex-A9 ports.
This commit is contained in:
Richard Barry 2014-02-04 17:02:52 +00:00
parent 9a8da3ff38
commit d12ec14160
9 changed files with 27 additions and 10 deletions

View file

@ -113,6 +113,10 @@
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
#endif
#ifndef configCLEAR_TICK_INTERRUPT
#define configCLEAR_TICK_INTERRUPT()
#endif
/* A critical section is exited when the critical section nesting count reaches
this value. */
#define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
@ -131,7 +135,6 @@ context. */
/* Constants required to setup the initial task context. */
#define portINITIAL_SPSR ( ( StackType_t ) 0x1f ) /* System mode, ARM mode, interrupts enabled. */
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
#define portINTERRUPT_ENABLE_BIT ( 0x80UL )
#define portTHUMB_MODE_ADDRESS ( 0x01UL )
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
@ -354,6 +357,7 @@ void FreeRTOS_Tick_Handler( void )
/* Ensure all interrupt priorities are active again. */
portCLEAR_INTERRUPT_MASK();
configCLEAR_TICK_INTERRUPT();
}
/*-----------------------------------------------------------*/

View file

@ -113,7 +113,7 @@ portRESTORE_CONTEXT macro
CMP R1, #0
; Restore the floating point context, if any
LDMFDNE SP!, {R0}
POPNE {R0}
VPOPNE {D16-D31}
VPOPNE {D0-D15}
VMSRNE FPSCR, R0

View file

@ -130,7 +130,8 @@ FreeRTOS_IRQ_Handler
; Call the interrupt handler
PUSH {r0-r3, lr}
BL vApplicationIRQHandler
LDR r1, =vApplicationIRQHandler
BLX r1
POP {r0-r3, lr}
ADD sp, sp, r2
@ -184,7 +185,8 @@ switch_before_exit
; vTaskSwitchContext() if vTaskSwitchContext() uses LDRD or STRD
; instructions, or 8 byte aligned stack allocated data. LR does not need
; saving as a new LR will be loaded by portRESTORE_CONTEXT anyway.
BL vTaskSwitchContext
LDR r0, =vTaskSwitchContext
BLX r0
; Restore the context of, and branch to, the task selected to execute next.
portRESTORE_CONTEXT