Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166743785
D58757.id183792.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58757.id183792.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/hrtimer.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/hrtimer.h
+++ sys/compat/linuxkpi/common/include/linux/hrtimer.h
@@ -61,6 +61,12 @@
linux_hrtimer_init(hrtimer); \
} while (0)
+#define hrtimer_setup(hrtimer, restart, clock, mode) do { \
+ CTASSERT((clock) == CLOCK_MONOTONIC); \
+ CTASSERT((mode) == HRTIMER_MODE_REL); \
+ linux_hrtimer_setup(hrtimer, restart); \
+} while (0)
+
#define hrtimer_set_expires(hrtimer, time) \
linux_hrtimer_set_expires(hrtimer, time)
@@ -82,6 +88,8 @@
int linux_hrtimer_try_to_cancel(struct hrtimer *);
int linux_hrtimer_cancel(struct hrtimer *);
void linux_hrtimer_init(struct hrtimer *);
+void linux_hrtimer_setup(struct hrtimer *hrtimer,
+ enum hrtimer_restart (*function)(struct hrtimer *));
void linux_hrtimer_set_expires(struct hrtimer *, ktime_t);
void linux_hrtimer_start(struct hrtimer *, ktime_t);
void linux_hrtimer_start_range_ns(struct hrtimer *, ktime_t, int64_t);
Index: sys/compat/linuxkpi/common/src/linux_hrtimer.c
===================================================================
--- sys/compat/linuxkpi/common/src/linux_hrtimer.c
+++ sys/compat/linuxkpi/common/src/linux_hrtimer.c
@@ -105,6 +105,23 @@
callout_init_mtx(&hrtimer->callout, &hrtimer->mtx, 0);
}
+static enum hrtimer_restart
+hrtimer_dummy_timeout(struct hrtimer *unused)
+{
+ return (HRTIMER_NORESTART);
+}
+
+void
+linux_hrtimer_setup(struct hrtimer *hrtimer,
+ enum hrtimer_restart (*function)(struct hrtimer *))
+{
+ linux_hrtimer_init(hrtimer);
+ if (function != NULL)
+ hrtimer->function = function;
+ else
+ hrtimer->function = hrtimer_dummy_timeout;
+}
+
void
linux_hrtimer_set_expires(struct hrtimer *hrtimer, ktime_t time)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 17, 2:04 AM (2 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36846489
Default Alt Text
D58757.id183792.diff (1 KB)
Attached To
Mode
D58757: linuxkpi: Add `hrtimer_setup()`
Attached
Detach File
Event Timeline
Log In to Comment