summaryrefslogtreecommitdiff
path: root/rust/kernel/sync/lock.rs
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2023-04-11 02:45:33 -0300
committerMiguel Ojeda <ojeda@kernel.org>2023-04-22 00:20:00 +0200
commit6d20d629c6d8575be98eeebe49a16fb2d7b32350 (patch)
tree7c0df7bfbfbcdc511ebec0272bee28e60746cccc /rust/kernel/sync/lock.rs
parent76d4bd591e1101df69c44c819041e374c63f1194 (diff)
rust: lock: introduce `Mutex`
This is the `struct mutex` lock backend and allows Rust code to use the kernel mutex idiomatically. Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Will Deacon <will@kernel.org> Cc: Waiman Long <longman@redhat.com> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20230411054543.21278-3-wedsonaf@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/sync/lock.rs')
-rw-r--r--rust/kernel/sync/lock.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs
index f2dbdc496c23..2ea512a8dfab 100644
--- a/rust/kernel/sync/lock.rs
+++ b/rust/kernel/sync/lock.rs
@@ -10,6 +10,8 @@ use crate::{bindings, init::PinInit, pin_init, str::CStr, types::Opaque};
use core::{cell::UnsafeCell, marker::PhantomData, marker::PhantomPinned};
use macros::pin_data;
+pub mod mutex;
+
/// The "backend" of a lock.
///
/// It is the actual implementation of the lock, without the need to repeat patterns used in all