hujun260 opened a new pull request, #22305:
URL: https://github.com/apache/nuttx/pull/22305
# arch: use stack alignment macros instead of open-coded bit operations
## Summary
Replace open-coded stack alignment checks and alignment operations with the
common stack alignment macros from `include/nuttx/irq.h`.
The change updates architecture-specific stack setup code to use:
- `STACK_IS_ALIGNED(stack)` for userspace stack alignment checks;
- `STACKFRAME_IS_ALIGNED(...)` for stack-frame alignment checks;
- `STACKFRAME_ALIGN_DOWN(...)` for interrupt stack size alignment.
The affected code covers the architecture `usestack` implementations and the
relevant ARM, ARM64, SPARC, and TriCore internal headers. This improves
readability and keeps stack alignment logic consistent across architectures
without changing the intended alignment requirements.
## Impact
- No user-facing API or Kconfig changes.
- No change to the required stack alignment values.
- No change to stack allocation ownership or stack size calculation logic.
- The change affects architecture-specific kernel build code only.
- The existing Xtensa-specific `INTSTACK_ALIGN_MASK` helpers are
intentionally
unchanged because they are separate from the common `STACK_ALIGN_MASK` and
`STACKFRAME_ALIGN_MASK` expressions addressed by this change.
## Testing
- Verified the cherry-pick result contains no unresolved conflict markers.
- Scanned the architecture sources and confirmed that the targeted open-coded
`STACK_ALIGN_MASK` and `STACKFRAME_ALIGN_MASK` expressions were replaced by
the common alignment macros.
- Ran `git diff HEAD^ --check` successfully.
- Confirmed the working tree is clean after the cherry-pick.
A standalone architecture build was not run: the current unconfigured tree
has
no make target named `arch/avr/src/libarch.a`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]