Skip to content

cortex-M ports: Clarify hardware-saved exception frame size variable … - #2

Closed
DajanaV wants to merge 1 commit into
mainPR1314from
headPR1314
Closed

DajanaV wants to merge 1 commit into
mainPR1314from
headPR1314

Conversation

@DajanaV

@DajanaV DajanaV commented Dec 3, 2025

Copy link
Copy Markdown

…(FreeRTOS#1314)

  • cortex-M ports: Clarify hardware-saved exception frame size variable
  • Rename ulStackFrameSize to ulHardwareSavedExceptionFrameSize to reflect the hardware-saved exception frame (8 or 26 words based on FPU/lazy stacking).
  • Add comments explaining standard vs extended frames.
  • Apply across Cortex-M ports.
  • No functional change, improves readability.
  • kernel-checker-script: Modify Arm copyright header regex

Arm's copyright header regex is modified with the following:

  • Accept both single year copyright headers (e.g., "2024") and year range copyright headers (e.g., "2024-2025").

  • Accept both single-line copyright header and also multi-line header.

  • Add the escape backslash to accept only literal dot not any character.


Description

Test Steps

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.

…reeRTOS#1314)

* cortex-M ports: Clarify hardware-saved exception frame size variable

- Rename ulStackFrameSize to ulHardwareSavedExceptionFrameSize to
reflect the hardware-saved exception frame (8 or 26 words based
on FPU/lazy stacking).
- Add comments explaining standard vs extended frames.
- Apply across Cortex-M ports.
- No functional change, improves readability.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* kernel-checker-script: Modify Arm copyright header regex

Arm's copyright header regex is modified with the following:

* Accept both single year copyright headers (e.g., "2024")
and year range copyright headers (e.g., "2024-2025").

* Accept both single-line copyright header and also
multi-line header.

* Add the escape backslash to accept only literal dot
not any character.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>

---------

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@loci-review

loci-review Bot commented Dec 3, 2025

Copy link
Copy Markdown

Explore the complete analysis inside the Version Insights

Performance Analysis Summary

Pull Request #2: Variable Renaming for Code Clarity

This PR renames ulStackFrameSize to ulHardwareSavedExceptionFrameSize across 23 ARM Cortex-M port files and adds documentation comments explaining hardware exception frame structures. The changes affect system call handlers in MPU-enabled ports (ARM_CM0, ARM_CM3_MPU, ARM_CM4_MPU, ARM_CM23, ARM_CM33, ARM_CM35P, ARM_CM55, ARM_CM85 variants).

Performance analysis confirms zero functional impact. Power consumption remains at 43,906 nJ with 0.0% change between versions. No functions exhibit measurable differences in response time or throughput. The compiler generates identical instruction sequences, confirming this is a pure refactoring without runtime overhead.

The variable represents hardware-saved exception frames: 8 words for basic frames (R0-R3, R12, LR, PC, xPSR) or 26 words for extended frames with FPU (additional S0-S15, FPSCR, reserved). The renaming improves code self-documentation without altering stack pointer arithmetic, loop iterations, or FPU detection logic. Modified functions execute during SVC exceptions, handling privileged/unprivileged transitions in MPU configurations, but remain isolated from core kernel operations like task scheduling, interrupt handling, and queue operations.

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