Resolved VF reporting type errors for memset call and disproved some overflows and underflows.

This commit is contained in:
Tobias Reinhard 2022-10-25 13:58:06 -04:00
parent 1042ea8cf8
commit 06bc0fbb2d
2 changed files with 230 additions and 204 deletions

21
tasks.c
View file

@ -1298,7 +1298,8 @@ static void prvYieldForTask( TCB_t * pxTCB,
void * const pvParameters, void * const pvParameters,
UBaseType_t uxPriority, UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask ) TaskHandle_t * const pxCreatedTask )
/*@ requires usStackDepth * sizeof( StackType_t ) < UINTPTR_MAX; /*@ requires usStackDepth * sizeof( StackType_t ) < UINTPTR_MAX &*&
usStackDepth > 0;
@*/ @*/
//@ ensures true; //@ ensures true;
#if ( ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) #if ( ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
@ -1404,6 +1405,9 @@ static void prvYieldForTask( TCB_t * pxTCB,
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY; xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
} }
//@ assume(false);
// TODO: Remove!
// Allows us to focus on verifying called functions.
return xReturn; return xReturn;
} }
@ -1418,7 +1422,10 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
TaskHandle_t * const pxCreatedTask, TaskHandle_t * const pxCreatedTask,
TCB_t * pxNewTCB, TCB_t * pxNewTCB,
const MemoryRegion_t * const xRegions ) const MemoryRegion_t * const xRegions )
/*@ requires true; /*@ requires TCB_p(pxNewTCB, ?stackSize) &*&
stackSize == ulStackDepth * sizeof(StackType_t) &*&
stackSize <= UINTPTR_MAX &*&
ulStackDepth > 0;
@*/ @*/
/*@ ensures true; /*@ ensures true;
@*/ @*/
@ -1441,6 +1448,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
uxPriority &= ~portPRIVILEGE_BIT; uxPriority &= ~portPRIVILEGE_BIT;
#endif /* portUSING_MPU_WRAPPERS == 1 */ #endif /* portUSING_MPU_WRAPPERS == 1 */
//@ open TCB_p(_,_);
/* Avoid dependency on memset() if it is not required. */ /* Avoid dependency on memset() if it is not required. */
#if ( tskSET_NEW_STACKS_TO_KNOWN_VALUE == 1 ) #if ( tskSET_NEW_STACKS_TO_KNOWN_VALUE == 1 )
{ {
@ -1449,12 +1459,15 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
/* Reason for rewrite: /* Reason for rewrite:
* - VeriFast does not support casts involving side-effectful * - VeriFast does not support casts involving side-effectful
* expressions. * expressions.
* * - VeriFast report type mismatch because
* `( int ) tskSTACK_FILL_BYTE` is passed for a char argument.
* *
* Note: The only affect of void casts is to surpress compiler * Note: The only affect of void casts is to surpress compiler
* warnings. * warnings.
*
* TODO: Is the type mismatch a real error?
*/ */
memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) ulStackDepth * sizeof( StackType_t ) ); memset( pxNewTCB->pxStack, ( char ) tskSTACK_FILL_BYTE, ( size_t ) ulStackDepth * sizeof( StackType_t ) );
#else #else
( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) ulStackDepth * sizeof( StackType_t ) ); ( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) ulStackDepth * sizeof( StackType_t ) );
#endif #endif

View file

@ -142,40 +142,40 @@ typedef intptr_t ptrdiff_t;
typedef intptr_t ssize_t; typedef intptr_t ssize_t;
// # 5 "/Users/reitobia/programs/verifast-21.04-83-gfae956f7/bin/malloc.h" 2 // # 5 "/Users/reitobia/programs/verifast-21.04-83-gfae956f7/bin/malloc.h" 2
/*@ /*@
// In Standard C, freeing a null pointer is allowed and is a no-op. // In Standard C, freeing a null pointer is allowed and is a no-op.
lemma_auto void malloc_block_null(); lemma_auto void malloc_block_null();
requires emp; requires emp;
ensures malloc_block(0, 0); ensures malloc_block(0, 0);
lemma void malloc_block_limits(void *array); lemma void malloc_block_limits(void *array);
requires [?f]malloc_block(array, ?size); requires [?f]malloc_block(array, ?size);
ensures [f]malloc_block(array, size) &*& (void *)0 <= array &*& 0 <= size &*& array + size <= (void *)UINTPTR_MAX; ensures [f]malloc_block(array, size) &*& (void *)0 <= array &*& 0 <= size &*& array + size <= (void *)UINTPTR_MAX;
@*/ @*/
void *malloc(size_t size); void *malloc(size_t size);
//@ requires true; //@ requires true;
/*@ /*@
ensures ensures
result == 0 ? result == 0 ?
emp emp
: :
chars_(result, size, _) &*& malloc_block(result, size) &*& chars_(result, size, _) &*& malloc_block(result, size) &*&
(char *)0 < result && result + size <= (char *)UINTPTR_MAX; // one-past-end does not overflow (char *)0 < result && result + size <= (char *)UINTPTR_MAX; // one-past-end does not overflow
@*/ @*/
//@ terminates; //@ terminates;
void *calloc(size_t nmemb, size_t size); void *calloc(size_t nmemb, size_t size);
//@ requires true; //@ requires true;
/*@ /*@
ensures ensures
result == 0 ? result == 0 ?
emp emp
: :
chars(result, nmemb * size, ?cs) &*& malloc_block(result, nmemb * size) &*& all_eq(cs, 0) == true &*& chars(result, nmemb * size, ?cs) &*& malloc_block(result, nmemb * size) &*& all_eq(cs, 0) == true &*&
(char *)0 < result && result + nmemb * size <= (char *)UINTPTR_MAX; // one-past-end does not overflow (char *)0 < result && result + nmemb * size <= (char *)UINTPTR_MAX; // one-past-end does not overflow
@*/ @*/
//@ terminates; //@ terminates;
@ -186,16 +186,16 @@ void free(void *array);
void *realloc(void *array, size_t newSize); void *realloc(void *array, size_t newSize);
//@ requires malloc_block(array, ?size) &*& chars(array, size, ?cs); //@ requires malloc_block(array, ?size) &*& chars(array, size, ?cs);
/*@ /*@
ensures ensures
result == 0 ? result == 0 ?
malloc_block(array, size) &*& chars(array, size, cs) malloc_block(array, size) &*& chars(array, size, cs)
: :
malloc_block(result, newSize) &*& malloc_block(result, newSize) &*&
newSize <= size ? newSize <= size ?
chars(result, _, take(newSize, cs)) chars(result, _, take(newSize, cs))
: :
chars(result, _, cs) &*& chars(result + size, newSize - size, _); chars(result, _, cs) &*& chars(result + size, newSize - size, _);
@*/ @*/
//@ terminates; //@ terminates;
// # 6 "/Users/reitobia/programs/verifast-21.04-83-gfae956f7/bin/stdlib.h" 2 // # 6 "/Users/reitobia/programs/verifast-21.04-83-gfae956f7/bin/stdlib.h" 2
@ -240,21 +240,21 @@ void memcpy(void *array, void *array0, size_t count);
//@ ensures chars(array, count, cs0) &*& [f]chars(array0, count, cs0); //@ ensures chars(array, count, cs0) &*& [f]chars(array0, count, cs0);
void memmove(void *dest, void *src, size_t count); void memmove(void *dest, void *src, size_t count);
/*@ /*@
requires requires
chars(src, count, ?cs) &*& chars(src, count, ?cs) &*&
dest <= src ? dest <= src ?
chars(dest, src - dest, _) chars(dest, src - dest, _)
: :
chars(src + count, dest - src, _); chars(src + count, dest - src, _);
@*/ @*/
/*@ /*@
ensures ensures
chars(dest, count, cs) &*& chars(dest, count, cs) &*&
dest <= src ? dest <= src ?
chars(dest + count, src - dest, _) chars(dest + count, src - dest, _)
: :
chars(src, dest - src, _); chars(src, dest - src, _);
@*/ @*/
size_t strlen(char *string); size_t strlen(char *string);
@ -275,15 +275,15 @@ char *memchr(char *array, char c, size_t count);
char* strchr(char *str, char c); char* strchr(char *str, char c);
//@ requires [?f]string(str, ?cs); //@ requires [?f]string(str, ?cs);
/*@ ensures /*@ ensures
[f]string(str, cs) &*& [f]string(str, cs) &*&
c == 0 ? c == 0 ?
result == str + length(cs) result == str + length(cs)
: :
result == 0 ? result == 0 ?
mem(c, cs) == false mem(c, cs) == false
: :
mem(c, cs) == true &*& result == str + index_of(c, cs); mem(c, cs) == true &*& result == str + index_of(c, cs);
@*/ @*/
void* memset(void *array, char value, size_t size); void* memset(void *array, char value, size_t size);
@ -630,33 +630,33 @@ typedef void (* TaskFunction_t)( void * );
* must be set in the compiler's include path. */ * must be set in the compiler's include path. */
// # 1 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h" 1 // # 1 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h" 1
/* /*
* FreeRTOS SMP Kernel V202110.00 * FreeRTOS SMP Kernel V202110.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2021 Raspberry Pi (Trading) Ltd. * Copyright (c) 2021 Raspberry Pi (Trading) Ltd.
* *
* SPDX-License-Identifier: MIT AND BSD-3-Clause * SPDX-License-Identifier: MIT AND BSD-3-Clause
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://github.com/FreeRTOS * https://github.com/FreeRTOS
* *
*/ */
// # 37 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h" // # 37 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h"
// # 1 "/Users/reitobia/repos2/FreeRTOS-Kernel/verification/verifast/sdks/pico-sdk/src/common/pico_base/include/pico.h" 1 // # 1 "/Users/reitobia/repos2/FreeRTOS-Kernel/verification/verifast/sdks/pico-sdk/src/common/pico_base/include/pico.h" 1
@ -4357,14 +4357,14 @@ int spin_lock_claim_unused(bool required);
bool spin_lock_is_claimed(uint lock_num); bool spin_lock_is_claimed(uint lock_num);
// # 39 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h" 2 // # 39 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h" 2
/*----------------------------------------------------------- /*-----------------------------------------------------------
* Port specific definitions. * Port specific definitions.
* *
* The settings in this file configure FreeRTOS correctly for the * The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler. * given hardware and compiler.
* *
* These settings should not be altered. * These settings should not be altered.
*----------------------------------------------------------- *-----------------------------------------------------------
*/ */
/* Type definitions. */ /* Type definitions. */
@ -4380,7 +4380,7 @@ bool spin_lock_is_claimed(uint lock_num);
typedef uint32_t TickType_t; typedef uint32_t TickType_t;
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
* not need to be guarded with a critical section. */ * not need to be guarded with a critical section. */
@ -4391,13 +4391,13 @@ bool spin_lock_is_claimed(uint lock_num);
/* Reason for rewrite: VeriFast does not support the attriibute `used`. /* Reason for rewrite: VeriFast does not support the attriibute `used`.
*/ */
/* We have to use PICO_DIVIDER_DISABLE_INTERRUPTS as the source of truth rathern than our config, /* We have to use PICO_DIVIDER_DISABLE_INTERRUPTS as the source of truth rathern than our config,
* as our FreeRTOSConfig.h header cannot be included by ASM code - which is what this affects in the SDK */ * as our FreeRTOSConfig.h header cannot be included by ASM code - which is what this affects in the SDK */
@ -4462,11 +4462,11 @@ bool spin_lock_is_claimed(uint lock_num);
/* Note this is a single method with uxAcquire parameter since we have /* Note this is a single method with uxAcquire parameter since we have
* static vars, the method is always called with a compile time constant for * static vars, the method is always called with a compile time constant for
* uxAcquire, and the compiler should dothe right thing! */ * uxAcquire, and the compiler should dothe right thing! */
/* Reason for rewrite: VeriFast does not support local static variables. /* Reason for rewrite: VeriFast does not support local static variables.
*/ */
// # 226 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h" // # 226 "/Users/reitobia/repos2/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -10698,10 +10698,11 @@ static void prvYieldForTask( TCB_t * pxTCB,
void * const pvParameters, void * const pvParameters,
UBaseType_t uxPriority, UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask ) TaskHandle_t * const pxCreatedTask )
/*@ requires usStackDepth * sizeof( StackType_t ) < UINTPTR_MAX; /*@ requires usStackDepth * sizeof( StackType_t ) < UINTPTR_MAX &*&
usStackDepth > 0;
@*/ @*/
//@ ensures true; //@ ensures true;
// # 1317 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1318 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
TCB_t * pxNewTCB; TCB_t * pxNewTCB;
BaseType_t xReturn; BaseType_t xReturn;
@ -10709,7 +10710,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
/* If the stack grows down then allocate the stack then the TCB so the stack /* If the stack grows down then allocate the stack then the TCB so the stack
* does not grow into the TCB. Likewise if the stack grows up then allocate * does not grow into the TCB. Likewise if the stack grows up then allocate
* the TCB then the stack. */ * the TCB then the stack. */
// # 1347 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1348 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
StackType_t * pxStack; StackType_t * pxStack;
@ -10745,9 +10746,9 @@ static void prvYieldForTask( TCB_t * pxTCB,
if( pxNewTCB != 0 ) if( pxNewTCB != 0 )
{ {
// # 1390 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1391 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
prvInitialiseNewTask( pxTaskCode, pcName, ( uint32_t ) usStackDepth, pvParameters, uxPriority, pxCreatedTask, pxNewTCB, 0 ); prvInitialiseNewTask( pxTaskCode, pcName, ( uint32_t ) usStackDepth, pvParameters, uxPriority, pxCreatedTask, pxNewTCB, 0 );
// # 1399 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1400 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
prvAddNewTaskToReadyList( pxNewTCB ); prvAddNewTaskToReadyList( pxNewTCB );
xReturn = ( ( ( BaseType_t ) 1 ) ); xReturn = ( ( ( BaseType_t ) 1 ) );
} }
@ -10756,6 +10757,9 @@ static void prvYieldForTask( TCB_t * pxTCB,
xReturn = ( -1 ); xReturn = ( -1 );
} }
//@ assume(false);
// TODO: Remove!
// Allows us to focus on verifying called functions.
return xReturn; return xReturn;
} }
@ -10770,14 +10774,19 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
TaskHandle_t * const pxCreatedTask, TaskHandle_t * const pxCreatedTask,
TCB_t * pxNewTCB, TCB_t * pxNewTCB,
const MemoryRegion_t * const xRegions ) const MemoryRegion_t * const xRegions )
/*@ requires true; /*@ requires TCB_p(pxNewTCB, ?stackSize) &*&
stackSize == ulStackDepth * sizeof(StackType_t) &*&
stackSize <= UINTPTR_MAX &*&
ulStackDepth > 0;
@*/ @*/
/*@ ensures true; /*@ ensures true;
@*/ @*/
{ {
StackType_t * pxTopOfStack; StackType_t * pxTopOfStack;
UBaseType_t x; UBaseType_t x;
// # 1444 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1452 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
//@ open TCB_p(_,_);
/* Avoid dependency on memset() if it is not required. */ /* Avoid dependency on memset() if it is not required. */
{ {
@ -10786,12 +10795,15 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
/* Reason for rewrite: /* Reason for rewrite:
* - VeriFast does not support casts involving side-effectful * - VeriFast does not support casts involving side-effectful
* expressions. * expressions.
* * - VeriFast report type mismatch because
* `( int ) tskSTACK_FILL_BYTE` is passed for a char argument.
* *
* Note: The only affect of void casts is to surpress compiler * Note: The only affect of void casts is to surpress compiler
* warnings. * warnings.
*
* TODO: Is the type mismatch a real error?
*/ */
memset( pxNewTCB->pxStack, ( int ) ( 0xa5U ), ( size_t ) ulStackDepth * sizeof( StackType_t ) ); memset( pxNewTCB->pxStack, ( char ) ( 0xa5U ), ( size_t ) ulStackDepth * sizeof( StackType_t ) );
@ -10805,13 +10817,14 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
{ {
pxTopOfStack = &( pxNewTCB->pxStack[ ulStackDepth - ( uint32_t ) 1 ] ); pxTopOfStack = &( pxNewTCB->pxStack[ ulStackDepth - ( uint32_t ) 1 ] );
// VF-TODO: Justiy that this does not cause an arithmetic overflow
pxTopOfStack = ( StackType_t * ) ( ( ( uint32_t ) pxTopOfStack ) & ( ~( ( uint32_t ) ( 0x0007 ) ) ) ); /*lint !e923 !e9033 !e9078 MISRA exception. Avoiding casts between pointers and integers is not practical. Size differences accounted for using portPOINTER_SIZE_TYPE type. Checked by assert(). */ pxTopOfStack = ( StackType_t * ) ( ( ( uint32_t ) pxTopOfStack ) & ( ~( ( uint32_t ) ( 0x0007 ) ) ) ); /*lint !e923 !e9033 !e9078 MISRA exception. Avoiding casts between pointers and integers is not practical. Size differences accounted for using portPOINTER_SIZE_TYPE type. Checked by assert(). */
/* Check the alignment of the calculated top of stack is correct. */ /* Check the alignment of the calculated top of stack is correct. */
(__builtin_expect(!(( ( ( uint32_t ) pxTopOfStack & ( uint32_t ) ( 0x0007 ) ) == 0UL )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1474, "( ( ( uint32_t ) pxTopOfStack & ( uint32_t ) ( 0x0007 ) ) == 0UL )") : (void)0); (__builtin_expect(!(( ( ( uint32_t ) pxTopOfStack & ( uint32_t ) ( 0x0007 ) ) == 0UL )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1487, "( ( ( uint32_t ) pxTopOfStack & ( uint32_t ) ( 0x0007 ) ) == 0UL )") : (void)0);
// # 1483 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1496 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
// # 1497 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1510 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/* Store the task name in the TCB. */ /* Store the task name in the TCB. */
if( pcName != 0 ) if( pcName != 0 )
{ {
@ -10877,7 +10890,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
{ {
pxNewTCB->uxCriticalNesting = ( UBaseType_t ) 0U; pxNewTCB->uxCriticalNesting = ( UBaseType_t ) 0U;
} }
// # 1581 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1594 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
/* Avoid compiler warning about unreferenced parameter. */ /* Avoid compiler warning about unreferenced parameter. */
( void ) xRegions; ( void ) xRegions;
@ -10895,21 +10908,21 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
memset( ( void * ) &( pxNewTCB->ulNotifiedValue[ 0 ] ), 0x00, sizeof( pxNewTCB->ulNotifiedValue ) ); memset( ( void * ) &( pxNewTCB->ulNotifiedValue[ 0 ] ), 0x00, sizeof( pxNewTCB->ulNotifiedValue ) );
memset( ( void * ) &( pxNewTCB->ucNotifyState[ 0 ] ), 0x00, sizeof( pxNewTCB->ucNotifyState ) ); memset( ( void * ) &( pxNewTCB->ucNotifyState[ 0 ] ), 0x00, sizeof( pxNewTCB->ucNotifyState ) );
} }
// # 1610 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1623 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
pxNewTCB->ucDelayAborted = ( ( BaseType_t ) 0 ); pxNewTCB->ucDelayAborted = ( ( BaseType_t ) 0 );
} }
// # 1628 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1641 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/* Initialize the TCB stack to look as if the task was already running, /* Initialize the TCB stack to look as if the task was already running,
* but had been interrupted by the scheduler. The return address is set * but had been interrupted by the scheduler. The return address is set
* to the start of the task function. Once the stack has been initialised * to the start of the task function. Once the stack has been initialised
* the top of stack variable is updated. */ * the top of stack variable is updated. */
// # 1656 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1669 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
/* If the port has capability to detect stack overflow, /* If the port has capability to detect stack overflow,
* pass the stack end address to the stack initialization * pass the stack end address to the stack initialization
* function as well. */ * function as well. */
// # 1673 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 1686 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters ); pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );
} }
@ -11118,7 +11131,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
if( xTaskRunningOnCore == xCoreID ) if( xTaskRunningOnCore == xCoreID )
{ {
(__builtin_expect(!(uxSchedulerSuspended == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1881, "uxSchedulerSuspended == 0") : (void)0); (__builtin_expect(!(uxSchedulerSuspended == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1894, "uxSchedulerSuspended == 0") : (void)0);
vTaskYieldWithinAPI(); vTaskYieldWithinAPI();
} }
else else
@ -11141,12 +11154,12 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
TickType_t xTimeToWake; TickType_t xTimeToWake;
BaseType_t xAlreadyYielded, xShouldDelay = ( ( BaseType_t ) 0 ); BaseType_t xAlreadyYielded, xShouldDelay = ( ( BaseType_t ) 0 );
(__builtin_expect(!(pxPreviousWakeTime), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1904, "pxPreviousWakeTime") : (void)0); (__builtin_expect(!(pxPreviousWakeTime), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1917, "pxPreviousWakeTime") : (void)0);
(__builtin_expect(!(( xTimeIncrement > 0U )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1905, "( xTimeIncrement > 0U )") : (void)0); (__builtin_expect(!(( xTimeIncrement > 0U )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1918, "( xTimeIncrement > 0U )") : (void)0);
vTaskSuspendAll(); vTaskSuspendAll();
{ {
(__builtin_expect(!(uxSchedulerSuspended == 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1909, "uxSchedulerSuspended == 1") : (void)0); (__builtin_expect(!(uxSchedulerSuspended == 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1922, "uxSchedulerSuspended == 1") : (void)0);
/* Minor optimisation. The tick count cannot change in this /* Minor optimisation. The tick count cannot change in this
* block. */ * block. */
@ -11232,7 +11245,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{ {
vTaskSuspendAll(); vTaskSuspendAll();
{ {
(__builtin_expect(!(uxSchedulerSuspended == 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 1995, "uxSchedulerSuspended == 1") : (void)0); (__builtin_expect(!(uxSchedulerSuspended == 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2008, "uxSchedulerSuspended == 1") : (void)0);
; ;
/* A task that is removed from the event list while the /* A task that is removed from the event list while the
@ -11286,7 +11299,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
const TCB_t * const pxTCB = xTask; const TCB_t * const pxTCB = xTask;
(__builtin_expect(!(pxTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2049, "pxTCB") : (void)0); (__builtin_expect(!(pxTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2062, "pxTCB") : (void)0);
vTaskEnterCritical(); vTaskEnterCritical();
{ {
@ -11462,7 +11475,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
BaseType_t xYieldForTask = ( ( BaseType_t ) 0 ); BaseType_t xYieldForTask = ( ( BaseType_t ) 0 );
BaseType_t xCoreID; BaseType_t xCoreID;
(__builtin_expect(!(( uxNewPriority < 32 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2225, "( uxNewPriority < 32 )") : (void)0); (__builtin_expect(!(( uxNewPriority < 32 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2238, "( uxNewPriority < 32 )") : (void)0);
/* Ensure the new priority is valid. */ /* Ensure the new priority is valid. */
if( uxNewPriority >= ( UBaseType_t ) 32 ) if( uxNewPriority >= ( UBaseType_t ) 32 )
@ -11616,13 +11629,13 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 2413 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2426 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 2436 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2449 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 2454 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2467 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 2482 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2495 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -11699,7 +11712,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
if( xTaskRunningOnCore == 0 ) if( xTaskRunningOnCore == 0 )
{ {
/* The current task has just been suspended. */ /* The current task has just been suspended. */
(__builtin_expect(!(uxSchedulerSuspended == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2558, "uxSchedulerSuspended == 0") : (void)0); (__builtin_expect(!(uxSchedulerSuspended == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2571, "uxSchedulerSuspended == 0") : (void)0);
vTaskYieldWithinAPI(); vTaskYieldWithinAPI();
} }
else else
@ -11713,7 +11726,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{ {
vTaskExitCritical(); vTaskExitCritical();
(__builtin_expect(!(pxTCB == pxCurrentTCBs[ xTaskRunningOnCore ]), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2572, "pxTCB == pxCurrentTCBs[ xTaskRunningOnCore ]") : (void)0); (__builtin_expect(!(pxTCB == pxCurrentTCBs[ xTaskRunningOnCore ]), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2585, "pxTCB == pxCurrentTCBs[ xTaskRunningOnCore ]") : (void)0);
/* The scheduler is not running, but the task that was pointed /* The scheduler is not running, but the task that was pointed
* to by pxCurrentTCB has just been suspended and pxCurrentTCB * to by pxCurrentTCB has just been suspended and pxCurrentTCB
@ -11760,7 +11773,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
/* Accesses xPendingReadyList so must be called from a critical section. */ /* Accesses xPendingReadyList so must be called from a critical section. */
/* It does not make sense to check if the calling task is suspended. */ /* It does not make sense to check if the calling task is suspended. */
(__builtin_expect(!(xTask), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2619, "xTask") : (void)0); (__builtin_expect(!(xTask), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2632, "xTask") : (void)0);
/* Is the task being resumed actually in the suspended list? */ /* Is the task being resumed actually in the suspended list? */
if( ( ( ( &( pxTCB->xStateListItem ) )->pxContainer == ( &xSuspendedTaskList ) ) ? ( ( ( BaseType_t ) 1 ) ) : ( ( ( BaseType_t ) 0 ) ) ) != ( ( BaseType_t ) 0 ) ) if( ( ( ( &( pxTCB->xStateListItem ) )->pxContainer == ( &xSuspendedTaskList ) ) ? ( ( ( BaseType_t ) 1 ) ) : ( ( ( BaseType_t ) 0 ) ) ) != ( ( BaseType_t ) 0 ) )
@ -11809,7 +11822,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
/* It does not make sense to resume the calling task. */ /* It does not make sense to resume the calling task. */
(__builtin_expect(!(xTaskToResume), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2668, "xTaskToResume") : (void)0); (__builtin_expect(!(xTaskToResume), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2681, "xTaskToResume") : (void)0);
/* The parameter cannot be NULL as it is impossible to resume the /* The parameter cannot be NULL as it is impossible to resume the
* currently executing task. It is also impossible to resume a task * currently executing task. It is also impossible to resume a task
@ -11868,7 +11881,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
UBaseType_t uxSavedInterruptStatus; UBaseType_t uxSavedInterruptStatus;
(__builtin_expect(!(xTaskToResume), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2727, "xTaskToResume") : (void)0); (__builtin_expect(!(xTaskToResume), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2740, "xTaskToResume") : (void)0);
/* RTOS ports that support interrupt nesting have the concept of a /* RTOS ports that support interrupt nesting have the concept of a
* maximum system call (or maximum API call) interrupt priority. * maximum system call (or maximum API call) interrupt priority.
@ -11989,7 +12002,7 @@ static BaseType_t prvCreateIdleTasks( void )
{ {
; ;
} }
// # 2895 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2908 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
if( xCoreID == 0 ) if( xCoreID == 0 )
{ {
@ -12001,7 +12014,7 @@ static BaseType_t prvCreateIdleTasks( void )
( ( UBaseType_t ) 0x00 ), /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */ ( ( UBaseType_t ) 0x00 ), /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */
&xIdleTaskHandle[ xCoreID ] ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */ &xIdleTaskHandle[ xCoreID ] ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
} }
// # 2918 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2931 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
} }
@ -12038,7 +12051,7 @@ void vTaskStartScheduler( void )
* so interrupts will automatically get re-enabled when the first task * so interrupts will automatically get re-enabled when the first task
* starts to run. */ * starts to run. */
assert_fct(false); assert_fct(false);
// # 2968 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 2981 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
xNextTaskUnblockTime = ( TickType_t ) 0xffffffffUL; xNextTaskUnblockTime = ( TickType_t ) 0xffffffffUL;
xSchedulerRunning = ( ( BaseType_t ) 1 ); xSchedulerRunning = ( ( BaseType_t ) 1 );
xTickCount = ( TickType_t ) 0; xTickCount = ( TickType_t ) 0;
@ -12070,7 +12083,7 @@ void vTaskStartScheduler( void )
/* This line will only be reached if the kernel could not be started, /* This line will only be reached if the kernel could not be started,
* because there was not enough FreeRTOS heap to create the idle task * because there was not enough FreeRTOS heap to create the idle task
* or the timer task. */ * or the timer task. */
(__builtin_expect(!(xReturn != ( -1 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 2999, "xReturn != ( -1 )") : (void)0); (__builtin_expect(!(xReturn != ( -1 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3012, "xReturn != ( -1 )") : (void)0);
} }
/* Prevent compiler warnings if INCLUDE_xTaskGetIdleTaskHandle is set to 0, /* Prevent compiler warnings if INCLUDE_xTaskGetIdleTaskHandle is set to 0,
@ -12135,7 +12148,7 @@ void vTaskSuspendAll( void )
} }
} }
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
// # 3126 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3139 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
BaseType_t xTaskResumeAll( void ) BaseType_t xTaskResumeAll( void )
@ -12158,7 +12171,7 @@ BaseType_t xTaskResumeAll( void )
/* If uxSchedulerSuspended is zero then this function does not match a /* If uxSchedulerSuspended is zero then this function does not match a
* previous call to vTaskSuspendAll(). */ * previous call to vTaskSuspendAll(). */
(__builtin_expect(!(uxSchedulerSuspended), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3148, "uxSchedulerSuspended") : (void)0); (__builtin_expect(!(uxSchedulerSuspended), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3161, "uxSchedulerSuspended") : (void)0);
--uxSchedulerSuspended; --uxSchedulerSuspended;
vPortRecursiveLock(1, spin_lock_instance(15), ( ( BaseType_t ) 0 )); vPortRecursiveLock(1, spin_lock_instance(15), ( ( BaseType_t ) 0 ));
@ -12316,7 +12329,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
/* If null is passed in here then the name of the calling task is being /* If null is passed in here then the name of the calling task is being
* queried. */ * queried. */
pxTCB = ( ( ( xTaskToQuery ) == 0 ) ? xTaskGetCurrentTaskHandle() : ( xTaskToQuery ) ); pxTCB = ( ( ( xTaskToQuery ) == 0 ) ? xTaskGetCurrentTaskHandle() : ( xTaskToQuery ) );
(__builtin_expect(!(pxTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3306, "pxTCB") : (void)0); (__builtin_expect(!(pxTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3319, "pxTCB") : (void)0);
return &( pxTCB->pcTaskName[ 0 ] ); return &( pxTCB->pcTaskName[ 0 ] );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -12409,7 +12422,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
TCB_t * pxTCB; TCB_t * pxTCB;
/* Task names will be truncated to configMAX_TASK_NAME_LEN - 1 bytes. */ /* Task names will be truncated to configMAX_TASK_NAME_LEN - 1 bytes. */
(__builtin_expect(!(strlen( pcNameToQuery ) < 16), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3399, "strlen( pcNameToQuery ) < 16") : (void)0); (__builtin_expect(!(strlen( pcNameToQuery ) < 16), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3412, "strlen( pcNameToQuery ) < 16") : (void)0);
vTaskSuspendAll(); vTaskSuspendAll();
{ {
@ -12505,7 +12518,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
* each task in the Suspended state. */ * each task in the Suspended state. */
uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xSuspendedTaskList, eSuspended ); uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xSuspendedTaskList, eSuspended );
} }
// # 3509 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3522 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
if( pulTotalRunTime != 0 ) if( pulTotalRunTime != 0 )
{ {
@ -12533,7 +12546,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
{ {
/* If xTaskGetIdleTaskHandle() is called before the scheduler has been /* If xTaskGetIdleTaskHandle() is called before the scheduler has been
* started, then xIdleTaskHandle will be NULL. */ * started, then xIdleTaskHandle will be NULL. */
(__builtin_expect(!(( xIdleTaskHandle != 0 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3536, "( xIdleTaskHandle != 0 )") : (void)0); (__builtin_expect(!(( xIdleTaskHandle != 0 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3549, "( xIdleTaskHandle != 0 )") : (void)0);
return &( xIdleTaskHandle[ 0 ] ); return &( xIdleTaskHandle[ 0 ] );
} }
@ -12544,7 +12557,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
* This is to ensure vTaskStepTick() is available when user defined low power mode * This is to ensure vTaskStepTick() is available when user defined low power mode
* implementations require configUSE_TICKLESS_IDLE to be set to a value other than * implementations require configUSE_TICKLESS_IDLE to be set to a value other than
* 1. */ * 1. */
// # 3560 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3573 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
@ -12553,7 +12566,7 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
/* Must not be called with the scheduler suspended as the implementation /* Must not be called with the scheduler suspended as the implementation
* relies on xPendedTicks being wound down to 0 in xTaskResumeAll(). */ * relies on xPendedTicks being wound down to 0 in xTaskResumeAll(). */
(__builtin_expect(!(uxSchedulerSuspended == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3568, "uxSchedulerSuspended == 0") : (void)0); (__builtin_expect(!(uxSchedulerSuspended == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3581, "uxSchedulerSuspended == 0") : (void)0);
/* Use xPendedTicks to mimic xTicksToCatchUp number of ticks occurring when /* Use xPendedTicks to mimic xTicksToCatchUp number of ticks occurring when
* the scheduler is suspended so the ticks are executed in xTaskResumeAll(). */ * the scheduler is suspended so the ticks are executed in xTaskResumeAll(). */
@ -12572,7 +12585,7 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
TCB_t * pxTCB = xTask; TCB_t * pxTCB = xTask;
BaseType_t xReturn; BaseType_t xReturn;
(__builtin_expect(!(pxTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3587, "pxTCB") : (void)0); (__builtin_expect(!(pxTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3600, "pxTCB") : (void)0);
vTaskSuspendAll(); vTaskSuspendAll();
{ {
@ -12671,7 +12684,7 @@ BaseType_t xTaskIncrementTick( void )
if( xConstTickCount == ( TickType_t ) 0U ) /*lint !e774 'if' does not always evaluate to false as it is looking for an overflow. */ if( xConstTickCount == ( TickType_t ) 0U ) /*lint !e774 'if' does not always evaluate to false as it is looking for an overflow. */
{ {
{ List_t * pxTemp; (__builtin_expect(!(( ( ( ( pxDelayedTaskList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? ( ( BaseType_t ) 1 ) : ( ( BaseType_t ) 0 ) ) )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3686, "( ( ( ( pxDelayedTaskList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? ( ( BaseType_t ) 1 ) : ( ( BaseType_t ) 0 ) ) )") : (void)0); pxTemp = pxDelayedTaskList; pxDelayedTaskList = pxOverflowDelayedTaskList; pxOverflowDelayedTaskList = pxTemp; xNumOfOverflows++; prvResetNextTaskUnblockTime(); }; { List_t * pxTemp; (__builtin_expect(!(( ( ( ( pxDelayedTaskList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? ( ( BaseType_t ) 1 ) : ( ( BaseType_t ) 0 ) ) )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3699, "( ( ( ( pxDelayedTaskList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? ( ( BaseType_t ) 1 ) : ( ( BaseType_t ) 0 ) ) )") : (void)0); pxTemp = pxDelayedTaskList; pxDelayedTaskList = pxOverflowDelayedTaskList; pxOverflowDelayedTaskList = pxTemp; xNumOfOverflows++; prvResetNextTaskUnblockTime(); };
} }
else else
{ {
@ -12854,13 +12867,13 @@ BaseType_t xTaskIncrementTick( void )
return xSwitchRequired; return xSwitchRequired;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 3898 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3911 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 3922 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3935 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 3947 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3960 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 3980 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 3993 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vTaskSwitchContext( BaseType_t xCoreID ) void vTaskSwitchContext( BaseType_t xCoreID )
@ -12878,7 +12891,7 @@ void vTaskSwitchContext( BaseType_t xCoreID )
{ {
/* vTaskSwitchContext() must never be called from within a critical section. /* vTaskSwitchContext() must never be called from within a critical section.
* This is not necessarily true for vanilla FreeRTOS, but it is for this SMP port. */ * This is not necessarily true for vanilla FreeRTOS, but it is for this SMP port. */
(__builtin_expect(!(xTaskGetCurrentTaskHandle()->uxCriticalNesting == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 3997, "xTaskGetCurrentTaskHandle()->uxCriticalNesting == 0") : (void)0); (__builtin_expect(!(xTaskGetCurrentTaskHandle()->uxCriticalNesting == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4010, "xTaskGetCurrentTaskHandle()->uxCriticalNesting == 0") : (void)0);
if( uxSchedulerSuspended != ( UBaseType_t ) ( ( BaseType_t ) 0 ) ) if( uxSchedulerSuspended != ( UBaseType_t ) ( ( BaseType_t ) 0 ) )
{ {
@ -12890,7 +12903,7 @@ void vTaskSwitchContext( BaseType_t xCoreID )
{ {
xYieldPendings[ xCoreID ] = ( ( BaseType_t ) 0 ); xYieldPendings[ xCoreID ] = ( ( BaseType_t ) 0 );
; ;
// # 4038 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4051 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/* Check for stack overflow, if configured. */ /* Check for stack overflow, if configured. */
{ const uint32_t * const pulStack = ( uint32_t * ) xTaskGetCurrentTaskHandle()->pxStack; const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; if( ( pulStack[ 0 ] != ulCheckValue ) || ( pulStack[ 1 ] != ulCheckValue ) || ( pulStack[ 2 ] != ulCheckValue ) || ( pulStack[ 3 ] != ulCheckValue ) ) { vApplicationStackOverflowHook( ( TaskHandle_t ) xTaskGetCurrentTaskHandle(), xTaskGetCurrentTaskHandle()->pcTaskName ); } }; { const uint32_t * const pulStack = ( uint32_t * ) xTaskGetCurrentTaskHandle()->pxStack; const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; if( ( pulStack[ 0 ] != ulCheckValue ) || ( pulStack[ 1 ] != ulCheckValue ) || ( pulStack[ 2 ] != ulCheckValue ) || ( pulStack[ 3 ] != ulCheckValue ) ) { vApplicationStackOverflowHook( ( TaskHandle_t ) xTaskGetCurrentTaskHandle(), xTaskGetCurrentTaskHandle()->pcTaskName ); } };
@ -12907,7 +12920,7 @@ void vTaskSwitchContext( BaseType_t xCoreID )
; ;
/* After the new task is switched in, update the global errno. */ /* After the new task is switched in, update the global errno. */
// # 4072 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4085 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
} }
vPortRecursiveLock(0, spin_lock_instance(14), ( ( BaseType_t ) 0 )); vPortRecursiveLock(0, spin_lock_instance(14), ( ( BaseType_t ) 0 ));
@ -12918,7 +12931,7 @@ void vTaskSwitchContext( BaseType_t xCoreID )
void vTaskPlaceOnEventList( List_t * const pxEventList, void vTaskPlaceOnEventList( List_t * const pxEventList,
const TickType_t xTicksToWait ) const TickType_t xTicksToWait )
{ {
(__builtin_expect(!(pxEventList), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4082, "pxEventList") : (void)0); (__builtin_expect(!(pxEventList), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4095, "pxEventList") : (void)0);
/* THIS FUNCTION MUST BE CALLED WITH EITHER INTERRUPTS DISABLED OR THE /* THIS FUNCTION MUST BE CALLED WITH EITHER INTERRUPTS DISABLED OR THE
* SCHEDULER SUSPENDED AND THE QUEUE BEING ACCESSED LOCKED. */ * SCHEDULER SUSPENDED AND THE QUEUE BEING ACCESSED LOCKED. */
@ -12937,11 +12950,11 @@ void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
const TickType_t xItemValue, const TickType_t xItemValue,
const TickType_t xTicksToWait ) const TickType_t xTicksToWait )
{ {
(__builtin_expect(!(pxEventList), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4101, "pxEventList") : (void)0); (__builtin_expect(!(pxEventList), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4114, "pxEventList") : (void)0);
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by /* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
* the event groups implementation. */ * the event groups implementation. */
(__builtin_expect(!(uxSchedulerSuspended != 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4105, "uxSchedulerSuspended != 0") : (void)0); (__builtin_expect(!(uxSchedulerSuspended != 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4118, "uxSchedulerSuspended != 0") : (void)0);
/* Store the item value in the event list item. It is safe to access the /* Store the item value in the event list item. It is safe to access the
* event list item here as interrupts won't access the event list item of a * event list item here as interrupts won't access the event list item of a
@ -12965,7 +12978,7 @@ void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
TickType_t xTicksToWait, TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely ) const BaseType_t xWaitIndefinitely )
{ {
(__builtin_expect(!(pxEventList), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4129, "pxEventList") : (void)0); (__builtin_expect(!(pxEventList), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4142, "pxEventList") : (void)0);
/* This function should not be called by application code hence the /* This function should not be called by application code hence the
* 'Restricted' in its name. It is not part of the public API. It is * 'Restricted' in its name. It is not part of the public API. It is
@ -13013,14 +13026,14 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
* This function assumes that a check has already been made to ensure that * This function assumes that a check has already been made to ensure that
* pxEventList is not empty. */ * pxEventList is not empty. */
pxUnblockedTCB = ( ( &( ( pxEventList )->xListEnd ) )->pxNext->pvOwner ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */ pxUnblockedTCB = ( ( &( ( pxEventList )->xListEnd ) )->pxNext->pvOwner ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
(__builtin_expect(!(pxUnblockedTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4177, "pxUnblockedTCB") : (void)0); (__builtin_expect(!(pxUnblockedTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4190, "pxUnblockedTCB") : (void)0);
( void ) uxListRemove( &( pxUnblockedTCB->xEventListItem ) ); ( void ) uxListRemove( &( pxUnblockedTCB->xEventListItem ) );
if( uxSchedulerSuspended == ( UBaseType_t ) ( ( BaseType_t ) 0 ) ) if( uxSchedulerSuspended == ( UBaseType_t ) ( ( BaseType_t ) 0 ) )
{ {
( void ) uxListRemove( &( pxUnblockedTCB->xStateListItem ) ); ( void ) uxListRemove( &( pxUnblockedTCB->xStateListItem ) );
; { if( ( ( pxUnblockedTCB )->uxPriority ) > uxTopReadyPriority ) { uxTopReadyPriority = ( ( pxUnblockedTCB )->uxPriority ); } }; vListInsertEnd( &( pxReadyTasksLists[ ( pxUnblockedTCB )->uxPriority ] ), &( ( pxUnblockedTCB )->xStateListItem ) ); ; ; { if( ( ( pxUnblockedTCB )->uxPriority ) > uxTopReadyPriority ) { uxTopReadyPriority = ( ( pxUnblockedTCB )->uxPriority ); } }; vListInsertEnd( &( pxReadyTasksLists[ ( pxUnblockedTCB )->uxPriority ] ), &( ( pxUnblockedTCB )->xStateListItem ) ); ;
// # 4198 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4211 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
else else
{ {
@ -13050,7 +13063,7 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by /* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
* the event flags implementation. */ * the event flags implementation. */
(__builtin_expect(!(uxSchedulerSuspended != ( ( BaseType_t ) 0 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4227, "uxSchedulerSuspended != ( ( BaseType_t ) 0 )") : (void)0); (__builtin_expect(!(uxSchedulerSuspended != ( ( BaseType_t ) 0 )), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4240, "uxSchedulerSuspended != ( ( BaseType_t ) 0 )") : (void)0);
/* Store the new item value in the event list. */ /* Store the new item value in the event list. */
( ( pxEventListItem )->xItemValue = ( xItemValue | 0x80000000UL ) ); ( ( pxEventListItem )->xItemValue = ( xItemValue | 0x80000000UL ) );
@ -13058,9 +13071,9 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
/* Remove the event list form the event flag. Interrupts do not access /* Remove the event list form the event flag. Interrupts do not access
* event flags. */ * event flags. */
pxUnblockedTCB = ( ( pxEventListItem )->pvOwner ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */ pxUnblockedTCB = ( ( pxEventListItem )->pvOwner ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
(__builtin_expect(!(pxUnblockedTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4235, "pxUnblockedTCB") : (void)0); (__builtin_expect(!(pxUnblockedTCB), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4248, "pxUnblockedTCB") : (void)0);
( void ) uxListRemove( pxEventListItem ); ( void ) uxListRemove( pxEventListItem );
// # 4252 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4265 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/* Remove the task from the delayed list and add it to the ready list. The /* Remove the task from the delayed list and add it to the ready list. The
* scheduler is suspended so interrupts will not be accessing the ready * scheduler is suspended so interrupts will not be accessing the ready
* lists. */ * lists. */
@ -13079,7 +13092,7 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )
{ {
(__builtin_expect(!(pxTimeOut), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4270, "pxTimeOut") : (void)0); (__builtin_expect(!(pxTimeOut), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4283, "pxTimeOut") : (void)0);
vTaskEnterCritical(); vTaskEnterCritical();
{ {
pxTimeOut->xOverflowCount = xNumOfOverflows; pxTimeOut->xOverflowCount = xNumOfOverflows;
@ -13102,8 +13115,8 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
{ {
BaseType_t xReturn; BaseType_t xReturn;
(__builtin_expect(!(pxTimeOut), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4293, "pxTimeOut") : (void)0); (__builtin_expect(!(pxTimeOut), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4306, "pxTimeOut") : (void)0);
(__builtin_expect(!(pxTicksToWait), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4294, "pxTicksToWait") : (void)0); (__builtin_expect(!(pxTicksToWait), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4307, "pxTicksToWait") : (void)0);
vTaskEnterCritical(); vTaskEnterCritical();
{ {
@ -13225,7 +13238,7 @@ void vTaskMissedYield( void )
* *
* @todo additional conditional compiles to remove this function. * @todo additional conditional compiles to remove this function.
*/ */
// # 4476 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4489 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/* /*
* ----------------------------------------------------------- * -----------------------------------------------------------
* The Idle task. * The Idle task.
@ -13255,7 +13268,7 @@ static void prvIdleTask( void * pvParameters )
/* See if any tasks have deleted themselves - if so then the idle task /* See if any tasks have deleted themselves - if so then the idle task
* is responsible for freeing the deleted task's TCB and stack. */ * is responsible for freeing the deleted task's TCB and stack. */
prvCheckTasksWaitingTermination(); prvCheckTasksWaitingTermination();
// # 4517 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4530 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
/* When using preemption tasks of equal priority will be /* When using preemption tasks of equal priority will be
* timesliced. If a task that is sharing the idle priority is ready * timesliced. If a task that is sharing the idle priority is ready
@ -13276,16 +13289,16 @@ static void prvIdleTask( void * pvParameters )
; ;
} }
} }
// # 4553 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4566 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/* This conditional compilation should use inequality to 0, not equality /* This conditional compilation should use inequality to 0, not equality
* to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when * to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when
* user defined low power mode implementations require * user defined low power mode implementations require
* configUSE_TICKLESS_IDLE to be set to a value other than 1. */ * configUSE_TICKLESS_IDLE to be set to a value other than 1. */
// # 4618 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4631 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 4668 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4681 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -13299,7 +13312,7 @@ static void prvIdleTask( void * pvParameters )
if( xIndex < 5 ) if( xIndex < 5 )
{ {
pxTCB = ( ( ( xTaskToSet ) == 0 ) ? xTaskGetCurrentTaskHandle() : ( xTaskToSet ) ); pxTCB = ( ( ( xTaskToSet ) == 0 ) ? xTaskGetCurrentTaskHandle() : ( xTaskToSet ) );
(__builtin_expect(!(pxTCB != 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4681, "pxTCB != 0") : (void)0); (__builtin_expect(!(pxTCB != 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 4694, "pxTCB != 0") : (void)0);
pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue; pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue;
} }
} }
@ -13330,7 +13343,7 @@ static void prvIdleTask( void * pvParameters )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 4728 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4741 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static void prvInitialiseTaskLists( void ) static void prvInitialiseTaskLists( void )
@ -13432,7 +13445,7 @@ static void prvCheckTasksWaitingTermination( void )
{ {
pxTaskStatus->uxBasePriority = pxTCB->uxBasePriority; pxTaskStatus->uxBasePriority = pxTCB->uxBasePriority;
} }
// # 4840 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 4853 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
pxTaskStatus->ulRunTimeCounter = 0; pxTaskStatus->ulRunTimeCounter = 0;
} }
@ -13563,7 +13576,7 @@ static void prvCheckTasksWaitingTermination( void )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 5009 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 5022 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -13620,7 +13633,7 @@ static void prvCheckTasksWaitingTermination( void )
free( (void*) pxTCB->pxStack); free( (void*) pxTCB->pxStack);
free( (void*) pxTCB); free( (void*) pxTCB);
} }
// # 5092 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 5105 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
@ -13825,8 +13838,8 @@ static void prvResetNextTaskUnblockTime( void )
* If the mutex is held by a task then it cannot be given from an * If the mutex is held by a task then it cannot be given from an
* interrupt, and if a mutex is given by the holding task then it must * interrupt, and if a mutex is given by the holding task then it must
* be the running state task. */ * be the running state task. */
(__builtin_expect(!(pxTCB == xTaskGetCurrentTaskHandle()), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5296, "pxTCB == xTaskGetCurrentTaskHandle()") : (void)0); (__builtin_expect(!(pxTCB == xTaskGetCurrentTaskHandle()), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5309, "pxTCB == xTaskGetCurrentTaskHandle()") : (void)0);
(__builtin_expect(!(pxTCB->uxMutexesHeld), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5297, "pxTCB->uxMutexesHeld") : (void)0); (__builtin_expect(!(pxTCB->uxMutexesHeld), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5310, "pxTCB->uxMutexesHeld") : (void)0);
( pxTCB->uxMutexesHeld )--; ( pxTCB->uxMutexesHeld )--;
/* Has the holder of the mutex inherited the priority of another /* Has the holder of the mutex inherited the priority of another
@ -13912,7 +13925,7 @@ static void prvResetNextTaskUnblockTime( void )
{ {
/* If pxMutexHolder is not NULL then the holder must hold at least /* If pxMutexHolder is not NULL then the holder must hold at least
* one mutex. */ * one mutex. */
(__builtin_expect(!(pxTCB->uxMutexesHeld), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5383, "pxTCB->uxMutexesHeld") : (void)0); (__builtin_expect(!(pxTCB->uxMutexesHeld), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5396, "pxTCB->uxMutexesHeld") : (void)0);
/* Determine the priority to which the priority of the task that /* Determine the priority to which the priority of the task that
* holds the mutex should be set. This will be the greater of the * holds the mutex should be set. This will be the greater of the
@ -13939,7 +13952,7 @@ static void prvResetNextTaskUnblockTime( void )
/* If a task has timed out because it already holds the /* If a task has timed out because it already holds the
* mutex it was trying to obtain then it cannot of inherited * mutex it was trying to obtain then it cannot of inherited
* its own priority. */ * its own priority. */
(__builtin_expect(!(pxTCB != xTaskGetCurrentTaskHandle()), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5410, "pxTCB != xTaskGetCurrentTaskHandle()") : (void)0); (__builtin_expect(!(pxTCB != xTaskGetCurrentTaskHandle()), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5423, "pxTCB != xTaskGetCurrentTaskHandle()") : (void)0);
/* Disinherit the priority, remembering the previous /* Disinherit the priority, remembering the previous
* priority to facilitate determining the subject task's * priority to facilitate determining the subject task's
@ -14070,7 +14083,7 @@ void vTaskYieldWithinAPI( void )
{ {
/* If pxCurrentTCB->uxCriticalNesting is zero then this function /* If pxCurrentTCB->uxCriticalNesting is zero then this function
* does not match a previous call to vTaskEnterCritical(). */ * does not match a previous call to vTaskEnterCritical(). */
(__builtin_expect(!(xTaskGetCurrentTaskHandle()->uxCriticalNesting > 0U), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5541, "xTaskGetCurrentTaskHandle()->uxCriticalNesting > 0U") : (void)0); (__builtin_expect(!(xTaskGetCurrentTaskHandle()->uxCriticalNesting > 0U), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5554, "xTaskGetCurrentTaskHandle()->uxCriticalNesting > 0U") : (void)0);
if( xTaskGetCurrentTaskHandle()->uxCriticalNesting > 0U ) if( xTaskGetCurrentTaskHandle()->uxCriticalNesting > 0U )
{ {
@ -14120,11 +14133,11 @@ void vTaskYieldWithinAPI( void )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 5617 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 5630 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 5723 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 5736 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
// # 5850 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 5863 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
TickType_t uxTaskResetEventItemValue( void ) TickType_t uxTaskResetEventItemValue( void )
@ -14166,7 +14179,7 @@ TickType_t uxTaskResetEventItemValue( void )
{ {
uint32_t ulReturn; uint32_t ulReturn;
(__builtin_expect(!(uxIndexToWait < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5891, "uxIndexToWait < 1") : (void)0); (__builtin_expect(!(uxIndexToWait < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5904, "uxIndexToWait < 1") : (void)0);
vTaskEnterCritical(); vTaskEnterCritical();
{ {
@ -14240,7 +14253,7 @@ TickType_t uxTaskResetEventItemValue( void )
{ {
BaseType_t xReturn; BaseType_t xReturn;
(__builtin_expect(!(uxIndexToWait < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5965, "uxIndexToWait < 1") : (void)0); (__builtin_expect(!(uxIndexToWait < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 5978, "uxIndexToWait < 1") : (void)0);
vTaskEnterCritical(); vTaskEnterCritical();
{ {
@ -14328,8 +14341,8 @@ TickType_t uxTaskResetEventItemValue( void )
BaseType_t xReturn = ( ( ( BaseType_t ) 1 ) ); BaseType_t xReturn = ( ( ( BaseType_t ) 1 ) );
uint8_t ucOriginalNotifyState; uint8_t ucOriginalNotifyState;
(__builtin_expect(!(uxIndexToNotify < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6053, "uxIndexToNotify < 1") : (void)0); (__builtin_expect(!(uxIndexToNotify < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6066, "uxIndexToNotify < 1") : (void)0);
(__builtin_expect(!(xTaskToNotify), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6054, "xTaskToNotify") : (void)0); (__builtin_expect(!(xTaskToNotify), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6067, "xTaskToNotify") : (void)0);
pxTCB = xTaskToNotify; pxTCB = xTaskToNotify;
vTaskEnterCritical(); vTaskEnterCritical();
@ -14382,7 +14395,7 @@ TickType_t uxTaskResetEventItemValue( void )
/* Should not get here if all enums are handled. /* Should not get here if all enums are handled.
* Artificially force an assert by testing a value the * Artificially force an assert by testing a value the
* compiler can't assume is const. */ * compiler can't assume is const. */
(__builtin_expect(!(xTickCount == ( TickType_t ) 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6107, "xTickCount == ( TickType_t ) 0") : (void)0); (__builtin_expect(!(xTickCount == ( TickType_t ) 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6120, "xTickCount == ( TickType_t ) 0") : (void)0);
break; break;
} }
@ -14397,8 +14410,8 @@ TickType_t uxTaskResetEventItemValue( void )
; { if( ( ( pxTCB )->uxPriority ) > uxTopReadyPriority ) { uxTopReadyPriority = ( ( pxTCB )->uxPriority ); } }; vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); ; ; { if( ( ( pxTCB )->uxPriority ) > uxTopReadyPriority ) { uxTopReadyPriority = ( ( pxTCB )->uxPriority ); } }; vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); ;
/* The task should not have been on an event list. */ /* The task should not have been on an event list. */
(__builtin_expect(!(( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6122, "( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0") : (void)0); (__builtin_expect(!(( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6135, "( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0") : (void)0);
// # 6141 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 6154 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
{ {
prvYieldForTask( pxTCB, ( ( BaseType_t ) 0 ) ); prvYieldForTask( pxTCB, ( ( BaseType_t ) 0 ) );
} }
@ -14431,8 +14444,8 @@ TickType_t uxTaskResetEventItemValue( void )
BaseType_t xReturn = ( ( ( BaseType_t ) 1 ) ); BaseType_t xReturn = ( ( ( BaseType_t ) 1 ) );
UBaseType_t uxSavedInterruptStatus; UBaseType_t uxSavedInterruptStatus;
(__builtin_expect(!(xTaskToNotify), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6173, "xTaskToNotify") : (void)0); (__builtin_expect(!(xTaskToNotify), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6186, "xTaskToNotify") : (void)0);
(__builtin_expect(!(uxIndexToNotify < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6174, "uxIndexToNotify < 1") : (void)0); (__builtin_expect(!(uxIndexToNotify < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6187, "uxIndexToNotify < 1") : (void)0);
/* RTOS ports that support interrupt nesting have the concept of a /* RTOS ports that support interrupt nesting have the concept of a
* maximum system call (or maximum API call) interrupt priority. * maximum system call (or maximum API call) interrupt priority.
@ -14503,7 +14516,7 @@ TickType_t uxTaskResetEventItemValue( void )
/* Should not get here if all enums are handled. /* Should not get here if all enums are handled.
* Artificially force an assert by testing a value the * Artificially force an assert by testing a value the
* compiler can't assume is const. */ * compiler can't assume is const. */
(__builtin_expect(!(xTickCount == ( TickType_t ) 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6245, "xTickCount == ( TickType_t ) 0") : (void)0); (__builtin_expect(!(xTickCount == ( TickType_t ) 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6258, "xTickCount == ( TickType_t ) 0") : (void)0);
break; break;
} }
@ -14514,7 +14527,7 @@ TickType_t uxTaskResetEventItemValue( void )
if( ucOriginalNotifyState == ( ( uint8_t ) 1 ) ) if( ucOriginalNotifyState == ( ( uint8_t ) 1 ) )
{ {
/* The task should not have been on an event list. */ /* The task should not have been on an event list. */
(__builtin_expect(!(( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6256, "( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0") : (void)0); (__builtin_expect(!(( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6269, "( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0") : (void)0);
if( uxSchedulerSuspended == ( UBaseType_t ) ( ( BaseType_t ) 0 ) ) if( uxSchedulerSuspended == ( UBaseType_t ) ( ( BaseType_t ) 0 ) )
{ {
@ -14559,8 +14572,8 @@ TickType_t uxTaskResetEventItemValue( void )
uint8_t ucOriginalNotifyState; uint8_t ucOriginalNotifyState;
UBaseType_t uxSavedInterruptStatus; UBaseType_t uxSavedInterruptStatus;
(__builtin_expect(!(xTaskToNotify), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6301, "xTaskToNotify") : (void)0); (__builtin_expect(!(xTaskToNotify), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6314, "xTaskToNotify") : (void)0);
(__builtin_expect(!(uxIndexToNotify < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6302, "uxIndexToNotify < 1") : (void)0); (__builtin_expect(!(uxIndexToNotify < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6315, "uxIndexToNotify < 1") : (void)0);
/* RTOS ports that support interrupt nesting have the concept of a /* RTOS ports that support interrupt nesting have the concept of a
* maximum system call (or maximum API call) interrupt priority. * maximum system call (or maximum API call) interrupt priority.
@ -14598,7 +14611,7 @@ TickType_t uxTaskResetEventItemValue( void )
if( ucOriginalNotifyState == ( ( uint8_t ) 1 ) ) if( ucOriginalNotifyState == ( ( uint8_t ) 1 ) )
{ {
/* The task should not have been on an event list. */ /* The task should not have been on an event list. */
(__builtin_expect(!(( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6340, "( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0") : (void)0); (__builtin_expect(!(( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6353, "( ( &( pxTCB->xEventListItem ) )->pxContainer ) == 0") : (void)0);
if( uxSchedulerSuspended == ( UBaseType_t ) ( ( BaseType_t ) 0 ) ) if( uxSchedulerSuspended == ( UBaseType_t ) ( ( BaseType_t ) 0 ) )
{ {
@ -14639,7 +14652,7 @@ TickType_t uxTaskResetEventItemValue( void )
TCB_t * pxTCB; TCB_t * pxTCB;
BaseType_t xReturn; BaseType_t xReturn;
(__builtin_expect(!(uxIndexToClear < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6381, "uxIndexToClear < 1") : (void)0); (__builtin_expect(!(uxIndexToClear < 1), 0) ? __assert_rtn ((const char *)-1L, "tasks.c", 6394, "uxIndexToClear < 1") : (void)0);
/* If null is passed in here then it is the calling task that is having /* If null is passed in here then it is the calling task that is having
* its notification state cleared. */ * its notification state cleared. */
@ -14692,7 +14705,7 @@ TickType_t uxTaskResetEventItemValue( void )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
// # 6450 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 6463 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
@ -14768,7 +14781,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
} }
} }
} }
// # 6562 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c" // # 6575 "/Users/reitobia/repos2/FreeRTOS-Kernel/tasks.c"
} }
/* Code below here allows additional code to be inserted into this source file, /* Code below here allows additional code to be inserted into this source file,