Re: [PATCH v2] rust: time: New module for timekeeping functions

From: Martin Rodriguez Reboredo
Date: Fri Jul 14 2023 - 09:58:30 EST


On 7/14/23 04:55, Asahi Lina wrote:
This module is intended to contain functions related to kernel
timekeeping and time.

Initially, this implements an abstraction for a time Instant (analogous
to the Rust std::time::Instant) that represents an opaque instant in
time. Unlike the std Instant, this is a generic type that is bound to a
specific clock source, so that only Instants from the same clock source
can be subtracted/compared.

Then we implement the relevant clocks available to the kernel:
KernelTime (CLOCK_MONOTONIC), BootTime (CLOCK_BOOTTIME),
RealTime (CLOCK_REALTIME), and TaiTime.

Co-developed-by: Heghedus Razvan <heghedus.razvan@xxxxxxxxxxxxxx>
Signed-off-by: Asahi Lina <lina@xxxxxxxxxxxxx>
---
[...]

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>