Skip to content

Optional PRIVILEGED_DATA wrapper + Partner-Supported-Ports submodule update - #1433

Merged
kstribrnAmzn merged 4 commits into
FreeRTOS:mainfrom
foss-xtensa:xtensa-merge
Aug 26, 2026
Merged

Optional PRIVILEGED_DATA wrapper + Partner-Supported-Ports submodule update#1433
kstribrnAmzn merged 4 commits into
FreeRTOS:mainfrom
foss-xtensa:xtensa-merge

Conversation

@ianstcdns

Copy link
Copy Markdown
Contributor

Support moving PRIVILEGED_DATA via an optional MPU wrapper:

  • User can define portMOVE_PRIVILEGED_DATA as a section attribute to move the PRIVILEGED_DATA section arbitrarily.
  • Allows critical data to be placed in port-specific location for improved performance, notably for cache-coherent SMP.
  • Does not require enabling the full MPU wrappers.

Increment Partner-Supported-Ports submodule to the latest commit

Passed regression testing with 100+ Xtensa configurations (SMP and single-core)

Checklist:

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

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

@sonarqubecloud

Copy link
Copy Markdown

@ianstcdns

Copy link
Copy Markdown
Contributor Author

@AniruddhaKanhere any chance you can review, or point this PR to the appropriate reviewer(s)? Thanks in advance.

@aggarg

aggarg commented Aug 11, 2026

Copy link
Copy Markdown
Member

Instead of adding a new config, how about changing this block to the following:

#ifndef PRIVILEGED_FUNCTION
    #define PRIVILEGED_FUNCTION
#endif

#ifndef PRIVILEGED_DATA
    #define PRIVILEGED_DATA
#endif

#ifndef FREERTOS_SYSTEM_CALL
    #define FREERTOS_SYSTEM_CALL
#endif

This makes it more generic as ports can override whichever macro they need in portmacro.h.

@ianstcdns

Copy link
Copy Markdown
Contributor Author

@aggarg thanks for your suggestion -- it is cleaner and more flexible than my original proposal. I should be able to make this work, although I will need to rearrange some include file ordering within the Xtensa port. I will do some testing and submit a PR to the submodule before updating this PR.

Separately, I'm assuming that updating the pointer to the Partner-Supported-Ports submodule through a PR like this is acceptable, but please LMK if there's a preferred procedure.

@aggarg

aggarg commented Aug 11, 2026

Copy link
Copy Markdown
Member

Separately, I'm assuming that updating the pointer to the Partner-Supported-Ports submodule through a PR like this is acceptable, but please LMK if there's a preferred procedure.

Yes, this is totally acceptable.

@ianstcdns

Copy link
Copy Markdown
Contributor Author

@aggarg updated PR with the changes you proposed, and bumped Partner-Supported-Ports reference. Ready for review again. Thanks.

@aggarg

aggarg commented Aug 24, 2026

Copy link
Copy Markdown
Member

@ianstcdns Would you please rebase on top of main?

- User can define portMOVE_PRIVILEGED_DATA as a section
  attribute to move the PRIVILEGED_DATA section arbitrarily.
- Allows critical data to be placed in port-specific location for
  improved performance, notably for cache-coherent SMP.
- Does not require enabling the full MPU wrappers.

Signed-off-by: Ian Thompson <ianst@cadence.com>
- Instead, when MPU wrappers are not used, allow port to override
  PRIVILEGED_FUNCTION, PRIVILEGED_DATA, or FREERTOS_SYSTEM_CALL
  selectively, permitting custom section placement at link-time.
- Allows critical data to be placed in port-specific location for
  improved performance, notably for cache-coherent SMP.
- Does not require enabling the full MPU wrappers.

Signed-off-by: Ian Thompson <ianst@cadence.com>
@sonarqubecloud

Copy link
Copy Markdown

@ianstcdns

Copy link
Copy Markdown
Contributor Author

@aggarg PR rebased onto main; no other changes. Would it also be helpful if I squash the commits, or is that typically done when merging the PR? Thanks again.

@ianstcdns

Copy link
Copy Markdown
Contributor Author

@AniruddhaKanhere @patrzhan any chance you could review? This is a follow-up PR to FreeRTOS/FreeRTOS-Kernel-Partner-Supported-Ports#32 ... thanks in advance

@kstribrnAmzn
kstribrnAmzn merged commit 8be86d4 into FreeRTOS:main Aug 26, 2026
16 of 17 checks passed
ianstcdns added a commit to foss-xtensa/FreeRTOS-Kernel that referenced this pull request Aug 26, 2026
…update (FreeRTOS#1433)

- Instead, when MPU wrappers are not used, allow port to override
  PRIVILEGED_FUNCTION, PRIVILEGED_DATA, or FREERTOS_SYSTEM_CALL
  selectively, permitting custom section placement at link-time.
- Allows critical data to be placed in port-specific location for
  improved performance, notably for cache-coherent SMP.
- Does not require enabling the full MPU wrappers.
ianstcdns added a commit to foss-xtensa/FreeRTOS-Kernel that referenced this pull request Aug 26, 2026
- Instead, when MPU wrappers are not used, allow port to override
  PRIVILEGED_FUNCTION, PRIVILEGED_DATA, or FREERTOS_SYSTEM_CALL
  selectively, permitting custom section placement at link-time.
- Allows critical data to be placed in port-specific location for
  improved performance, notably for cache-coherent SMP.
- Does not require enabling the full MPU wrappers.
ianstcdns added a commit to foss-xtensa/FreeRTOS-Kernel that referenced this pull request Aug 26, 2026
- Instead, when MPU wrappers are not used, allow port to override
  PRIVILEGED_FUNCTION, PRIVILEGED_DATA, or FREERTOS_SYSTEM_CALL
  selectively, permitting custom section placement at link-time.
- Allows critical data to be placed in port-specific location for
  improved performance, notably for cache-coherent SMP.
- Does not require enabling the full MPU wrappers.
ianstcdns added a commit to foss-xtensa/FreeRTOS-Kernel that referenced this pull request Aug 26, 2026
- Instead, when MPU wrappers are not used, allow port to override
  PRIVILEGED_FUNCTION, PRIVILEGED_DATA, or FREERTOS_SYSTEM_CALL
  selectively, permitting custom section placement at link-time.
- Allows critical data to be placed in port-specific location for
  improved performance, notably for cache-coherent SMP.
- Does not require enabling the full MPU wrappers.

Cherry pick + merge required to maintain submodule pointers.
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