2 * FreeRTOS Kernel <DEVELOPMENT BRANCH>
3 * license and copyright intentionally withheld to promote copying into user code.
9 BaseType_t xPortStartScheduler( void )
14 void vPortEndScheduler( void )
18 StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
19 TaskFunction_t pxCode,
25 void vPortYield( void )
27 /* Save the current Context */
29 /* Switch to the highest priority task that is ready to run. */
30 #if ( configNUMBER_OF_CORES == 1 )
36 vTaskSwitchContext( portGET_CORE_ID() );
40 /* Start executing the task we have just switched to. */
43 static void prvTickISR( void )
45 /* Interrupts must have been enabled for the ISR to fire, so we have to
46 * save the context with interrupts enabled. */
48 #if ( configNUMBER_OF_CORES == 1 )
50 /* Maintain the tick count. */
51 if( xTaskIncrementTick() != pdFALSE )
53 /* Switch to the highest priority task that is ready to run. */
59 UBaseType_t ulPreviousMask;
61 /* Tasks or ISRs running on other cores may still in critical section in
62 * multiple cores environment. Incrementing tick needs to performed in
63 * critical section. */
64 ulPreviousMask = taskENTER_CRITICAL_FROM_ISR();
66 /* Maintain the tick count. */
67 if( xTaskIncrementTick() != pdFALSE )
69 /* Switch to the highest priority task that is ready to run. */
70 vTaskSwitchContext( portGET_CORE_ID() );
73 taskEXIT_CRITICAL_FROM_ISR( ulPreviousMask );
75 #endif /* if ( configNUMBER_OF_CORES == 1 ) */
77 /* start executing the new task */