Module Name: src Committed By: riastradh Date: Wed Jul 24 02:28:50 UTC 2013
Modified Files: src/sys/external/bsd/drm2/include/linux [riastradh-drm2]: timer.h Log Message: Fix mod_timer to use absolute timeouts in <linux/timer.h>. To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \ src/sys/external/bsd/drm2/include/linux/timer.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/include/linux/timer.h diff -u src/sys/external/bsd/drm2/include/linux/timer.h:1.1.2.1 src/sys/external/bsd/drm2/include/linux/timer.h:1.1.2.2 --- src/sys/external/bsd/drm2/include/linux/timer.h:1.1.2.1 Wed Jul 24 01:54:04 2013 +++ src/sys/external/bsd/drm2/include/linux/timer.h Wed Jul 24 02:28:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: timer.h,v 1.1.2.1 2013/07/24 01:54:04 riastradh Exp $ */ +/* $NetBSD: timer.h,v 1.1.2.2 2013/07/24 02:28:50 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -34,6 +34,8 @@ #include <sys/callout.h> +#include <linux/jiffies.h> + struct timer_list { struct callout tl_callout; }; @@ -51,9 +53,11 @@ setup_timer(struct timer_list *timer, vo } static inline void -mod_timer(struct timer_list *timer, unsigned long ticks) +mod_timer(struct timer_list *timer, unsigned long then) { - callout_schedule(&timer->tl_callout, ticks); + const unsigned long now = jiffies; + + callout_schedule(&timer->tl_callout, (now < then? (then - now) : 0)); } static inline void