All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] rust: time: Introduce typed clock sources and generalize Instant
@ 2025-04-13 10:56 FUJITA Tomonori
  2025-04-13 10:56 ` [PATCH v1 1/3] rust: time: replace ClockId enum with ClockSource trait FUJITA Tomonori
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: FUJITA Tomonori @ 2025-04-13 10:56 UTC (permalink / raw)
  To: rust-for-linux
  Cc: boqun.feng, a.hindborg, ojeda, alex.gaynor, gary, bjorn3_gh,
	benno.lossin, aliceryhl, tmgross, dakr, frederic, lyude, tglx,
	anna-maria, jstultz, sboyd

This patch series introduces a type-safe abstraction over clock
sources. The goal is to remove the need for runtime clock selection
(via ClockId) and instead leverage Rust's type system to statically
associate the Instant type with a specific clock.

This approach enables compile-time enforcement of clock correctness
across APIs.

This patchset can be applied on top of the instant and duration
patchset [1].

[1] https://lore.kernel.org/lkml/20250413104310.162045-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (3):
  rust: time: replace ClockId enum with ClockSource trait
  rust: time: make Instant generic over ClockSource
  rust: time: add ktime_get() to ClockSource trait

 rust/helpers/time.c                 |  16 +++
 rust/kernel/time.rs                 | 200 +++++++++++++++++-----------
 rust/kernel/time/hrtimer.rs         |  26 ++--
 rust/kernel/time/hrtimer/arc.rs     |   5 +-
 rust/kernel/time/hrtimer/pin.rs     |   5 +-
 rust/kernel/time/hrtimer/pin_mut.rs |   7 +-
 rust/kernel/time/hrtimer/tbox.rs    |   5 +-
 7 files changed, 167 insertions(+), 97 deletions(-)


base-commit: c15cdb5491cf0af24d5558cece48cff059c50785
-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-04-22 22:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-13 10:56 [PATCH v1 0/3] rust: time: Introduce typed clock sources and generalize Instant FUJITA Tomonori
2025-04-13 10:56 ` [PATCH v1 1/3] rust: time: replace ClockId enum with ClockSource trait FUJITA Tomonori
2025-04-22 12:51   ` Andreas Hindborg
2025-04-13 10:56 ` [PATCH v1 2/3] rust: time: make Instant generic over ClockSource FUJITA Tomonori
2025-04-22 13:11   ` Andreas Hindborg
2025-04-22 22:12     ` FUJITA Tomonori
2025-04-13 10:56 ` [PATCH v1 3/3] rust: time: add ktime_get() to ClockSource trait FUJITA Tomonori
2025-04-22 13:14   ` Andreas Hindborg
2025-04-22 22:47     ` FUJITA Tomonori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.