Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: time: Add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-22-51da5f454a67@google.com

authored by

Alice Ryhl and committed by
Boqun Feng
75b60347 5f1193d5

+7 -7
+7 -7
rust/helpers/time.c
··· 4 4 #include <linux/ktime.h> 5 5 #include <linux/timekeeping.h> 6 6 7 - void rust_helper_fsleep(unsigned long usecs) 7 + __rust_helper void rust_helper_fsleep(unsigned long usecs) 8 8 { 9 9 fsleep(usecs); 10 10 } 11 11 12 - ktime_t rust_helper_ktime_get_real(void) 12 + __rust_helper ktime_t rust_helper_ktime_get_real(void) 13 13 { 14 14 return ktime_get_real(); 15 15 } 16 16 17 - ktime_t rust_helper_ktime_get_boottime(void) 17 + __rust_helper ktime_t rust_helper_ktime_get_boottime(void) 18 18 { 19 19 return ktime_get_boottime(); 20 20 } 21 21 22 - ktime_t rust_helper_ktime_get_clocktai(void) 22 + __rust_helper ktime_t rust_helper_ktime_get_clocktai(void) 23 23 { 24 24 return ktime_get_clocktai(); 25 25 } 26 26 27 - s64 rust_helper_ktime_to_us(const ktime_t kt) 27 + __rust_helper s64 rust_helper_ktime_to_us(const ktime_t kt) 28 28 { 29 29 return ktime_to_us(kt); 30 30 } 31 31 32 - s64 rust_helper_ktime_to_ms(const ktime_t kt) 32 + __rust_helper s64 rust_helper_ktime_to_ms(const ktime_t kt) 33 33 { 34 34 return ktime_to_ms(kt); 35 35 } 36 36 37 - void rust_helper_udelay(unsigned long usec) 37 + __rust_helper void rust_helper_udelay(unsigned long usec) 38 38 { 39 39 udelay(usec); 40 40 }