-
Notifications
You must be signed in to change notification settings - Fork 8.1k
kernel: atomics: support for 64-bit atomic operations #39531
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
Merged
nashif
merged 8 commits into
zephyrproject-rtos:main
from
cfriedt:issues/39530/kernel-atomics-support-for-64-bit-atomic-operations
Nov 15, 2021
Merged
kernel: atomics: support for 64-bit atomic operations #39531
nashif
merged 8 commits into
zephyrproject-rtos:main
from
cfriedt:issues/39530/kernel-atomics-support-for-64-bit-atomic-operations
Nov 15, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ce9059b to
092f615
Compare
092f615 to
763c900
Compare
42debc6 to
94d9d22
Compare
jukkar
reviewed
Oct 19, 2021
0ab2813 to
eb4f678
Compare
|
This change does not account for the case where |
eb4f678 to
677d3e7
Compare
|
rebased |
With this change, `atomic_t` is 32-bit for 32-bit architectures and 64-bit for 64-bit architectures. More specifically, `sizeof(atomic_t) == sizeof(long)`. Fixes zephyrproject-rtos#39530 Signed-off-by: Christopher Friedt <[email protected]>
By redefining `atomic_t` as `long`, the type is 32-bit on 32-bit architectures and 64-bit on 64-bit architectures. Signed-off-by: Christopher Friedt <[email protected]>
The print specifier for `atomic_t` should be updated to `%ld`, `%lu`, or `%lx` to account for the type change of `atomic_t` to `long`. Signed-off-by: Christopher Friedt <[email protected]>
This driver aliases a regular `int` to `atomic_t` but that should be updated to `long` with the change to `atomic_t`. Added a comment to highlight that the variable was aliased. Signed-off-by: Christopher Friedt <[email protected]>
With the change of `atomic_t` from `int` to `long` there were a few places where there was some type aliasing occuring. Update CMSIS to use `atomic_t` rather than `int` for all atomic operations. Signed-off-by: Christopher Friedt <[email protected]>
e6babdc to
7d4c88c
Compare
|
updated |
The audio/sof Zephyr module needed print specifiers updated for the transition from `int` to `long` for `atomic_t` which supports 32-bit atomics and also 64-bit atomics. Signed-off-by: Christopher Friedt <[email protected]>
This change updates the atomic tests to validate 32-bits on 32-bit architectures and 64-bits on 64-bit architectures. Signed-off-by: Christopher Friedt <[email protected]>
Atomics changed from `int` to `long` and print format specifiers must be updated as well. Signed-off-by: Christopher Friedt <[email protected]>
7d4c88c to
78ff65c
Compare
cfriedt
added a commit
to cfriedt/zephyr
that referenced
this pull request
Nov 16, 2021
Previously, a `uint32_t` was aliased as an `atomic_t`. However, with zephyrproject-rtos#39531, `atomic_t` is now a `long` under the hood, which is 64-bit on 64-bit platforms. Fixes zephyrproject-rtos#40369 Signed-off-by: Christopher Friedt <[email protected]>
cfriedt
added a commit
to cfriedt/zephyr
that referenced
this pull request
Nov 16, 2021
Previously, a `uint32_t` was aliased as an `atomic_t`. However, with zephyrproject-rtos#39531, `atomic_t` is now a `long` under the hood, which is 64-bit on 64-bit platforms. Fixes zephyrproject-rtos#40369 Signed-off-by: Christopher Friedt <[email protected]>
carlescufi
pushed a commit
that referenced
this pull request
Nov 17, 2021
Previously, a `uint32_t` was aliased as an `atomic_t`. However, with #39531, `atomic_t` is now a `long` under the hood, which is 64-bit on 64-bit platforms. Fixes #40369 Signed-off-by: Christopher Friedt <[email protected]>
carlescufi
pushed a commit
that referenced
this pull request
Nov 17, 2021
Previously, a `uint32_t` was aliased as an `atomic_t`. However, with #39531, `atomic_t` is now a `long` under the hood, which is 64-bit on 64-bit platforms. Fixes #40369 Signed-off-by: Christopher Friedt <[email protected]>
cfriedt
added a commit
to cfriedt/zephyr
that referenced
this pull request
Jul 21, 2022
Previously, a `uint32_t` was aliased as an `atomic_t`. However, with zephyrproject-rtos#39531, `atomic_t` is now a `long` under the hood, which is 64-bit on 64-bit platforms. Fixes zephyrproject-rtos#40369 Signed-off-by: Christopher Friedt <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: API
Changes to public APIs
area: Bluetooth Audio
area: Bluetooth Host
Bluetooth Host (excluding BR/EDR)
area: Bluetooth
area: Documentation
area: Kernel
area: Modules
area: Networking
area: Shell
Shell subsystem
area: Tests
Issues related to a particular existing or missing test
manifest
manifest-sof
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds support for 64-bit atomic operations for any machine where
sizeof(long) == 8.Fixes #39530
Depends-on