diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-12-19 11:55:47 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-12-19 11:55:47 +0000 |
| commit | 3ce23fa4b21c5f6984dff5e6ae040c1fcb3d76fe (patch) | |
| tree | 3b8d9741127a5547904ae64b645cff0a3c5819f8 /sys/external/bsd/drm2/include/linux | |
| parent | fc6511217bdfdc36d7a0df332ec293a1f094be1d (diff) | |
drm: Eliminate hrtimer_destroy and teardown_timer.
These are non-Linux shims added to the Linux API to pair with
hrtimer_setup and setup_timer, but they really only serve to call
callout_destroy, which is not strictly necessary in the NetBSD API.
So although we lose a little bit of diagnostic help this way, we also
reduce diffs a bit and save some trouble that bit us last week.
Diffstat (limited to 'sys/external/bsd/drm2/include/linux')
| -rw-r--r-- | sys/external/bsd/drm2/include/linux/hrtimer.h | 18 | ||||
| -rw-r--r-- | sys/external/bsd/drm2/include/linux/timer.h | 16 |
2 files changed, 10 insertions, 24 deletions
diff --git a/sys/external/bsd/drm2/include/linux/hrtimer.h b/sys/external/bsd/drm2/include/linux/hrtimer.h index 49e3bda3757..6cf6e64e81c 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.6 2021/12/19 11:53:09 riastradh Exp $ */ +/* $NetBSD: hrtimer.h,v 1.7 2021/12/19 11:55:47 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -39,18 +39,20 @@ #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, HRTIMER_MODE_REL_PINNED, }; +struct hrtimer { + enum hrtimer_restart (*function)(struct hrtimer *); + + struct callout hrt_ch; + enum hrtimer_mode hrt_mode; + ktime_t hrt_expires; +}; + enum hrtimer_restart { HRTIMER_NORESTART, HRTIMER_RESTART, @@ -59,7 +61,6 @@ enum 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_destroy linux_hrtimer_destroy #define hrtimer_forward linux_hrtimer_forward #define hrtimer_forward_now linux_hrtimer_forward_now #define hrtimer_init linux_hrtimer_init @@ -74,7 +75,6 @@ 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 *); -void hrtimer_destroy(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); diff --git a/sys/external/bsd/drm2/include/linux/timer.h b/sys/external/bsd/drm2/include/linux/timer.h index f2597cd3753..355aa119bfa 100644 --- a/sys/external/bsd/drm2/include/linux/timer.h +++ b/sys/external/bsd/drm2/include/linux/timer.h @@ -1,4 +1,4 @@ -/* $NetBSD: timer.h,v 1.13 2021/12/19 11:49:12 riastradh Exp $ */ +/* $NetBSD: timer.h,v 1.14 2021/12/19 11:55:47 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -29,13 +29,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/* - * Notes on porting: - * - * - Linux does not have teardown_timer. You must add it yourself in - * the appropriate place. - */ - #ifndef _LINUX_TIMER_H_ #define _LINUX_TIMER_H_ @@ -64,13 +57,6 @@ timer_setup(struct timer_list *timer, void (*fn)(struct timer_list *), (void *)timer); } -static inline void -teardown_timer(struct timer_list *timer) -{ - - callout_destroy(&timer->tl_callout); -} - static inline int mod_timer(struct timer_list *timer, unsigned long then) { |
