mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Better consistency checking in xPortSysTickHandler
* For Cortex-M ports it's crucial that the SysTick has the lowest (logical) priority otherwise very strange things will happen when the SysTick interrupts a critical section. Therefor a consistency check has been added to the xPortSysTickHandler to make sure that a critical section was not interrupted. * Added comment in list.c to point in the right direction if the SysTick has wrong interrupt priority. It's usually here you end up when interrupting a critical section with the SysTick.
This commit is contained in:
parent
ebbe2cf854
commit
6362bc7dcf
14 changed files with 40 additions and 0 deletions
1
list.c
1
list.c
|
@ -158,6 +158,7 @@ void vListInsert( List_t * const pxList,
|
|||
* 4) Using a queue or semaphore before it has been initialised or
|
||||
* before the scheduler has been started (are interrupts firing
|
||||
* before vTaskStartScheduler() has been called?).
|
||||
* 5) Misconfigured SysTick priority? Must be lowest (logical) priority.
|
||||
**********************************************************************/
|
||||
|
||||
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
|
||||
|
|
|
@ -331,6 +331,9 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -356,6 +356,9 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -431,6 +431,9 @@ void xPortPendSVHandler( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -493,6 +493,9 @@ void xPortPendSVHandler( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -483,6 +483,9 @@ void xPortPendSVHandler( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -334,6 +334,9 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -371,6 +371,9 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -483,6 +483,9 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -359,6 +359,9 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -485,6 +485,9 @@ void xPortPendSVHandler( void ) iv IVT_INT_PendSV ics ICS_OFF
|
|||
|
||||
void xPortSysTickHandler( void ) iv IVT_INT_SysTick ics ICS_AUTO
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -424,6 +424,9 @@ __asm void xPortPendSVHandler( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -516,6 +516,9 @@ __asm void xPortPendSVHandler( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
|
@ -503,6 +503,9 @@ __asm void xPortPendSVHandler( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* The SysTick is not allowed to interrupt a critical section. */
|
||||
configAssert( uxCriticalNesting == 0 )
|
||||
|
||||
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
|
||||
* executes all interrupts must be unmasked. There is therefore no need to
|
||||
* save and then restore the interrupt mask value as its value is already
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue