mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Moved a number of function prototypes to the appropriate headers.
Removed the StackMacros.h function as previously promised. Fixed a function definition mismatch in a third party port.
This commit is contained in:
parent
386d854e0b
commit
1d68f82f9f
6 changed files with 62 additions and 165 deletions
|
@ -1,131 +0,0 @@
|
||||||
/*
|
|
||||||
* FreeRTOS Kernel V10.3.1
|
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* 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,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* 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
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* http://www.FreeRTOS.org
|
|
||||||
* http://aws.amazon.com/freertos
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef STACK_MACROS_H
|
|
||||||
#define STACK_MACROS_H
|
|
||||||
|
|
||||||
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
|
|
||||||
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Call the stack overflow hook function if the stack of the task being swapped
|
|
||||||
* out is currently overflowed, or looks like it might have overflowed in the
|
|
||||||
* past.
|
|
||||||
*
|
|
||||||
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
|
|
||||||
* the current stack state only - comparing the current top of stack value to
|
|
||||||
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
|
|
||||||
* will also cause the last few stack bytes to be checked to ensure the value
|
|
||||||
* to which the bytes were set when the task was created have not been
|
|
||||||
* overwritten. Note this second test does not guarantee that an overflowed
|
|
||||||
* stack will always be recognised.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
|
|
||||||
|
|
||||||
/* Only the current stack state is to be checked. */
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
|
||||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
|
|
||||||
|
|
||||||
/* Only the current stack state is to be checked. */
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
\
|
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
|
||||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
|
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
|
|
||||||
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
|
|
||||||
\
|
|
||||||
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
|
||||||
( pulStack[ 1 ] != ulCheckValue ) || \
|
|
||||||
( pulStack[ 2 ] != ulCheckValue ) || \
|
|
||||||
( pulStack[ 3 ] != ulCheckValue ) ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
|
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
|
|
||||||
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
|
|
||||||
\
|
|
||||||
\
|
|
||||||
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
|
|
||||||
\
|
|
||||||
/* Has the extremity of the task stack ever been written over? */ \
|
|
||||||
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* Remove stack overflow macro if not being used. */
|
|
||||||
#ifndef taskCHECK_FOR_STACK_OVERFLOW
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* STACK_MACROS_H */
|
|
|
@ -1539,6 +1539,52 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if ( configUSE_TICK_HOOK > 0 )
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <pre>void vApplicationTickHook( void ); </pre>
|
||||||
|
*
|
||||||
|
* This hook function is called in the system tick handler after any OS work is completed.
|
||||||
|
*/
|
||||||
|
void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Callback function prototypes. --------------------------*/
|
||||||
|
#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
|
||||||
|
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <pre>void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName); </pre>
|
||||||
|
*
|
||||||
|
* The application stack overflow hook is called when a stack overflow is detected for a task.
|
||||||
|
*
|
||||||
|
* Details on stack overflow detection can be found here: https://www.freertos.org/Stacks-and-stack-overflow-checking.html
|
||||||
|
*
|
||||||
|
* @param xTask the task that just exceeded its stack boundaries.
|
||||||
|
* @param pcTaskName A character string containing the name of the offending task.
|
||||||
|
*/
|
||||||
|
void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
||||||
|
char * pcTaskName );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
|
|
||||||
|
|
||||||
|
/* If static allocation is supported then the application must provide the
|
||||||
|
* following callback function - which enables the application to optionally
|
||||||
|
* provide the memory that will be used by the idle task as the task's stack
|
||||||
|
* and TCB.
|
||||||
|
* https://www.freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||||
|
*/
|
||||||
|
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
|
||||||
|
StackType_t ** ppxIdleTaskStackBuffer,
|
||||||
|
uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );</pre>
|
* <pre>BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );</pre>
|
||||||
|
|
|
@ -1296,6 +1296,20 @@
|
||||||
*/
|
*/
|
||||||
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
|
|
||||||
|
/* If static allocation is supported then the application must provide the
|
||||||
|
* following callback function - which enables the application to optionally
|
||||||
|
* provide the memory that will be used by the timer task as the task's stack
|
||||||
|
* and TCB.
|
||||||
|
* https://www.freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||||
|
*/
|
||||||
|
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
||||||
|
StackType_t ** ppxTimerTaskStackBuffer,
|
||||||
|
uint32_t * pulTimerTaskStackSize );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions beyond this part are not part of the public API and are intended
|
* Functions beyond this part are not part of the public API and are intended
|
||||||
* for use by the kernel only.
|
* for use by the kernel only.
|
||||||
|
|
3
portable/ThirdParty/CDK/T-HEAD_CK802/port.c
vendored
3
portable/ThirdParty/CDK/T-HEAD_CK802/port.c
vendored
|
@ -139,7 +139,8 @@ void vPortYieldHandler( void )
|
||||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName )
|
__attribute__( ( weak ) ) void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
||||||
|
char * pcTaskName )
|
||||||
{
|
{
|
||||||
for(;;);
|
for(;;);
|
||||||
}
|
}
|
||||||
|
|
21
tasks.c
21
tasks.c
|
@ -402,27 +402,6 @@ PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Callback function prototypes. --------------------------*/
|
|
||||||
#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
|
|
||||||
|
|
||||||
extern void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
|
||||||
char * pcTaskName );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ( configUSE_TICK_HOOK > 0 )
|
|
||||||
|
|
||||||
extern void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
|
||||||
|
|
||||||
extern void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
|
|
||||||
StackType_t ** ppxIdleTaskStackBuffer,
|
|
||||||
uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* File private functions. --------------------------------*/
|
/* File private functions. --------------------------------*/
|
||||||
|
|
||||||
|
|
12
timers.c
12
timers.c
|
@ -144,18 +144,6 @@
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
|
||||||
|
|
||||||
/* If static allocation is supported then the application must provide the
|
|
||||||
* following callback function - which enables the application to optionally
|
|
||||||
* provide the memory that will be used by the timer task as the task's stack
|
|
||||||
* and TCB. */
|
|
||||||
extern void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
|
||||||
StackType_t ** ppxTimerTaskStackBuffer,
|
|
||||||
uint32_t * pulTimerTaskStackSize );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialise the infrastructure used by the timer service task if it has not
|
* Initialise the infrastructure used by the timer service task if it has not
|
||||||
* been initialised already.
|
* been initialised already.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue