core/lib/atomic_c11: Add __atomic_test_and_set()#21883
core/lib/atomic_c11: Add __atomic_test_and_set()#21883benpicco merged 2 commits intoRIOT-OS:masterfrom
Conversation
This adds a previously missing library implementation for `__atomic_test_and_set()`.
|
For reference: Test output in |
crasbe
left a comment
There was a problem hiding this comment.
Can't really comment about the changes themselves, sorry 😅
mguetschow
left a comment
There was a problem hiding this comment.
Straightforward addition, thanks! Just a question below.
GCC requires symbols to first be declared before they can be renamed. So we move the `#pragma redefine_extname` just to the bottom of the compilation unit. Co-authored-by: crasbe <[email protected]> Co-authored-by: Mikolai Gütschow <[email protected]>
2bead6b to
a32e108
Compare
mguetschow
left a comment
There was a problem hiding this comment.
Looks good, thanks! Trusting your testing :)
|
Is this a 2 ACK kind of PR? 🤔 |
|
Thx a lot ❤️ |
|
@benpicco Do you want a backport? This does fix issues with more recent versions of GCC on niche platforms. To be honest, I would have assume that 8-bit writes on AVR would have been naturally atomic. Maybe an IRQ could fire within the two CPU cycles an 8-bit write takes, practically reordering the writes? |
I've read the comment just now. One might argue so. We have track record of relaxing the 2 ACK policy on small bug fixes, which might apply here. But given that @mguetschow did the ACK and @benpicco hit the merge button, at least two maintainers were involved. |
Contribution description
This adds a previously missing library implementation for
__atomic_test_and_set().Testing procedure
In
master:undefined reference to `__atomic_test_and_set'In this PR
{ "result" : 12302, "ticks" : 1300 }Issues/PRs references
None