[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250504042436.237756-1-fujita.tomonori@gmail.com>
Date: Sun, 4 May 2025 13:24:32 +0900
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: rust-for-linux@...r.kernel.org
Cc: a.hindborg@...nel.org,
boqun.feng@...il.com,
frederic@...nel.org,
lyude@...hat.com,
tglx@...utronix.de,
anna-maria@...utronix.de,
jstultz@...gle.com,
sboyd@...nel.org,
ojeda@...nel.org,
alex.gaynor@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me,
aliceryhl@...gle.com,
tmgross@...ch.edu,
dakr@...nel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 0/3] rust: time: Introduce typed clock sources and generalize Instant
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 the APIs of Instant type.
This patchset can be applied on top of the division fix for 32-bit
architectures:
https://lore.kernel.org/lkml/20250502004524.230553-1-fujita.tomonori@gmail.com/
Most of the changes to the hrtimer code that were included in v1 have
been removed, as it does not use `Instant` yet. I plan to convert
hrtimer to use `Instant` and `Delta` in a separate patchset.
v2:
- removed most of changes to hrtimer code
v1: https://lore.kernel.org/rust-for-linux/20250413105629.162349-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 | 201 ++++++++++++++++++++++--------------
rust/kernel/time/hrtimer.rs | 6 +-
3 files changed, 145 insertions(+), 78 deletions(-)
base-commit: adf04b7cc66574ec2a43b540046975dbe73e0382
--
2.43.0
Powered by blists - more mailing lists