From 1b49edf45586f529a2ac6bc3cf5b455009f2a89c Mon Sep 17 00:00:00 2001 From: rtel Date: Tue, 4 Feb 2014 14:49:48 +0000 Subject: [PATCH] Complete GCC/Cortex-A9 port. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2189 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- FreeRTOS/Source/portable/GCC/ARM_CA9/port.c | 16 +--------------- FreeRTOS/Source/portable/GCC/ARM_CA9/portASM.S | 15 +++++++-------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c b/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c index 023c269d3..c52b0bb66 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c +++ b/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c @@ -110,10 +110,6 @@ #error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 ) #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 #define configCLEAR_TICK_INTERRUPT() #endif @@ -134,8 +130,7 @@ context. */ #define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 ) /* Constants required to setup the initial task context. */ -#warning FIQ is disabled -#define portINITIAL_SPSR ( ( StackType_t ) 0x5f ) /* System mode, ARM mode, IRQ enabled FIQ disabled. 1f is required to enable FIQ. */ +#define portINITIAL_SPSR ( ( StackType_t ) 0x1f ) /* System mode, ARM mode, IRQ enabled FIQ enabled. */ #define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 ) #define portINTERRUPT_ENABLE_BIT ( 0x80UL ) #define portTHUMB_MODE_ADDRESS ( 0x01UL ) @@ -334,15 +329,6 @@ uint32_t ulAPSR; ulAPSR &= portAPSR_MODE_BITS_MASK; configASSERT( ulAPSR != portAPSR_USER_MODE ); - #if configINSTALL_FREERTOS_VECTOR_TABLE == 1 - { - extern void vPortInstallFreeRTOSVectorTable( void ); - - vPortInstallFreeRTOSVectorTable(); - } - #endif - - if( ulAPSR != portAPSR_USER_MODE ) { /* Only continue if the binary point value is set to its lowest possible diff --git a/FreeRTOS/Source/portable/GCC/ARM_CA9/portASM.S b/FreeRTOS/Source/portable/GCC/ARM_CA9/portASM.S index 844a3f18e..395566868 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CA9/portASM.S +++ b/FreeRTOS/Source/portable/GCC/ARM_CA9/portASM.S @@ -53,6 +53,7 @@ */ .text + .arm .set SYS_MODE, 0x1f .set SVC_MODE, 0x13 @@ -70,6 +71,7 @@ .extern vTaskSwitchContext .extern vApplicationIRQHandler .extern ulPortInterruptNesting + .extern ulPortTaskHasFPUContext .global FreeRTOS_IRQ_Handler .global FreeRTOS_SWI_Handler @@ -168,15 +170,20 @@ /****************************************************************************** * SVC handler is used to start the scheduler and yield a task. *****************************************************************************/ +.align 4 +.type FreeRTOS_SWI_Handler, %function FreeRTOS_SWI_Handler: /* Save the context of the current task and select a new task to run. */ portSAVE_CONTEXT LDR R0, vTaskSwitchContextConst BLX R0 +.type vPortRestoreTaskContext, %function vPortRestoreTaskContext: portRESTORE_CONTEXT +.align 4 +.type FreeRTOS_IRQ_Handler, %function FreeRTOS_IRQ_Handler: /* Return to the interrupted instruction. */ SUB lr, lr, #4 @@ -279,14 +286,6 @@ switch_before_exit: next. */ 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 ulICCEOIRConst: .word ulICCEOIR ulICCPMRConst: .word ulICCPMR -- 2.39.5