summaryrefslogtreecommitdiff
path: root/rust/helpers/barrier.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-09-30 11:33:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-09-30 11:33:21 -0700
commit88b489385bfe3713497a63c0dcf4dd7852cf4568 (patch)
treed4a586ede51c78cf2c7354251bea86b0941c7e19 /rust/helpers/barrier.c
parente4dcbdff114e2c0a8059c396e233aa5d9637afce (diff)
parent17d9f8eaa87d40a2ff66598875a43363e37a909b (diff)
Merge tag 'locking-core-2025-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking updates from Ingo Molnar: "Mostly Rust runtime enhancements: - Add initial support for generic LKMM atomic variables in Rust (Boqun Feng) - Add the wrapper for `refcount_t` in Rust (Gary Guo) - Add a new reviewer, Gary Guo" * tag 'locking-core-2025-09-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: MAINTAINERS: update atomic infrastructure entry to include Rust rust: block: convert `block::mq` to use `Refcount` rust: convert `Arc` to use `Refcount` rust: make `Arc::into_unique_or_drop` associated function rust: implement `kernel::sync::Refcount` rust: sync: Add memory barriers rust: sync: atomic: Add Atomic<{usize,isize}> rust: sync: atomic: Add Atomic<u{32,64}> rust: sync: atomic: Add the framework of arithmetic operations rust: sync: atomic: Add atomic {cmp,}xchg operations rust: sync: atomic: Add generic atomics rust: sync: atomic: Add ordering annotation types rust: sync: Add basic atomic operation mapping framework rust: Introduce atomic API helpers
Diffstat (limited to 'rust/helpers/barrier.c')
-rw-r--r--rust/helpers/barrier.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/helpers/barrier.c b/rust/helpers/barrier.c
new file mode 100644
index 000000000000..cdf28ce8e511
--- /dev/null
+++ b/rust/helpers/barrier.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <asm/barrier.h>
+
+void rust_helper_smp_mb(void)
+{
+ smp_mb();
+}
+
+void rust_helper_smp_wmb(void)
+{
+ smp_wmb();
+}
+
+void rust_helper_smp_rmb(void)
+{
+ smp_rmb();
+}