Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SMP template port and example #900

Merged

Conversation

chinglee-iot
Copy link
Member

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

Add SMP template port and example

Description

The SMP template port shares of the same template port for single core. The port macros and implementation differences are separated by compile option configNUMBER_OF_CORES. Sharing the same port template helps user to identify the port differences between single core and SMP. A sample configuration file for SMP with minimal configuration change is also provided. The example project with cmake is updated to consume the template port and sample configuration to provide compilable project.

The configuration added for SMP is listed below

/******************************************************************************/
/* Scheduling behaviour related definitions. **********************************/
/******************************************************************************/

/* Set configNUMBER_OF_CORES to greater than 1 to enable running one instance of
 * FreeRTOS kernel to schedule tasks across multiple identical processor cores. */
#define configNUMBER_OF_CORES    2

/******************************************************************************/
/* Hook and callback function related definitions. ****************************/
/******************************************************************************/

/* Set the following configUSE_* constants to 1 to include the named hook
 * functionality in the build.  Set to 0 to exclude the hook functionality from the
 * build.  The application writer is responsible for providing the hook function
 * for any set to 1.  See https://www.freertos.org/a00016.html */
#define configUSE_PASSIVE_IDLE_HOOK    0

As single core template port, the port is expected to be used for:

  • Provide a starting point for a SMP port
  • Provide a compilable project for static analysis tool. Since the sample configuration only enable a small set of features to reduce project complexity, a project for static analysis tool may use another configuration to enable more features for coverage.

Test Steps

To build the example project for SMP template port:

cd examples\cmake_example
cmake -S . -B build -DFREERTOS_SMP_EXAMPLE=1
cd build
make

smp_example should be generated in the build folder.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

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

@chinglee-iot chinglee-iot requested a review from a team as a code owner November 24, 2023 06:11
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f8ef5f6) 93.64% compared to head (b8df01c) 93.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #900   +/-   ##
=======================================
  Coverage   93.64%   93.64%           
=======================================
  Files           6        6           
  Lines        3179     3179           
  Branches      885      885           
=======================================
  Hits         2977     2977           
  Misses         95       95           
  Partials      107      107           
Flag Coverage Δ
unittests 93.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ActoryOu
ActoryOu previously approved these changes Nov 24, 2023
Copy link
Member

@ActoryOu ActoryOu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All current changes are good enough as SMP template. Approve in advance.
I'll suggest to have one readme document in examples/sample_configuration/smp to describe the configurations we should take care while setting SMP port.

ActoryOu
ActoryOu previously approved these changes Nov 27, 2023
Skptak
Skptak previously approved these changes Nov 28, 2023
Copy link
Member

@jasonpcarroll jasonpcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add both cmake builds to the CI checks if this has not been done. Then I will approve.

@chinglee-iot chinglee-iot dismissed stale reviews from Skptak and ActoryOu via dd5b9bc November 29, 2023 08:59
kar-rahul-aws
kar-rahul-aws previously approved these changes Nov 29, 2023
shubnil
shubnil previously approved these changes Nov 29, 2023
@chinglee-iot chinglee-iot dismissed stale reviews from kar-rahul-aws and shubnil via b8df01c December 1, 2023 02:44
Copy link

sonarqubecloud bot commented Dec 1, 2023

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually a great idea for how to handle this, thanks for doing this!

@chinglee-iot chinglee-iot merged commit c0ce725 into FreeRTOS:main Dec 4, 2023
17 checks passed
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this pull request Apr 18, 2024
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.

6 participants