summaryrefslogtreecommitdiff
path: root/rust/helpers/time.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <bentiss@kernel.org>2025-09-30 16:31:10 +0200
committerBenjamin Tissoires <bentiss@kernel.org>2025-09-30 16:31:10 +0200
commitd325efac5938efa3c2a25df72a1bd1af16cd0ed8 (patch)
tree6bb0db4f21bd6359bb32f3beeb63231477b09ef3 /rust/helpers/time.c
parentbba920e6f803138587248079de47ad3464a396f6 (diff)
parentd1dd75c6500c74b91c5286fd3277710371d3e3ca (diff)
Merge branch 'for-6.18/core' into for-linus
- allow HID-BPF to rebind a driver to hid-multitouch (Benjamin Tissoires) - Change hid_driver to use a const char* for .name (Rahul Rameshbabu)
Diffstat (limited to 'rust/helpers/time.c')
-rw-r--r--rust/helpers/time.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/rust/helpers/time.c b/rust/helpers/time.c
new file mode 100644
index 000000000000..a318e9fa4408
--- /dev/null
+++ b/rust/helpers/time.c
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/delay.h>
+#include <linux/ktime.h>
+#include <linux/timekeeping.h>
+
+void rust_helper_fsleep(unsigned long usecs)
+{
+ fsleep(usecs);
+}
+
+ktime_t rust_helper_ktime_get_real(void)
+{
+ return ktime_get_real();
+}
+
+ktime_t rust_helper_ktime_get_boottime(void)
+{
+ return ktime_get_boottime();
+}
+
+ktime_t rust_helper_ktime_get_clocktai(void)
+{
+ return ktime_get_clocktai();
+}
+
+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)
+{
+ return ktime_to_ms(kt);
+}