Add logic to determine the tick timer source and vector installation into the PIC32MZ port assembly file to allow more efficient interrupt entry.

pull/4/head
Richard Barry 11 years ago
parent c3dd6f6593
commit 38ae9b76bc

@ -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. * Used to catch tasks that attempt to return from their implementing function.
*/ */

@ -65,26 +65,79 @@
#include <xc.h> #include <xc.h>
#include <sys/asm.h> #include <sys/asm.h>
#include "FreeRTOSConfig.h"
#include "ISR_Support.h" #include "ISR_Support.h"
.set nomips16 .extern pxCurrentTCB
.set noreorder .extern vTaskSwitchContext
.extern vPortIncrementTick
.extern pxCurrentTCB
.extern vTaskSwitchContext
.extern vPortIncrementTick
.extern xISRStackTop .extern xISRStackTop
.global vPortStartFirstTask .global vPortStartFirstTask
.global vPortYieldISR .global vPortYieldISR
.global vPortTickInterruptHandler .global vPortTickInterruptHandler
/******************************************************************/ /******************************************************************/
.set noreorder .set nomips16
.set noat .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 .ent vPortTickInterruptHandler
vPortTickInterruptHandler: vPortTickInterruptHandler:
@ -102,6 +155,7 @@ vPortTickInterruptHandler:
.set noreorder .set noreorder
.set noat .set noat
.section .text, code
.ent vPortStartFirstTask .ent vPortStartFirstTask
vPortStartFirstTask: vPortStartFirstTask:
@ -116,10 +170,19 @@ vPortStartFirstTask:
/*******************************************************************/ /*******************************************************************/
.set noreorder .set nomips16
.set noat .set nomicromips
.ent vPortYieldISR .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: vPortYieldISR:
/* Make room for the context. First save the current status so it can be /* Make room for the context. First save the current status so it can be

Loading…
Cancel
Save