mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Feature/fixing clang gnu compiler warnings (#620)
* Adding in ability to support a library for freertos_config and a custom freertos_kernel_port (#558) * Using single name definition for libraries everywhere. (#558) * Supporting backwards compatibility with FREERTOS_CONFIG_FILE_DIRECTORY (#571) * Removing compiler warnings for GNU and Clang. (#571) * Added in documentation on how to consume from a main project. Added default PORT selection for native POSIX and MINGW platforms. * Only adding freertos_config if it exists. Removing auto generation of it from a FREERTOS_CONFIG_FILE_DIRECTORY. * Fixing clang and gnu compiler warnings. * Adding in project information and how to compile for GNU/clang * Fixing compiler issue with unused variable - no need to declare variable. * Adding in compile warnings for linux builds that kernel is okay with using. * Fixing more extra-semi-stmt clang warnings. * Moving definition of hooks into header files if features are enabled. * Fixing formatting with uncrustify. * Fixing merge conflicts with main merge. * Fixing compiler errors due to merge issues and formatting. * Fixing Line feeds. * Adding 'portNORETURN' into portmacros.h. Other Updates based on PR request * Further clean-up of clang and clang-tidy issues. * Removing compiler specific pragmas from common c files. * Fixing missing lexicon entry and uncrustify formatting changes. * Resolving merge issue multiple defnitions of proto for prvIdleTask * Fixing formatting issues that are not covered by uncrustify. Use clang-tidy instead if you want this level of control. * More uncrustify formatting issues. * Fixing extra bracket in #if statement. --------- Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
5d05601045
commit
8cd5451ad5
38 changed files with 260 additions and 172 deletions
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M23"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configTOTAL_MPU_REGIONS == 16 )
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M23"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configTOTAL_MPU_REGIONS == 16 )
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M33"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M33"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M55"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M85"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M23"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configTOTAL_MPU_REGIONS == 16 )
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M23"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configTOTAL_MPU_REGIONS == 16 )
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Scheduler utilities. */
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M33"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M33"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* SVC numbers for various services. */
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Scheduler utilities. */
|
||||
|
|
|
@ -203,6 +203,7 @@ typedef struct MPU_SETTINGS
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* SVC numbers for various services. */
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M55"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M55"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Scheduler utilities. */
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M85"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
#define portARCH_NAME "Cortex-M85"
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,8 +96,8 @@
|
|||
* of their memory address. */
|
||||
typedef struct A_BLOCK_LINK
|
||||
{
|
||||
struct A_BLOCK_LINK * pxNextFreeBlock; /*<< The next free block in the list. */
|
||||
size_t xBlockSize; /*<< The size of the free block. */
|
||||
struct A_BLOCK_LINK * pxNextFreeBlock; /**< The next free block in the list. */
|
||||
size_t xBlockSize; /**< The size of the free block. */
|
||||
} BlockLink_t;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -390,7 +390,7 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
|
|||
{
|
||||
uxAddress += ( portBYTE_ALIGNMENT - 1 );
|
||||
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
|
||||
xTotalHeapSize -= uxAddress - ( portPOINTER_SIZE_TYPE ) ucHeap;
|
||||
xTotalHeapSize -= ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) ucHeap );
|
||||
}
|
||||
|
||||
pucAlignedHeap = ( uint8_t * ) uxAddress;
|
||||
|
@ -402,7 +402,7 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
|
|||
|
||||
/* pxEnd is used to mark the end of the list of free blocks and is inserted
|
||||
* at the end of the heap space. */
|
||||
uxAddress = ( ( portPOINTER_SIZE_TYPE ) pucAlignedHeap ) + xTotalHeapSize;
|
||||
uxAddress = ( portPOINTER_SIZE_TYPE ) ( pucAlignedHeap + xTotalHeapSize );
|
||||
uxAddress -= xHeapStructSize;
|
||||
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
|
||||
pxEnd = ( BlockLink_t * ) uxAddress;
|
||||
|
|
7
portable/ThirdParty/GCC/Posix/port.c
vendored
7
portable/ThirdParty/GCC/Posix/port.c
vendored
|
@ -115,6 +115,9 @@ static void prvPortYieldFromISR( void );
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvFatalError( const char * pcCall,
|
||||
int iErrno ) __attribute__ ((__noreturn__));
|
||||
|
||||
void prvFatalError( const char * pcCall,
|
||||
int iErrno )
|
||||
{
|
||||
fprintf( stderr, "%s: %s\n", pcCall, strerror( iErrno ) );
|
||||
|
@ -141,7 +144,7 @@ portSTACK_TYPE * pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack,
|
|||
*/
|
||||
thread = ( Thread_t * ) ( pxTopOfStack + 1 ) - 1;
|
||||
pxTopOfStack = ( portSTACK_TYPE * ) thread - 1;
|
||||
ulStackSize = ( pxTopOfStack + 1 - pxEndOfStack ) * sizeof( *pxTopOfStack );
|
||||
ulStackSize = ( size_t )( pxTopOfStack + 1 - pxEndOfStack ) * sizeof( *pxTopOfStack );
|
||||
|
||||
thread->pxCode = pxCode;
|
||||
thread->pvParams = pvParameters;
|
||||
|
@ -340,7 +343,7 @@ static uint64_t prvGetTimeNs( void )
|
|||
|
||||
clock_gettime( CLOCK_MONOTONIC, &t );
|
||||
|
||||
return t.tv_sec * 1000000000ULL + t.tv_nsec;
|
||||
return ( uint64_t )t.tv_sec * 1000000000ULL + ( uint64_t )t.tv_nsec;
|
||||
}
|
||||
|
||||
static uint64_t prvStartTimeNs;
|
||||
|
|
2
portable/ThirdParty/GCC/Posix/portmacro.h
vendored
2
portable/ThirdParty/GCC/Posix/portmacro.h
vendored
|
@ -68,6 +68,8 @@ typedef unsigned long TickType_t;
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Architecture specifics. */
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
|
||||
#define portSTACK_GROWTH ( -1 )
|
||||
#define portHAS_STACK_OVERFLOW_CHECKING ( 1 )
|
||||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 8
|
||||
#define portDONT_DISCARD __attribute__( ( used ) )
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
/* 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 */
|
||||
#define portUSE_DIVIDER_SAVE_RESTORE !PICO_DIVIDER_DISABLE_INTERRUPTS
|
||||
|
|
|
@ -335,6 +335,8 @@
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Architecture specifics. */
|
||||
#define portNORETURN __attribute__( ( noreturn ) )
|
||||
|
||||
#define portSTACK_GROWTH ( -1 )
|
||||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue