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

arch: arm: cortex_m: pm_s2ram: fix system_off rv as rv of s2ram_suspend #80642

Conversation

HesselM
Copy link
Contributor

@HesselM HesselM commented Oct 30, 2024

Fixes a bug with overwriting the r0 register, introduced by #77277

arch/arm/core/cortex_m/pm_s2ram.S Outdated Show resolved Hide resolved
arch/arm/core/cortex_m/pm_s2ram.S Outdated Show resolved Hide resolved
The return value of the system_off call is overwritten by the the call to
pm_s2ram_mark_check_and_clear. As arch_pm_s2ram_suspend needs to specify
why system_off failed, we need to make sure the rv of system_off is moved
to a safe register before calling pm_s2ram_mark_check_and_clear and moved
to r0 als rv of arch_pm_s2ram_suspend when the suspend call exits.

Signed-off-by: Hessel van der Molen <[email protected]>
@HesselM HesselM force-pushed the main-zephyr_pr-s2ram_stack_systemoff branch from af3877c to 30588e2 Compare October 31, 2024 07:42
@HesselM HesselM requested a review from stephanosio October 31, 2024 13:05
Copy link
Collaborator

@mathieuchopstm mathieuchopstm left a comment

Choose a reason for hiding this comment

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

Minor detail, otherwise LGTM.

Comment on lines +98 to +100
/* Move the stored return value of system_off back to r0,
* setting it as return value for this function.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit:

Suggested change
/* Move the stored return value of system_off back to r0,
* setting it as return value for this function.
*/
/*
* Move the stored return value of system_off back to r0,
* setting it as return value for this function.
*/

@fabiobaltieri fabiobaltieri merged commit 8316f09 into zephyrproject-rtos:main Jan 3, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants