mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-05-12 11:42:57 -04:00
Compare commits
10 commits
7d6890e650
...
5282247346
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5282247346 | ||
|
|
8a416d79c0 | ||
|
|
d5c3c98ae4 | ||
|
|
c53a6b0547 | ||
|
|
1dbc77697f | ||
|
|
26f9a2fdd3 | ||
|
|
14b30f209f | ||
|
|
3ace38969b | ||
|
|
a9cb459206 | ||
|
|
536914b2a4 |
8 changed files with 86 additions and 11 deletions
1
.github/.cSpellWords.txt
vendored
1
.github/.cSpellWords.txt
vendored
|
|
@ -29,6 +29,7 @@ APIC
|
||||||
APROCFREQ
|
APROCFREQ
|
||||||
APSR
|
APSR
|
||||||
ARMCM
|
ARMCM
|
||||||
|
ARMEB
|
||||||
Armv
|
Armv
|
||||||
ARMVFP
|
ARMVFP
|
||||||
ASTRINGZ
|
ASTRINGZ
|
||||||
|
|
|
||||||
|
|
@ -602,12 +602,12 @@ typedef enum
|
||||||
* \defgroup xTaskCreateRestricted xTaskCreateRestricted
|
* \defgroup xTaskCreateRestricted xTaskCreateRestricted
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||||
BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
|
BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
|
||||||
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
|
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
|
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
|
||||||
BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
|
BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
|
||||||
UBaseType_t uxCoreAffinityMask,
|
UBaseType_t uxCoreAffinityMask,
|
||||||
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
|
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
|
||||||
|
|
@ -897,7 +897,8 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
|
||||||
*
|
*
|
||||||
* @return Value which can be used to check whether the task was actually delayed.
|
* @return Value which can be used to check whether the task was actually delayed.
|
||||||
* Will be pdTRUE if the task way delayed and pdFALSE otherwise. A task will not
|
* Will be pdTRUE if the task way delayed and pdFALSE otherwise. A task will not
|
||||||
* be delayed if the next expected wake time is in the past.
|
* be delayed if the next expected wake time is in the past. This prevents periodic
|
||||||
|
* tasks from accumulating delays and allows them to resume their regular timing pattern.
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
* @code{c}
|
* @code{c}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,11 @@
|
||||||
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
|
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
|
||||||
|
|
||||||
/* Constants required to setup the initial task context. */
|
/* Constants required to setup the initial task context. */
|
||||||
#define portINITIAL_SPSR ( ( StackType_t ) 0x1f ) /* System mode, ARM mode, IRQ enabled FIQ enabled. */
|
#ifdef __ARMEB__
|
||||||
|
#define portINITIAL_SPSR ( ( StackType_t ) 0x21f ) /* System mode, ARM mode, IRQ enabled FIQ enabled, Big-endian. */
|
||||||
|
#else
|
||||||
|
#define portINITIAL_SPSR ( ( StackType_t ) 0x01f ) /* System mode, ARM mode, IRQ enabled FIQ enabled, Little-endian. */
|
||||||
|
#endif
|
||||||
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
|
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
|
||||||
#define portTHUMB_MODE_ADDRESS ( 0x01UL )
|
#define portTHUMB_MODE_ADDRESS ( 0x01UL )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,37 @@
|
||||||
EXTERN _pxCurrentTCB
|
EXTERN _pxCurrentTCB
|
||||||
EXTERN _vTaskSwitchContext
|
EXTERN _vTaskSwitchContext
|
||||||
|
|
||||||
|
CFI Names cfiNames0
|
||||||
|
CFI StackFrame CFA SP DATA
|
||||||
|
CFI VirtualResource ?RET:32
|
||||||
|
CFI Resource R1:32, R2:32, R3:32, R4:32, R5:32, R6:32, R7:32, R8:32
|
||||||
|
CFI Resource R9:32, R10:32, R11:32, R12:32, R13:32, R14:32, R15:32
|
||||||
|
CFI Resource SP:32
|
||||||
|
CFI EndNames cfiNames0
|
||||||
|
|
||||||
|
CFI Common cfiCommon0 Using cfiNames0
|
||||||
|
CFI CodeAlign 1
|
||||||
|
CFI DataAlign 1
|
||||||
|
CFI ReturnAddress ?RET CODE
|
||||||
|
CFI CFA SP+4
|
||||||
|
CFI ?RET Frame(CFA, -4)
|
||||||
|
CFI R1 Undefined
|
||||||
|
CFI R2 Undefined
|
||||||
|
CFI R3 Undefined
|
||||||
|
CFI R4 Undefined
|
||||||
|
CFI R5 Undefined
|
||||||
|
CFI R6 SameValue
|
||||||
|
CFI R7 SameValue
|
||||||
|
CFI R8 SameValue
|
||||||
|
CFI R9 SameValue
|
||||||
|
CFI R10 SameValue
|
||||||
|
CFI R11 SameValue
|
||||||
|
CFI R12 SameValue
|
||||||
|
CFI R13 SameValue
|
||||||
|
CFI R14 Undefined
|
||||||
|
CFI R15 Undefined
|
||||||
|
CFI EndCommon cfiCommon0
|
||||||
|
|
||||||
RSEG CODE:CODE(4)
|
RSEG CODE:CODE(4)
|
||||||
|
|
||||||
_prvStartFirstTask:
|
_prvStartFirstTask:
|
||||||
|
|
@ -91,6 +122,9 @@ _prvStartFirstTask:
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* The software interrupt - overwrite the default 'weak' definition. */
|
/* The software interrupt - overwrite the default 'weak' definition. */
|
||||||
|
CFI Block cfiBlock0 Using cfiCommon0
|
||||||
|
CFI Function ___interrupt_27
|
||||||
|
CODE
|
||||||
___interrupt_27:
|
___interrupt_27:
|
||||||
|
|
||||||
/* Re-enable interrupts. */
|
/* Re-enable interrupts. */
|
||||||
|
|
@ -151,6 +185,24 @@ ___interrupt_27:
|
||||||
MVTIPL #configMAX_SYSCALL_INTERRUPT_PRIORITY
|
MVTIPL #configMAX_SYSCALL_INTERRUPT_PRIORITY
|
||||||
|
|
||||||
/* Select the next task to run. */
|
/* Select the next task to run. */
|
||||||
|
CFI ?RET Frame(CFA, -8)
|
||||||
|
CFI R15 Frame(CFA, -12)
|
||||||
|
CFI R14 Frame(CFA, -16)
|
||||||
|
CFI R13 Frame(CFA, -20)
|
||||||
|
CFI R12 Frame(CFA, -24)
|
||||||
|
CFI R11 Frame(CFA, -28)
|
||||||
|
CFI R10 Frame(CFA, -32)
|
||||||
|
CFI R9 Frame(CFA, -36)
|
||||||
|
CFI R8 Frame(CFA, -40)
|
||||||
|
CFI R7 Frame(CFA, -44)
|
||||||
|
CFI R6 Frame(CFA, -48)
|
||||||
|
CFI R5 Frame(CFA, -52)
|
||||||
|
CFI R4 Frame(CFA, -56)
|
||||||
|
CFI R3 Frame(CFA, -60)
|
||||||
|
CFI R2 Frame(CFA, -64)
|
||||||
|
CFI R1 Frame(CFA, -68)
|
||||||
|
CFI CFA SP+96
|
||||||
|
CFI FunCall _vTaskSwitchContext
|
||||||
BSR.A _vTaskSwitchContext
|
BSR.A _vTaskSwitchContext
|
||||||
|
|
||||||
/* Reset the interrupt mask as no more data structure access is required. */
|
/* Reset the interrupt mask as no more data structure access is required. */
|
||||||
|
|
@ -194,6 +246,7 @@ ___interrupt_27:
|
||||||
RTE
|
RTE
|
||||||
NOP
|
NOP
|
||||||
NOP
|
NOP
|
||||||
|
CFI EndBlock cfiBlock0
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,11 @@
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <timeapi.h>
|
#ifdef _MSC_VER
|
||||||
|
#include <timeapi.h>
|
||||||
#ifdef __GNUC__
|
|
||||||
#include "mmsystem.h"
|
|
||||||
#else
|
|
||||||
#pragma comment(lib, "winmm.lib")
|
#pragma comment(lib, "winmm.lib")
|
||||||
|
#else
|
||||||
|
#include <mmsystem.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define portMAX_INTERRUPTS ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */
|
#define portMAX_INTERRUPTS ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,10 @@ extern void vPortYield( void );
|
||||||
__asm volatile ( "mrs %0, IPSR" : "=r" ( ulIPSR )::); \
|
__asm volatile ( "mrs %0, IPSR" : "=r" ( ulIPSR )::); \
|
||||||
( ( uint8_t ) ulIPSR ) > 0; } )
|
( ( uint8_t ) ulIPSR ) > 0; } )
|
||||||
|
|
||||||
|
/* Use #define rather than inline method to make it easier for user code
|
||||||
|
* to work with kernel versions both with and without xPortIsInsideInterrupt */
|
||||||
|
#define xPortIsInsideInterrupt() ((BaseType_t)portCHECK_IF_IN_ISR())
|
||||||
|
|
||||||
void vYieldCore( int xCoreID );
|
void vYieldCore( int xCoreID );
|
||||||
#define portYIELD_CORE( a ) vYieldCore( a )
|
#define portYIELD_CORE( a ) vYieldCore( a )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -961,6 +961,9 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||||
if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) != ( uint8_t ) 0 )
|
if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) != ( uint8_t ) 0 )
|
||||||
{
|
{
|
||||||
xRequiredSpace += sbBYTES_TO_STORE_MESSAGE_LENGTH;
|
xRequiredSpace += sbBYTES_TO_STORE_MESSAGE_LENGTH;
|
||||||
|
|
||||||
|
/* Overflow? */
|
||||||
|
configASSERT( xRequiredSpace > xDataLengthBytes );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
14
tasks.c
14
tasks.c
|
|
@ -1689,7 +1689,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
||||||
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
|
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
|
||||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||||
pxStack = pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );
|
pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );
|
||||||
|
|
||||||
if( pxStack != NULL )
|
if( pxStack != NULL )
|
||||||
{
|
{
|
||||||
|
|
@ -2010,6 +2010,16 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
||||||
}
|
}
|
||||||
#endif /* portUSING_MPU_WRAPPERS */
|
#endif /* portUSING_MPU_WRAPPERS */
|
||||||
|
|
||||||
|
#if ( portSTACK_GROWTH < 0 )
|
||||||
|
{
|
||||||
|
configASSERT( ( ( portPOINTER_SIZE_TYPE ) ( pxTopOfStack - pxNewTCB->pxTopOfStack ) ) < ( ( portPOINTER_SIZE_TYPE ) uxStackDepth ) );
|
||||||
|
}
|
||||||
|
#else /* portSTACK_GROWTH */
|
||||||
|
{
|
||||||
|
configASSERT( ( ( portPOINTER_SIZE_TYPE ) ( pxNewTCB->pxTopOfStack - pxTopOfStack ) ) < ( ( portPOINTER_SIZE_TYPE ) uxStackDepth ) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize task state and task attributes. */
|
/* Initialize task state and task attributes. */
|
||||||
#if ( configNUMBER_OF_CORES > 1 )
|
#if ( configNUMBER_OF_CORES > 1 )
|
||||||
{
|
{
|
||||||
|
|
@ -6906,7 +6916,7 @@ static void prvResetNextTaskUnblockTime( void )
|
||||||
/* It is known that the task is in its ready list so
|
/* It is known that the task is in its ready list so
|
||||||
* there is no need to check again and the port level
|
* there is no need to check again and the port level
|
||||||
* reset macro can be called directly. */
|
* reset macro can be called directly. */
|
||||||
portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority );
|
portRESET_READY_PRIORITY( uxPriorityUsedOnEntry, uxTopReadyPriority );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue