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/arm64: generate error if context size is not aligned to 16bytes #15758

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

XuNeo
Copy link
Contributor

@XuNeo XuNeo commented Feb 5, 2025

Note: Please adhere to Contributing Guidelines.

Summary

Make sure the registers context size is aligned to 16bytes as required by armv8-a.
This issue has been reported earlier, thus make sense to make sure it won't happen in future.

Impact

No impact on existing code.

Testing

Tested with qemu build and pass.

 cmake -Bbuild -GNinja -DBOARD_CONFIG=qemu-armv8a:nsh_smp nuttx

If ARM64_CONTEXT_REGS is configured to wrong value like 37. It reports error.

In file included from /home/neo/projects/nuttx/nuttx/include/nuttx/irq.h:39,
                 from /home/neo/projects/nuttx/nuttx/sched/signal/sig_allocpendingsigaction.c:32:
/home/neo/projects/nuttx/build/include/arch/irq.h:165:4: error: #error "ARM64_CONTEXT_REGS must be even to make stack aligned to 16 bytes"
  165 | #  error "ARM64_CONTEXT_REGS must be even to make stack aligned to 16 bytes"
      |    ^~~~~
ninja: build stopped: subcommand failed

@github-actions github-actions bot added Arch: arm64 Issues related to ARM64 (64-bit) architecture Size: XS The size of the change in this PR is very small labels Feb 5, 2025
arch/arm64/include/irq.h Outdated Show resolved Hide resolved
Make sure the registers context size is aligned to 16bytes as required by armv8-a.
This issue has been reported earlier, thus make sense to make sure it won't happen in future.

Signed-off-by: Neo Xu <[email protected]>
@XuNeo XuNeo force-pushed the arm64-context-align branch from c024783 to 85e7cdb Compare February 5, 2025 03:38
@anchao anchao merged commit ca92c20 into apache:master Feb 5, 2025
12 checks passed
@XuNeo XuNeo deleted the arm64-context-align branch February 5, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm64 Issues related to ARM64 (64-bit) architecture Size: XS The size of the change in this PR is very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants