summaryrefslogtreecommitdiff
path: root/rust/helpers/refcount.c
diff options
context:
space:
mode:
authorBoqun Feng <boqun.feng@gmail.com>2025-09-04 21:41:35 -0700
committerPeter Zijlstra <peterz@infradead.org>2025-09-15 09:38:34 +0200
commit84c6d36bcaf98a8c0533cd334a624d536d20879b (patch)
treeaf84638cc8b0739b4ebdf0ce70dacc89fe8cb428 /rust/helpers/refcount.c
parentd6df37ba918198c0a7f55734c20512431770c4b3 (diff)
rust: sync: atomic: Add Atomic<{usize,isize}>
Add generic atomic support for `usize` and `isize`. Note that instead of mapping directly to `atomic_long_t`, the represention type (`AtomicType::Repr`) is selected based on CONFIG_64BIT. This reduces the necessity of creating `atomic_long_*` helpers, which could save the binary size of kernel if inline helpers are not available. To do so, an internal type `isize_atomic_repr` is defined, it's `i32` in 32bit kernel and `i64` in 64bit kernel. 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> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by: Benno Lossin <lossin@kernel.org> Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev> Link: https://lore.kernel.org/all/20250719030827.61357-9-boqun.feng@gmail.com/
Diffstat (limited to 'rust/helpers/refcount.c')
0 files changed, 0 insertions, 0 deletions