Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Modify Linux timer API t...



details:   https://anonhg.NetBSD.org/src/rev/6ca41320160d
branches:  trunk
changeset: 797127:6ca41320160d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 06 15:43:55 2014 +0000

description:
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.

diffstat:

 sys/external/bsd/drm2/include/linux/timer.h |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r abf5da495f2e -r 6ca41320160d sys/external/bsd/drm2/include/linux/timer.h
--- a/sys/external/bsd/drm2/include/linux/timer.h       Sun Jul 06 15:35:42 2014 +0000
+++ b/sys/external/bsd/drm2/include/linux/timer.h       Sun Jul 06 15:43:55 2014 +0000
@@ -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 @@
 }
 
 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 @@
 static inline void
 del_timer_sync(struct timer_list *timer)
 {
+
        callout_halt(&timer->tl_callout, NULL);
-       callout_destroy(&timer->tl_callout);
 }
 
 /*



Home | Main Index | Thread Index | Old Index