rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] rust: Add i8 and i16 atomic support
@ 2025-11-15  5:03 FUJITA Tomonori
  2025-11-15  5:03 ` [PATCH v1 1/3] rust: sync: Add smp_store_release/smp_load_acquire helpers FUJITA Tomonori
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: FUJITA Tomonori @ 2025-11-15  5:03 UTC (permalink / raw)
  To: boqun.feng, ojeda, alex.gaynor, peterz, will
  Cc: a.hindborg, aliceryhl, bjorn3_gh, dakr, gary, lossin,
	mark.rutland, rust-for-linux, tmgross

This adds Atomic<i8> and Atomic<i16> support; including
load/store(Relaxed) and load(Acquire)/store(Release) operations.

Relaxed operations can be implemented purely in Rust using
read_volatile() and write_volatile(), equivalent to C's
READ_ONCE/WRITE_ONCE macros.

load(Acquire)/store(Release) use smp_load_acquire and
smp_store_release helpers. These helpers internally use the
appropriate architecture-specific instructions.

FUJITA Tomonori (3):
  rust: sync: Add smp_store_release/smp_load_acquire helpers
  rust: sync: atomic: Add i8 and i16 support (load and store)
  rust: sync: atomic: Add store_release/load_acquire tests

 rust/helpers/barrier.c               | 24 ++++++++
 rust/kernel/sync/atomic/internal.rs  | 85 ++++++++++++++++++++++++++++
 rust/kernel/sync/atomic/predefine.rs | 24 +++++++-
 3 files changed, 132 insertions(+), 1 deletion(-)


base-commit: 7a0892d2836e12cc61b6823f888629a3eb64e268
-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-15 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-15  5:03 [PATCH v1 0/3] rust: Add i8 and i16 atomic support FUJITA Tomonori
2025-11-15  5:03 ` [PATCH v1 1/3] rust: sync: Add smp_store_release/smp_load_acquire helpers FUJITA Tomonori
2025-11-15  5:22   ` Boqun Feng
2025-11-15  6:22     ` FUJITA Tomonori
2025-11-15  7:01       ` Boqun Feng
2025-11-15 13:23         ` FUJITA Tomonori
2025-11-15  5:03 ` [PATCH v1 2/3] rust: sync: atomic: Add i8 and i16 support (load and store) FUJITA Tomonori
2025-11-15  5:03 ` [PATCH v1 3/3] rust: sync: atomic: Add store_release/load_acquire tests FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).