]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: Introduce atomic API helpers
authorBoqun Feng <boqun.feng@gmail.com>
Fri, 5 Sep 2025 04:41:28 +0000 (21:41 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 15 Sep 2025 07:38:32 +0000 (09:38 +0200)
commitfdd7c7e0d2ab3987882c570612d4622f437292c7
tree5dae1d657441d24ef1bf37a48191a8f0a6960ecc
parent76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c
rust: Introduce atomic API helpers

In order to support LKMM atomics in Rust, add rust_helper_* for atomic
APIs. These helpers ensure the implementation of LKMM atomics in Rust is
the same as in C. This could save the maintenance burden of having two
similar atomic implementations in asm.

Originally-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/all/20250719030827.61357-2-boqun.feng@gmail.com/
rust/helpers/atomic.c [new file with mode: 0644]
rust/helpers/helpers.c
scripts/atomic/gen-atomics.sh
scripts/atomic/gen-rust-atomic-helpers.sh [new file with mode: 0755]