Skip to content

Conversation

@chinglee-iot
Copy link
Member

@chinglee-iot chinglee-iot commented Nov 13, 2023

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 ) */
  • Update vApplicationGetIdleTaskMemory prototype for SMP. Now SMP and single core use the same prototype for compatibility.
  • Add vApplicationGetPassiveIdleTaskMemory for SMP to get passive idle task memory.

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.

* Update vApplicationGetIdleTaskMemory prototype for SMP. Now SMP and
  single core use the same prototype for compatibility.
* Add vApplicationGetPassiveIdleTaskMemory for SMP to get passive idle
  task memory.
@sonarqubecloud
Copy link

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

@chinglee-iot chinglee-iot merged commit dc09a3d into FreeRTOS:main Nov 16, 2023
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this pull request Apr 18, 2024
* Fix IAR GCC build for Qemu MPS2

* Add removed file

* Add timer function for runtime stats

* Add lexicon entry
@chinglee-iot chinglee-iot deleted the add-get-passive-idle-task-memory branch August 7, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants