summaryrefslogtreecommitdiff
path: root/sys/external/bsd/drm2/include/linux
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2021-12-19 11:23:51 +0000
committerriastradh <riastradh@NetBSD.org>2021-12-19 11:23:51 +0000
commite22feb75cb7f4d4a36a4489ced648551cfd57e1f (patch)
tree0088c3eb023f44b10ac8c2773cb182bce10c42af /sys/external/bsd/drm2/include/linux
parent2d0b65f662b60e6ed590b43d79904f8c32a3a9ca (diff)
linux compat: Draft hrtimer shims.
(not actually high-resolution, just a wrapper around callout(9))
Diffstat (limited to 'sys/external/bsd/drm2/include/linux')
-rw-r--r--sys/external/bsd/drm2/include/linux/hrtimer.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/sys/external/bsd/drm2/include/linux/hrtimer.h b/sys/external/bsd/drm2/include/linux/hrtimer.h
index 08196439d7c..cf442a11961 100644
--- a/sys/external/bsd/drm2/include/linux/hrtimer.h
+++ b/sys/external/bsd/drm2/include/linux/hrtimer.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hrtimer.h,v 1.3 2021/12/19 10:38:05 riastradh Exp $ */
+/* $NetBSD: hrtimer.h,v 1.4 2021/12/19 11:23:51 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,9 +32,48 @@
#ifndef _LINUX_HRTIMER_H_
#define _LINUX_HRTIMER_H_
+#include <sys/types.h>
+
+#include <sys/callout.h>
+
+#include <linux/ktime.h>
#include <linux/timer.h>
struct hrtimer {
+ enum hrtimer_restart (*function)(struct hrtimer *);
+
+ struct hrtimer_private *hrt_private;
+};
+
+enum hrtimer_mode {
+ HRTIMER_MODE_ABS,
+ HRTIMER_MODE_REL,
};
+enum hrtimer_restart {
+ HRTIMER_NORESTART,
+ HRTIMER_RESTART,
+};
+
+#define hrtimer_active linux_hrtimer_active
+#define hrtimer_add_expires_ns linux_hrtimer_add_expires_ns
+#define hrtimer_cancel linux_hrtimer_cancel
+#define hrtimer_forward linux_hrtimer_forward
+#define hrtimer_forward_now linux_hrtimer_forward_now
+#define hrtimer_init linux_hrtimer_init
+#define hrtimer_set_expires linux_hrtimer_set_expiresp
+#define hrtimer_start linux_hrtimer_start
+#define hrtimer_start_range_ns linux_hrtimer_start_range_ns
+
+void hrtimer_init(struct hrtimer *, clockid_t, enum hrtimer_mode);
+void hrtimer_set_expires(struct hrtimer *, ktime_t);
+void hrtimer_add_expires_ns(struct hrtimer *, uint64_t);
+void hrtimer_start(struct hrtimer *, ktime_t, enum hrtimer_mode);
+void hrtimer_start_range_ns(struct hrtimer *, ktime_t, uint64_t,
+ enum hrtimer_mode);
+int hrtimer_cancel(struct hrtimer *);
+bool hrtimer_active(struct hrtimer *);
+uint64_t hrtimer_forward(struct hrtimer *, ktime_t, ktime_t);
+uint64_t hrtimer_forward_now(struct hrtimer *, ktime_t);
+
#endif /* _LINUX_HRTIMER_H_ */