/* * RTOS tick interrupt service routine. If the cooperative scheduler is * being used then this simply increments the tick count. If the * preemptive scheduler is being used a context switch can occur. */ void interrupt vPortTickInterrupt( void ) { #if configUSE_PREEMPTION == 1 { /* A context switch might happen so save the context. */ portSAVE_CONTEXT(); /* Increment the tick ... */ vTaskIncrementTick(); /* ... then see if the new tick value has necessitated a context switch. */ vTaskSwitchContext(); TFLG1 = 1; /* Restore the context of a task - which may be a different task to that interrupted. */ portRESTORE_CONTEXT(); } #else { vTaskIncrementTick(); TFLG1 = 1; } #endif }
void prvTickISR( void ) { /* Increment the tick, and perform any processing the new tick value necessitates. */ set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY ); { vTaskIncrementTick(); } set_ipl( configKERNEL_INTERRUPT_PRIORITY ); /* Only select a new task if the preemptive scheduler is being used. */ #if( configUSE_PREEMPTION == 1 ) { taskYIELD(); } #endif #if configUSE_TICKLESS_IDLE == 1 { /* The CPU woke because of a tick. */ ulTickFlag = pdTRUE; /* If this is the first tick since exiting tickless mode then the CMT compare match value needs resetting. */ CMT0.CMCOR = ( unsigned short ) ulMatchValueForOneTick; } #endif }
/* * Handler for the timer interrupt. This is the handler that the application * defined callback function vApplicationSetupTimerInterrupt() should install. */ void vPortTickISR( void *pvUnused ) { extern void vApplicationClearTimerInterrupt( void ); /* Ensure the unused parameter does not generate a compiler warning. */ ( void ) pvUnused; /* This port uses an application defined callback function to clear the tick interrupt because the kernel will run on lots of different MicroBlaze and FPGA configurations - not all of which will have the same timer peripherals defined or available. An example definition of vApplicationClearTimerInterrupt() is provided in the official demo application that accompanies this port. */ vApplicationClearTimerInterrupt(); /* Increment the RTOS tick - this might cause a task to unblock. */ vTaskIncrementTick(); /* If the preemptive scheduler is being used then a context switch should be requested in case incrementing the tick unblocked a task, or a time slice should cause another task to enter the Running state. */ #if configUSE_PREEMPTION == 1 /* Force vTaskSwitchContext() to be called as the interrupt exits. */ ulTaskSwitchRequested = 1; #endif }
/* * Tick ISR for preemptive scheduler. We can use a naked attribute as * the context is saved at the start of vPortYieldFromTick(). The tick * count is incremented after the context is saved. */ void ISROsTick( void ) { /* Increment the tick count then switch to the highest priority task that is ready to run. */ vTaskIncrementTick(); vTaskSwitchContext(); }
static void __interrupt __far prvNonPreemptiveTick( void ) { /* Same as preemptive tick, but the cooperative scheduler is being used so we don't have to switch in the context of the next task. */ vTaskIncrementTick(); prvPortResetPIC(); }
void xPortSysTickHandler( void ) { /* If using preemption, also force a context switch. */ #if configUSE_PREEMPTION == 1 portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; #endif /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to 1. If it is set to 0 tickless idle is not being used. If it is set to a value other than 0 or 1 then a timer other than the SysTick is being used to generate the tick interrupt. */ #if configUSE_TICKLESS_IDLE == 1 portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick; #endif ( void ) portSET_INTERRUPT_MASK_FROM_ISR(); { vTaskIncrementTick(); // wrzucam tutaj obsluge licznika dla HAL HAL_IncTick(); } portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 ); }
static void __interrupt __far prvNonPreemptiveTick( void ) { /* Same as preemptive tick, but the cooperative scheduler is being used so we don't have to switch in the context of the next task. */ vTaskIncrementTick(); /* Reset interrupt. */ outport( portEIO_REGISTER, portCLEAR_INTERRUPT ); }
void vPortNonPreemptiveTick( void ) { vTaskIncrementTick(); /* Clear the interrupt in the watchdog and EIC. */ WDG->SR = 0x0000; /* clear current interrupt pending flag for interupt source. */ EIC->IPR |= 1 << EIC_CurrentIRQChannelValue(); }
void vPortYieldFromTick( void ) { portSAVE_CONTEXT(); vTaskIncrementTick(); vTaskSwitchContext(); portRESTORE_CONTEXT(); asm volatile ( "ret" ); }
/* The cooperative scheduler requires a normal IRQ service routine to * simply increment the system tick. */ __interrupt void vPortNonPreemptiveTick( void ) { /* clear clock interrupt flag */ RTI->INTFLAG = 0x00000001; /* Increment the tick count - this may make a delaying task ready to run - but a context switch is not performed. */ vTaskIncrementTick(); }
/* * This is the TICK interrupt service routine, note. no SAVE/RESTORE_CONTEXT here * as thats done in the bottom-half of the ISR. * * See bt_interrupts.c in the RaspberryPi Drivers folder. */ void vTickISR (unsigned int nIRQ, void *pParam) { vTaskIncrementTick(); #if configUSE_PREEMPTION == 1 vTaskSwitchContext(); #endif pRegs->CLI = 0; // Acknowledge the timer interrupt. }
/* * The ISR used for the scheduler tick depends on whether the cooperative or * the preemptive scheduler is being used. */ static void prvPortPreemptiveTick ( void ) { /* The cooperative scheduler requires a normal IRQ service routine to * simply increment the system tick. */ vTaskIncrementTick( ); MCF_PIT_PCSR0 |= MCF_PIT_PCSR_PIF; }
static void __interrupt __far prvPreemptiveTick( void ) { /* Get the scheduler to update the task states following the tick. */ vTaskIncrementTick(); /* Switch in the context of the next task to be run. */ portSWITCH_CONTEXT(); /* Reset interrupt. */ outport( portEIO_REGISTER, portCLEAR_INTERRUPT ); }
/* The cooperative scheduler requires a normal IRQ service routine to simply increment the system tick. */ __arm __irq void vPortNonPreemptiveTick( void ) { /* Increment the tick count - which may wake some tasks but as the preemptive scheduler is not being used any woken task is not given processor time no matter what its priority. */ vTaskIncrementTick(); /* Clear the interrupt in the watchdog and EIC. */ WDG->SR = 0x0000; portCLEAR_EIC(); }
void __attribute__((__interrupt__, auto_psv)) _T1Interrupt( void ) { /* Clear the timer interrupt. */ IFS0bits.T1IF = 0; vTaskIncrementTick(); #if configUSE_PREEMPTION == 1 portYIELD(); #endif }
static void __interrupt __far prvPreemptiveTick( void ) { /* Get the scheduler to update the task states following the tick. */ vTaskIncrementTick(); /* Switch in the context of the next task to be run. */ portSWITCH_CONTEXT(); /* Reset the PIC ready for the next time. */ prvPortResetPIC(); }
static __arm __irq void vPortNonPreemptiveTick( void ) { /* Increment the tick count - which may wake some tasks but as the preemptive scheduler is not being used any woken task is not given processor time no matter what its priority. */ vTaskIncrementTick(); /* Ready for the next interrupt. */ T0IR = portTIMER_MATCH_ISR_BIT; VICVectAddr = portCLEAR_VIC_INTERRUPT; }
static void prvProcessTick( void ) { vTaskIncrementTick(); #if configUSE_PREEMPTION == 1 vTaskSwitchContext(); #endif /* Clear the Tick Interrupt. */ counter1->expired = 0; }
void RT_VECT (void) { // For the preemptive scheduler, enable a context switch #if configUSE_PREEMPTION == 1 vPortYieldFromTick (); asm volatile ( "reti" ); #else // For the cooperative scheduler, all this does is increment the tick count. // We don't need to switch context; that's done by manual calls to taskYIELD() vTaskIncrementTick (); #endif }
/* * The ISR used for the scheduler tick. */ void vTickISR( XScuTimer *Timer ) { /* Increment the RTOS tick count, then look for the highest priority task that is ready to run. */ vTaskIncrementTick(); #if configUSE_PREEMPTION == 1 vTaskSwitchContext(); #endif XScuTimer_ClearInterruptStatus(Timer); }
interrupt (TIMERA0_VECTOR) prvTickISR( void ) { /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); /* Increment the tick count then switch to the highest priority task that is ready to run. */ vTaskIncrementTick(); vTaskSwitchContext(); /* Restore the context of the new task. */ portRESTORE_CONTEXT(); }
ISR (TCC0_OVF_vect, ISR_NAKED) { /* * Context switch function used by the tick. This must be identical to * vPortYield() from the call to vTaskSwitchContext() onwards. The only * difference from vPortYield() is the tick count is incremented as the * call comes from the tick ISR. */ portSAVE_CONTEXT(); vTaskIncrementTick(); vTaskSwitchContext(); portRESTORE_CONTEXT(); asm volatile ( "reti" ); }
static void prvPortPreemptiveTick( void ) { asm volatile ( "move.w #0x2700, %sr\n\t" ); #if _GCC_USES_FP == 1 asm volatile ( "unlk %fp\n\t" ); #endif portSAVE_CONTEXT( ); MCF_PIT_PCSR0 |= MCF_PIT_PCSR_PIF; vTaskIncrementTick( ); vTaskSwitchContext( ); portRESTORE_CONTEXT( ); }
/*-----------------------------------------------------------*/ void SysTick_Handler( void ) /* ATMEL */ { /* If using preemption, also force a context switch. */ #if configUSE_PREEMPTION == 1 portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; #endif (void)portSET_INTERRUPT_MASK_FROM_ISR(); { vTaskIncrementTick(); } portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 ); }
static void prvTimerInterrupt(unsigned int intrLevel, void *pContext) { Timer_t *pISRTimer = (Timer_t *)pContext; #if configUSE_PREEMPTION == 1 /* * Tick ISR for preemptive scheduler. */ vTaskIncrementTick(); vTaskSwitchContext(); #else /* * Tick ISR for the cooperative scheduler. All this does is increment the * tick count. We don't need to switch context, this can only be done by * manual calls to taskYIELD(); */ vTaskIncrementTick(); #endif /* Clear Timer Status */ pISRTimer->Status = 0; }
void vPortSysTickHandler( void * context, alt_u32 id ) { /* Increment the Kernel Tick. */ vTaskIncrementTick(); /* If using preemption, also force a context switch. */ #if configUSE_PREEMPTION == 1 vTaskSwitchContext(); #endif /* Clear the interrupt. */ IOWR_ALTERA_AVALON_TIMER_STATUS( SYS_CLK_BASE, ~ALTERA_AVALON_TIMER_STATUS_TO_MSK ); }
void vPortPreemptiveTick( void ) { /* Increment the tick counter. */ vTaskIncrementTick(); /* The new tick value might unblock a task. Ensure the highest task that is ready to execute is the task that will execute when the tick ISR exits. */ vTaskSwitchContext(); /* Ready for the next interrupt. */ T0IR = portTIMER_MATCH_ISR_BIT; VICVectAddr = portCLEAR_VIC_INTERRUPT; }
void xPortSysTickHandler( void ) { unsigned long ulDummy; /* If using preemption, also force a context switch. */ #if configUSE_PREEMPTION == 1 *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET; #endif ulDummy = portSET_INTERRUPT_MASK_FROM_ISR(); { vTaskIncrementTick(); } portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy ); }
/* This function is called from an asm wrapper, so does not require the __irq keyword. */ void vPortPreemptiveTick( void ) { /* Increment the tick counter. */ vTaskIncrementTick(); /* The new tick value might unblock a task. Ensure the highest task that is ready to execute is the task that will execute when the tick ISR exits. */ vTaskSwitchContext(); /* Clear the interrupt in the watchdog and EIC. */ WDG->SR = 0x0000; portCLEAR_EIC(); }
__arm void vPortPreemptiveTick( void ) { /* Increment the tick counter. */ vTaskIncrementTick(); /* The new tick value might unblock a task. Ensure the highest task that is ready to execute is the task that will execute when the tick ISR exits. */ #if configUSE_PREEMPTION == 1 vTaskSwitchContext(); #endif TB_ClearITPendingBit( TB_IT_Update ); }