mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-24 15:31:56 -04:00
* Fix small bugs * Cast sizeof to BaseType_t * Test removing assert to fix UT * Revert change to tasks.c Since configIDLE_TASK_NAME must be defined as a string according to the documentation, the macro will always be NULL terminated. Which means that the check `if( cIdleName[ xIdleTaskNameIndex ] == ( char ) 0x00 )` will catch the end of string. * Update coverity config; Add coverity version; Update pvPortMalloc declaration to match the definitions. * Add port files to sed command * Remove warnings about unused parameters in port code --------- Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
83 lines
2 KiB
C
83 lines
2 KiB
C
/*
|
|
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
|
|
* license and copyright intentionally withheld to promote copying into user code.
|
|
*/
|
|
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
|
|
BaseType_t xPortStartScheduler( void )
|
|
{
|
|
return pdTRUE;
|
|
}
|
|
|
|
void vPortEndScheduler( void )
|
|
{
|
|
}
|
|
|
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|
TaskFunction_t pxCode,
|
|
void * pvParameters )
|
|
{
|
|
( void ) pxTopOfStack;
|
|
( void ) pvParameters;
|
|
( void ) * pxCode;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
void vPortYield( void )
|
|
{
|
|
/* Save the current Context */
|
|
|
|
/* Switch to the highest priority task that is ready to run. */
|
|
#if ( configNUMBER_OF_CORES == 1 )
|
|
{
|
|
vTaskSwitchContext();
|
|
}
|
|
#else
|
|
{
|
|
vTaskSwitchContext( portGET_CORE_ID() );
|
|
}
|
|
#endif
|
|
|
|
/* Start executing the task we have just switched to. */
|
|
}
|
|
|
|
static void prvTickISR( void )
|
|
{
|
|
/* Interrupts must have been enabled for the ISR to fire, so we have to
|
|
* save the context with interrupts enabled. */
|
|
|
|
#if ( configNUMBER_OF_CORES == 1 )
|
|
{
|
|
/* Maintain the tick count. */
|
|
if( xTaskIncrementTick() != pdFALSE )
|
|
{
|
|
/* Switch to the highest priority task that is ready to run. */
|
|
vTaskSwitchContext();
|
|
}
|
|
}
|
|
#else
|
|
{
|
|
UBaseType_t ulPreviousMask;
|
|
|
|
/* Tasks or ISRs running on other cores may still in critical section in
|
|
* multiple cores environment. Incrementing tick needs to performed in
|
|
* critical section. */
|
|
ulPreviousMask = taskENTER_CRITICAL_FROM_ISR();
|
|
|
|
/* Maintain the tick count. */
|
|
if( xTaskIncrementTick() != pdFALSE )
|
|
{
|
|
/* Switch to the highest priority task that is ready to run. */
|
|
vTaskSwitchContext( portGET_CORE_ID() );
|
|
}
|
|
|
|
taskEXIT_CRITICAL_FROM_ISR( ulPreviousMask );
|
|
}
|
|
#endif /* if ( configNUMBER_OF_CORES == 1 ) */
|
|
|
|
/* start executing the new task */
|
|
}
|