From: rtel Date: Tue, 18 Feb 2014 10:10:32 +0000 (+0000) Subject: Add logic to determine the tick timer source and vector installation into the PIC32MZ... X-Git-Tag: V8.0.0~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9998b177ccf412a6949be19f027dd91db9b2f6b6;p=freertos Add logic to determine the tick timer source and vector installation into the PIC32MZ port assembly file to allow more efficient interrupt entry. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2215 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c index 1bf713e6b..57b7bb46b 100644 --- a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c +++ b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c @@ -159,22 +159,6 @@ task stack, not the ISR stack). */ /*-----------------------------------------------------------*/ -/* - * Place the prototype here to ensure the interrupt vector is correctly installed. - * Note that because the interrupt is written in assembly, the IPL setting in the - * following line of code has no effect. The interrupt priority is set by the - * call to ConfigIntTimer1() in vApplicationSetupTickTimerInterrupt(). - */ -extern void __attribute__( (interrupt(ipl1), vector( configTICK_INTERRUPT_VECTOR ))) vPortTickInterruptHandler( void ); - -/* - * The software interrupt handler that performs the yield. Note that, because - * the interrupt is written in assembly, the IPL setting in the following line of - * code has no effect. The interrupt priority is set by the call to - * mConfigIntCoreSW0() in xPortStartScheduler(). - */ -void __attribute__( (interrupt(ipl1), vector(_CORE_SOFTWARE_0_VECTOR))) vPortYieldISR( void ); - /* * Used to catch tasks that attempt to return from their implementing function. */ diff --git a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port_asm.S b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port_asm.S index 3114cb5e2..bad1f83f1 100644 --- a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port_asm.S +++ b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port_asm.S @@ -65,26 +65,79 @@ #include #include +#include "FreeRTOSConfig.h" #include "ISR_Support.h" - .set nomips16 - .set noreorder - - .extern pxCurrentTCB - .extern vTaskSwitchContext - .extern vPortIncrementTick + .extern pxCurrentTCB + .extern vTaskSwitchContext + .extern vPortIncrementTick .extern xISRStackTop - .global vPortStartFirstTask + .global vPortStartFirstTask .global vPortYieldISR .global vPortTickInterruptHandler /******************************************************************/ - .set noreorder - .set noat + .set nomips16 + .set nomicromips + .set noreorder + .set noat + + /*************************************************************** + * The following is needed to locate the + * vPortTickInterruptHandler function into the correct vector + ***************************************************************/ + #ifdef configTICK_INTERRUPT_VECTOR + #if (configTICK_INTERRUPT_VECTOR == _CORE_TIMER_VECTOR) + .equ __vector_dispatch_0, vPortTickInterruptHandler + .global __vector_dispatch_0 + .section .vector_0, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_1_VECTOR) + .equ __vector_dispatch_4, vPortTickInterruptHandler + .global __vector_dispatch_4 + .section .vector_4, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_2_VECTOR) + .equ __vector_dispatch_9, vPortTickInterruptHandler + .global __vector_dispatch_9 + .section .vector_9, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_3_VECTOR) + .equ __vector_dispatch_14, vPortTickInterruptHandler + .global __vector_dispatch_14 + .section .vector_14, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_4_VECTOR) + .equ __vector_dispatch_19, vPortTickInterruptHandler + .global __vector_dispatch_19 + .section .vector_19, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_5_VECTOR) + .equ __vector_dispatch_24, vPortTickInterruptHandler + .global __vector_dispatch_24 + .section .vector_24, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_6_VECTOR) + .equ __vector_dispatch_28, vPortTickInterruptHandler + .global __vector_dispatch_28 + .section .vector_28, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_7_VECTOR) + .equ __vector_dispatch_32, vPortTickInterruptHandler + .global __vector_dispatch_32 + .section .vector_32, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_8_VECTOR) + .equ __vector_dispatch_36, vPortTickInterruptHandler + .global __vector_dispatch_36 + .section .vector_36, code, keep + #elif (configTICK_INTERRUPT_VECTOR == _TIMER_9_VECTOR) + .equ __vector_dispatch_40, vPortTickInterruptHandler + .global __vector_dispatch_40 + .section .vector_40, code, keep + #endif + #else + .equ __vector_dispatch_4, vPortTickInterruptHandler + .global __vector_dispatch_4 + .section .vector_4, code, keep + #endif + .ent vPortTickInterruptHandler vPortTickInterruptHandler: @@ -102,6 +155,7 @@ vPortTickInterruptHandler: .set noreorder .set noat + .section .text, code .ent vPortStartFirstTask vPortStartFirstTask: @@ -116,10 +170,19 @@ vPortStartFirstTask: /*******************************************************************/ - .set noreorder - .set noat - .ent vPortYieldISR - + .set nomips16 + .set nomicromips + .set noreorder + .set noat + /*************************************************************** + * The following is needed to locate the vPortYieldISR function + * into the correct vector + ***************************************************************/ + .equ __vector_dispatch_1, vPortYieldISR + .global __vector_dispatch_1 + .section .vector_1, code + + .ent vPortYieldISR vPortYieldISR: /* Make room for the context. First save the current status so it can be