rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] rust: Add i8 and i16 atomic support
@ 2025-12-11 11:38 FUJITA Tomonori
  2025-12-11 11:38 ` [PATCH v3 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers FUJITA Tomonori
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: FUJITA Tomonori @ 2025-12-11 11:38 UTC (permalink / raw)
  To: boqun.feng, ojeda, peterz, will
  Cc: acourbot, a.hindborg, aliceryhl, bjorn3_gh, dakr, gary, lossin,
	mark.rutland, tmgross, rust-for-linux

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.

v3:
- Move i8/i16 AtomicImp next to i32/i64 with the comments updated
- Add a comment about leaving the existing macros untouched
- Add __rust_helper for helpers
- Update commit messages about atomic_ext.c instead of atomic.c
v2: https://lore.kernel.org/rust-for-linux/20251117001035.4068507-1-fujita.tomonori@gmail.com/
- 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  | 69 ++++++++++++++++++++++++++--
 rust/kernel/sync/atomic/predefine.rs | 24 +++++++++-
 4 files changed, 132 insertions(+), 6 deletions(-)
 create mode 100644 rust/helpers/atomic_ext.c


base-commit: d358e5254674b70f34c847715ca509e46eb81e6f
-- 
2.43.0


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

end of thread, other threads:[~2025-12-14 21:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11 11:38 [PATCH v3 0/4] rust: Add i8 and i16 atomic support FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 2/4] rust: helpers: Add i8/i16 relaxed atomic helpers FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 3/4] rust: sync: atomic: Add i8/i16 load and store support FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 4/4] rust: sync: atomic: Add store_release/load_acquire tests FUJITA Tomonori
2025-12-11 16:49 ` [PATCH v3 0/4] rust: Add i8 and i16 atomic support Joel Fernandes
2025-12-11 17:37 ` Gary Guo
2025-12-11 20:05   ` Joel Fernandes
2025-12-14 21:54 ` Boqun Feng

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).