[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/20251231-rwonce-v1-0-702a10b85278@google.com/
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(-)
--
2.51.0