FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.76k stars 1.12k forks source link

Add vApplicationGetPassiveIdleTaskMemory for SMP #890

Closed chinglee-iot closed 11 months ago

chinglee-iot commented 11 months ago

Description

Compatibility update for get idle task memory. The prototype for vApplicationGetIdleTaskMemory is different for single core and SMP due to the passive idle task memory.

The original implementation.

#if configNUMBER_OF_CORES == 1
    void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
                                        StackType_t ** ppxIdleTaskStackBuffer,
                                        uint32_t * pulIdleTaskStackSize );
#else
    void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
                                        StackType_t ** ppxIdleTaskStackBuffer,
                                        uint32_t * pulIdleTaskStackSize,
                                        BaseType_t xCoreID );
#endif

This brings compatibility problem for single core and SMP. Compile option #if configNUMBER_OF_CORES == 1 has to be used in application to built with single core and SMP. This PR tries to reduce the compile option usage for vApplicationGetIdleTaskMemory such that a SMP application can be built with configNUMBER_OF_CORES == 1 without any modification.

In this PR

Update API prototype with the following:

void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
                                    StackType_t ** ppxIdleTaskStackBuffer,
                                    uint32_t * pulIdleTaskStackSize );

#if ( configNUMBER_OF_CORES > 1 )
    void vApplicationGetPassiveIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
                                               StackType_t ** ppxIdleTaskStackBuffer,
                                               uint32_t * pulIdleTaskStackSize,
                                               BaseType_t xPassiveIdleTaskIndex );
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */

Test Steps

N/A

Checklist:

Related Issue

834

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sonarcloud[bot] commented 11 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication