public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] rust: Add i8 and i16 atomic support
@ 2025-11-17  0:10 FUJITA Tomonori
  2025-11-17  0:10 ` [PATCH v2 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers FUJITA Tomonori
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: FUJITA Tomonori @ 2025-11-17  0:10 UTC (permalink / raw)
  To: alex.gaynor, boqun.feng, ojeda, 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 are implemented in C's READ_ONCE() and
WRITE_ONCE() macros.

load(Acquire)/store(Release) use C's smp_load_acquire() and
smp_store_release() macros. They internally use the appropriate
architecture-specific instructions.

v2:
- Implement relaxed operations by using C's READ_ONCE/WRITE_ONCE
- Rename smp_load_acquire() and smp_store_release() helpers
- Simplify the macro to generate atomic methods
v1: https://lore.kernel.org/rust-for-linux/20251115050305.3872412-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (4):
  rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release
    helpers
  rust: helpers: Add i8/i16 relaxed atomic helpers
  rust: sync: atomic: Add i8/i16 load and store support
  rust: sync: atomic: Add store_release/load_acquire tests

 rust/helpers/atomic_ext.c            | 44 +++++++++++++++++++++++++
 rust/helpers/helpers.c               |  1 +
 rust/kernel/sync/atomic/internal.rs  | 48 ++++++++++++++++++++++++++++
 rust/kernel/sync/atomic/predefine.rs | 24 +++++++++++++-
 4 files changed, 116 insertions(+), 1 deletion(-)
 create mode 100644 rust/helpers/atomic_ext.c


base-commit: 7a0892d2836e12cc61b6823f888629a3eb64e268
-- 
2.43.0


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

end of thread, other threads:[~2025-12-11  5:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17  0:10 [PATCH v2 0/4] rust: Add i8 and i16 atomic support FUJITA Tomonori
2025-11-17  0:10 ` [PATCH v2 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers FUJITA Tomonori
2025-12-08  3:01   ` Alexandre Courbot
2025-12-08 21:56     ` FUJITA Tomonori
2025-11-17  0:10 ` [PATCH v2 2/4] rust: helpers: Add i8/i16 relaxed atomic helpers FUJITA Tomonori
2025-11-17  0:10 ` [PATCH v2 3/4] rust: sync: atomic: Add i8/i16 load and store support FUJITA Tomonori
2025-12-08  3:08   ` Alexandre Courbot
2025-12-08 23:14     ` FUJITA Tomonori
2025-12-09  0:27       ` Alexandre Courbot
2025-12-09 23:31         ` FUJITA Tomonori
2025-12-10 23:16           ` Boqun Feng
2025-12-11  5:17             ` FUJITA Tomonori
2025-12-10 23:02       ` Boqun Feng
2025-12-11  4:46         ` FUJITA Tomonori
2025-11-17  0:10 ` [PATCH v2 4/4] rust: sync: atomic: Add store_release/load_acquire tests FUJITA Tomonori
2025-12-03  3:41 ` [PATCH v2 0/4] rust: Add i8 and i16 atomic support FUJITA Tomonori
2025-12-04  3:40   ` Boqun Feng
2025-12-04 13:12     ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox