[PATCH 41/46] rust: time: add __rust_helper to helpers

From: Alice Ryhl
Date: Tue Dec 02 2025 - 14:52:21 EST


This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
---
Cc: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
Cc: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
Cc: Frederic Weisbecker <frederic@xxxxxxxxxx>
Cc: Lyude Paul <lyude@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
Cc: John Stultz <jstultz@xxxxxxxxxx>
Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
Cc: Fiona Behrens <me@xxxxxxxxxx>
Cc: Gary Guo <gary@xxxxxxxxxxx>
---
rust/helpers/time.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rust/helpers/time.c b/rust/helpers/time.c
index a318e9fa4408230881eed047154e30eb00e3cb6f..ce394641b17c371eb9b52dd1a753c04efd975d2d 100644
--- a/rust/helpers/time.c
+++ b/rust/helpers/time.c
@@ -4,32 +4,32 @@
#include <linux/ktime.h>
#include <linux/timekeeping.h>

-void rust_helper_fsleep(unsigned long usecs)
+__rust_helper void rust_helper_fsleep(unsigned long usecs)
{
fsleep(usecs);
}

-ktime_t rust_helper_ktime_get_real(void)
+__rust_helper ktime_t rust_helper_ktime_get_real(void)
{
return ktime_get_real();
}

-ktime_t rust_helper_ktime_get_boottime(void)
+__rust_helper ktime_t rust_helper_ktime_get_boottime(void)
{
return ktime_get_boottime();
}

-ktime_t rust_helper_ktime_get_clocktai(void)
+__rust_helper ktime_t rust_helper_ktime_get_clocktai(void)
{
return ktime_get_clocktai();
}

-s64 rust_helper_ktime_to_us(const ktime_t kt)
+__rust_helper s64 rust_helper_ktime_to_us(const ktime_t kt)
{
return ktime_to_us(kt);
}

-s64 rust_helper_ktime_to_ms(const ktime_t kt)
+__rust_helper s64 rust_helper_ktime_to_ms(const ktime_t kt)
{
return ktime_to_ms(kt);
}

--
2.52.0.158.g65b55ccf14-goog