rust: hrtimer: add `hrtimer::ScopedHrTimerPointer`
authorAndreas Hindborg <a.hindborg@kernel.org>
Sun, 9 Mar 2025 15:18:57 +0000 (16:18 +0100)
committerAndreas Hindborg <a.hindborg@kernel.org>
Sat, 22 Mar 2025 11:08:54 +0000 (12:08 +0100)
commitf93b0d8360e5e690ca82c3236ba7f7f9d6a6b5e7
tree7aef6a7c6292e514600b5c23e89b6cba903dad29
parenta6968ce3769660658e5c956987dc9e75b369d4b6
rust: hrtimer: add `hrtimer::ScopedHrTimerPointer`

Add the trait `ScopedHrTimerPointer` to allow safe use of stack allocated
timers. Safety is achieved by pinning the stack in place while timers are
running.

Implement the trait for all types that implement `UnsafeHrTimerPointer`.

Acked-by: Frederic Weisbecker <frederic@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-6-73586e2bd5f1@kernel.org
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
rust/kernel/time/hrtimer.rs