]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: hrtimer: Add HrTimerCallbackContext and ::forward()
authorLyude Paul <lyude@redhat.com>
Thu, 21 Aug 2025 19:32:44 +0000 (15:32 -0400)
committerAndreas Hindborg <a.hindborg@kernel.org>
Thu, 4 Sep 2025 14:54:39 +0000 (16:54 +0200)
commit3f2a5ba784b808109cac0aac921213e43143a216
tree8b02ea0e50ee18252b5ae4bcc57f9b8aabc4e815
parent3efb9ce91c5279d7ea73563d1fb136077f52dd2e
rust: hrtimer: Add HrTimerCallbackContext and ::forward()

With Linux's hrtimer API, there's a number of methods that can only be
called in two situations:

* When we have exclusive access to the hrtimer and it is not currently
  active
* When we're within the context of an hrtimer callback context

This commit handles the second situation and implements hrtimer_forward()
support in the context of a timer callback. We do this by introducing a
HrTimerCallbackContext type which is provided to users during the
RawHrTimerCallback::run() callback, and then add a forward() function to
the type.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250821193259.964504-5-lyude@redhat.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
rust/kernel/time/hrtimer.rs
rust/kernel/time/hrtimer/arc.rs
rust/kernel/time/hrtimer/pin.rs
rust/kernel/time/hrtimer/pin_mut.rs
rust/kernel/time/hrtimer/tbox.rs