Complete GCC/Cortex-A9 port.

pull/4/head
Richard Barry 11 years ago
parent c83414ccc4
commit f843888e60

@ -110,10 +110,6 @@
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 ) #error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
#endif #endif
#ifndef configINSTALL_FREERTOS_VECTOR_TABLE
#warning configINSTALL_FREERTOS_VECTOR_TABLE was undefined. Defaulting configINSTALL_FREERTOS_VECTOR_TABLE to 0.
#endif
#ifndef configCLEAR_TICK_INTERRUPT #ifndef configCLEAR_TICK_INTERRUPT
#define configCLEAR_TICK_INTERRUPT() #define configCLEAR_TICK_INTERRUPT()
#endif #endif
@ -134,8 +130,7 @@ context. */
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 ) #define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
/* Constants required to setup the initial task context. */ /* Constants required to setup the initial task context. */
#warning FIQ is disabled #define portINITIAL_SPSR ( ( StackType_t ) 0x1f ) /* System mode, ARM mode, IRQ enabled FIQ enabled. */
#define portINITIAL_SPSR ( ( StackType_t ) 0x5f ) /* System mode, ARM mode, IRQ enabled FIQ disabled. 1f is required to enable FIQ. */
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 ) #define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
#define portINTERRUPT_ENABLE_BIT ( 0x80UL ) #define portINTERRUPT_ENABLE_BIT ( 0x80UL )
#define portTHUMB_MODE_ADDRESS ( 0x01UL ) #define portTHUMB_MODE_ADDRESS ( 0x01UL )
@ -334,15 +329,6 @@ uint32_t ulAPSR;
ulAPSR &= portAPSR_MODE_BITS_MASK; ulAPSR &= portAPSR_MODE_BITS_MASK;
configASSERT( ulAPSR != portAPSR_USER_MODE ); configASSERT( ulAPSR != portAPSR_USER_MODE );
#if configINSTALL_FREERTOS_VECTOR_TABLE == 1
{
extern void vPortInstallFreeRTOSVectorTable( void );
vPortInstallFreeRTOSVectorTable();
}
#endif
if( ulAPSR != portAPSR_USER_MODE ) if( ulAPSR != portAPSR_USER_MODE )
{ {
/* Only continue if the binary point value is set to its lowest possible /* Only continue if the binary point value is set to its lowest possible

@ -53,6 +53,7 @@
*/ */
.text .text
.arm
.set SYS_MODE, 0x1f .set SYS_MODE, 0x1f
.set SVC_MODE, 0x13 .set SVC_MODE, 0x13
@ -70,6 +71,7 @@
.extern vTaskSwitchContext .extern vTaskSwitchContext
.extern vApplicationIRQHandler .extern vApplicationIRQHandler
.extern ulPortInterruptNesting .extern ulPortInterruptNesting
.extern ulPortTaskHasFPUContext
.global FreeRTOS_IRQ_Handler .global FreeRTOS_IRQ_Handler
.global FreeRTOS_SWI_Handler .global FreeRTOS_SWI_Handler
@ -168,15 +170,20 @@
/****************************************************************************** /******************************************************************************
* SVC handler is used to start the scheduler and yield a task. * SVC handler is used to start the scheduler and yield a task.
*****************************************************************************/ *****************************************************************************/
.align 4
.type FreeRTOS_SWI_Handler, %function
FreeRTOS_SWI_Handler: FreeRTOS_SWI_Handler:
/* Save the context of the current task and select a new task to run. */ /* Save the context of the current task and select a new task to run. */
portSAVE_CONTEXT portSAVE_CONTEXT
LDR R0, vTaskSwitchContextConst LDR R0, vTaskSwitchContextConst
BLX R0 BLX R0
.type vPortRestoreTaskContext, %function
vPortRestoreTaskContext: vPortRestoreTaskContext:
portRESTORE_CONTEXT portRESTORE_CONTEXT
.align 4
.type FreeRTOS_IRQ_Handler, %function
FreeRTOS_IRQ_Handler: FreeRTOS_IRQ_Handler:
/* Return to the interrupted instruction. */ /* Return to the interrupted instruction. */
SUB lr, lr, #4 SUB lr, lr, #4
@ -279,14 +286,6 @@ switch_before_exit:
next. */ next. */
portRESTORE_CONTEXT portRESTORE_CONTEXT
vPortInstallFreeRTOSVectorTable:
/* Set VBAR to the vector table that contains the FreeRTOS handlers. */
ldr r0, =_freertos_vector_table
mcr p15, 0, r0, c12, c0, 0
dsb
isb
bx lr
ulICCIARConst: .word ulICCIAR ulICCIARConst: .word ulICCIAR
ulICCEOIRConst: .word ulICCEOIR ulICCEOIRConst: .word ulICCEOIR
ulICCPMRConst: .word ulICCPMR ulICCPMRConst: .word ulICCPMR

Loading…
Cancel
Save