Module Name:    src
Committed By:   riastradh
Date:           Sun Jul  6 15:43:55 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/include/linux: timer.h

Log Message:
Modify Linux timer API to add teardown_timer.

del_timer_sync does not actually destroy the timer so it can't be
reused again -- but Linux has no routine to do that.  So we'll have
to add that in where appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/external/bsd/drm2/include/linux/timer.h:1.3
--- src/sys/external/bsd/drm2/include/linux/timer.h:1.2	Tue Mar 18 18:20:43 2014
+++ src/sys/external/bsd/drm2/include/linux/timer.h	Sun Jul  6 15:43:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: timer.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $	*/
+/*	$NetBSD: timer.h,v 1.3 2014/07/06 15:43:55 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -29,6 +29,13 @@
  * 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_
 
@@ -53,6 +60,13 @@ setup_timer(struct timer_list *timer, vo
 }
 
 static inline void
+teardown_timer(struct timer_list *timer)
+{
+
+	callout_destroy(&timer->tl_callout);
+}
+
+static inline void
 mod_timer(struct timer_list *timer, unsigned long then)
 {
 	const unsigned long now = jiffies;
@@ -63,8 +77,8 @@ mod_timer(struct timer_list *timer, unsi
 static inline void
 del_timer_sync(struct timer_list *timer)
 {
+
 	callout_halt(&timer->tl_callout, NULL);
-	callout_destroy(&timer->tl_callout);
 }
 
 /*

Reply via email to