mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-11 00:27:45 -04:00
Merge branch 'main' into blocking_buffer
This commit is contained in:
commit
a122210354
4 changed files with 58 additions and 38 deletions
|
@ -86,15 +86,6 @@ typedef unsigned long UBaseType_t;
|
||||||
#define portMPU_REGION_CACHEABLE_BUFFERABLE ( 0x07UL << 16UL )
|
#define portMPU_REGION_CACHEABLE_BUFFERABLE ( 0x07UL << 16UL )
|
||||||
#define portMPU_REGION_EXECUTE_NEVER ( 0x01UL << 28UL )
|
#define portMPU_REGION_EXECUTE_NEVER ( 0x01UL << 28UL )
|
||||||
|
|
||||||
/* MPU settings that can be overriden in FreeRTOSConfig.h. */
|
|
||||||
#ifndef configTOTAL_MPU_REGIONS
|
|
||||||
/* Define to 8 for backward compatibility. */
|
|
||||||
#define configTOTAL_MPU_REGIONS ( 8UL )
|
|
||||||
#elif( configTOTAL_MPU_REGIONS != 8UL )
|
|
||||||
/* The Cortex M3 only supports 8 MPU regions. For more information refer to:
|
|
||||||
* https://developer.arm.com/documentation/dui0552/a/cortex-m3-peripherals/optional-memory-protection-unit */
|
|
||||||
#error configTOTAL_MPU_REGIONS must be 8 for this port.
|
|
||||||
#endif /* configTOTAL_MPU_REGIONS Check */
|
|
||||||
#define portSTACK_REGION ( 3UL )
|
#define portSTACK_REGION ( 3UL )
|
||||||
#define portGENERAL_PERIPHERALS_REGION ( 4UL )
|
#define portGENERAL_PERIPHERALS_REGION ( 4UL )
|
||||||
#define portUNPRIVILEGED_FLASH_REGION ( 5UL )
|
#define portUNPRIVILEGED_FLASH_REGION ( 5UL )
|
||||||
|
|
|
@ -183,16 +183,23 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0xbbbb;
|
*pxTopOfStack = ( StackType_t ) 0xbbbb;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
#ifdef __MSPGCC__
|
||||||
*pxTopOfStack = ( StackType_t ) 0xcccc;
|
*pxTopOfStack = ( StackType_t ) 0xcccc;
|
||||||
|
#else
|
||||||
|
/* The MSP430 EABI expects the function parameter in R12. */
|
||||||
|
*pxTopOfStack = ( StackType_t ) pvParameters;
|
||||||
|
#endif
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0xdddd;
|
*pxTopOfStack = ( StackType_t ) 0xdddd;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0xeeee;
|
*pxTopOfStack = ( StackType_t ) 0xeeee;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
#ifdef __MSPGCC__
|
||||||
/* When the task starts is will expect to find the function parameter in
|
/* The mspgcc ABI expects the function parameter in R15. */
|
||||||
* R15. */
|
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters;
|
*pxTopOfStack = ( StackType_t ) pvParameters;
|
||||||
|
#else
|
||||||
|
*pxTopOfStack = ( StackType_t ) 0xffff;
|
||||||
|
#endif
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The code generated by the mspgcc compiler does not maintain separate
|
/* The code generated by the mspgcc compiler does not maintain separate
|
||||||
|
|
|
@ -121,6 +121,8 @@ void vPortExitCritical( void );
|
||||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
|
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
|
||||||
|
|
||||||
/* Check the configuration. */
|
/* Check the configuration. */
|
||||||
|
@ -129,24 +131,40 @@ void vPortExitCritical( void );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Store/clear the ready priorities in a bit map. */
|
/* Store/clear the ready priorities in a bit map. */
|
||||||
#define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
|
#define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( ( ( UBaseType_t ) 1 ) << ( uxPriority ) )
|
||||||
#define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
|
#define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( ( ( UBaseType_t ) 1 ) << ( uxPriority ) )
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
||||||
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
|
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
|
||||||
__asm volatile ( "bsr %1, %0\n\t" \
|
__asm volatile ( "bsr %1, %0\n\t" \
|
||||||
: "=r" ( uxTopPriority ) : "rm" ( uxReadyPriorities ) : "cc" )
|
: "=r" ( uxTopPriority ) \
|
||||||
#else
|
: "rm" ( uxReadyPriorities ) \
|
||||||
|
: "cc" )
|
||||||
|
|
||||||
|
#else /* __GNUC__ */
|
||||||
|
|
||||||
/* BitScanReverse returns the bit position of the most significant '1'
|
/* BitScanReverse returns the bit position of the most significant '1'
|
||||||
* in the word. */
|
* in the word. */
|
||||||
|
#if defined( __x86_64__ ) || defined( _M_X64 )
|
||||||
|
|
||||||
|
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
DWORD ulTopPriority; \
|
||||||
|
_BitScanReverse64( &ulTopPriority, ( uxReadyPriorities ) ); \
|
||||||
|
uxTopPriority = ulTopPriority; \
|
||||||
|
} while( 0 )
|
||||||
|
|
||||||
|
#else /* #if defined( __x86_64__ ) || defined( _M_X64 ) */
|
||||||
|
|
||||||
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) _BitScanReverse( ( DWORD * ) &( uxTopPriority ), ( uxReadyPriorities ) )
|
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) _BitScanReverse( ( DWORD * ) &( uxTopPriority ), ( uxReadyPriorities ) )
|
||||||
|
|
||||||
|
#endif /* #if defined( __x86_64__ ) || defined( _M_X64 ) */
|
||||||
|
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#endif /* taskRECORD_READY_PRIORITY */
|
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
|
||||||
|
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
__pragma( warning( disable:4211 ) ) /* Nonstandard extension used, as extern is only nonstandard to MSVC. */
|
__pragma( warning( disable:4211 ) ) /* Nonstandard extension used, as extern is only nonstandard to MSVC. */
|
||||||
|
|
4
tasks.c
4
tasks.c
|
@ -6211,6 +6211,8 @@ static void prvCheckTasksWaitingTermination( void )
|
||||||
pxTaskStatus->eCurrentState = eBlocked;
|
pxTaskStatus->eCurrentState = eBlocked;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||||
{
|
{
|
||||||
BaseType_t x;
|
BaseType_t x;
|
||||||
|
|
||||||
|
@ -6228,6 +6230,8 @@ static void prvCheckTasksWaitingTermination( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
( void ) xTaskResumeAll();
|
( void ) xTaskResumeAll();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue