Skip to content

Provide Rust atomic helpers over raw pointers

Boqun Feng linux-fsdevel lkml rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rust: sync: atomic: Remove bound `T: Sync` for `Atomci::from_ptr()`rust/kernel/sync/atomic.rs+1 -43 replies
2/2rust: sync: atomic: Add atomic operation helpers over raw pointersrust/kernel/sync/atomic.rs rust/kernel/sync/atomic/predefine.rs+150 -018 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAlice RyhlGary Guo
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Provide Rust atomic helpers over raw pointers

[1] indicates that there might be need for Rust to synchronize with C over atomic, currently the recommendation is using Atomic::from_ptr().op(), however, it's more convenient to have helper wrapper that directly perform operation over pointers. Hence add them for load()/store()/xchg()/cmpxgh().

While working on this, I also found an issue in from_ptr(), therefore fix it.

[1]: https://lore.kernel.org/rust-for-linux/[email protected]/

Regards,
Boqun

Boqun Feng (2):
rust: sync: atomic: Remove bound T: Sync for Atomci::from_ptr()
rust: sync: atomic: Add atomic operation helpers over raw pointers

 rust/kernel/sync/atomic.rs           | 109 ++++++++++++++++++++++++++-
 rust/kernel/sync/atomic/predefine.rs |  46 +++++++++++
 2 files changed, 151 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0