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

Fix IAR alignment issues if __packed has been redefined into a macro. #152

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

LoveKarlsson
Copy link

@LoveKarlsson LoveKarlsson commented Jan 13, 2025

Description

While porting Zephyr to work with IAR tools, a problem was discovered
due to Zephyr defining a macro, __packed, the overrides the IAR keyword
__packed.

The macro is defined to attribute(packed) in Zephyr.

As Zephyr uses mbedtls as an external module, the macro __packed that
Zephyr sets up does not work with the typedefs of unaligned int
types in core/alignment.h.

We therefor save the macro (if set), undefine it, declare the unaligned int types,
and restore the macro afterwards.

When accepted, a backport to the version Zephyr uses will be made.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog not required because: change does not affect generated code in normal use with IAR tools
  • framework PR not required
  • mbedtls PR not required
  • tests not required because: no functionality has been changed

…ined into a macro.

When accepted, a backport to the version Zephyr uses will be made.

Signed-off-by: Lars-Ove Karlsson <[email protected]>
@minosgalanakis minosgalanakis added size-s Estimated task size: small (~2d) needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits needs-ci Needs to pass CI tests and removed needs-ci Needs to pass CI tests labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-s Estimated task size: small (~2d)
Projects
Status: In Development
Development

Successfully merging this pull request may close these issues.

2 participants