Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: helpers: Add i8/i16 atomic try_cmpxchg_relaxed helpers

Add i8/i16 atomic try_cmpxchg_relaxed helpers that call
try_cmpxchg_relaxed() macro implementing atomic try_cmpxchg_relaxed
using architecture-specific instructions.

[boqun: Use try_cmpxchg_relaxed() instead of raw_try_cmpxchg_relaxed()]

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20251227115951.1424458-5-fujita.tomonori@gmail.com

authored by

FUJITA Tomonori and committed by
Boqun Feng
8de731a6 b5992f07

+10
+10
rust/helpers/atomic_ext.c
··· 127 127 { 128 128 return try_cmpxchg_release(ptr, old, new); 129 129 } 130 + 131 + __rust_helper bool rust_helper_atomic_i8_try_cmpxchg_relaxed(s8 *ptr, s8 *old, s8 new) 132 + { 133 + return try_cmpxchg_relaxed(ptr, old, new); 134 + } 135 + 136 + __rust_helper bool rust_helper_atomic_i16_try_cmpxchg_relaxed(s16 *ptr, s16 *old, s16 new) 137 + { 138 + return try_cmpxchg_relaxed(ptr, old, new); 139 + }