[zaptel-commits] tzafrir: branch 1.4 r4617 - /branches/1.4/kernel/ztdummy.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Tue Jan 20 04:33:57 CST 2009


Author: tzafrir
Date: Tue Jan 20 04:33:57 2009
New Revision: 4617

URL: http://svn.digium.com/svn-view/zaptel?view=rev&rev=4617
Log:
Adjust ztdummy to the new timers interface of kernel 2.6.28

(From DAHDI rev. 5211)

Modified:
    branches/1.4/kernel/ztdummy.c

Modified: branches/1.4/kernel/ztdummy.c
URL: http://svn.digium.com/svn-view/zaptel/branches/1.4/kernel/ztdummy.c?view=diff&rev=4617&r1=4616&r2=4617
==============================================================================
--- branches/1.4/kernel/ztdummy.c (original)
+++ branches/1.4/kernel/ztdummy.c Tue Jan 20 04:33:57 2009
@@ -90,6 +90,18 @@
 #endif
 #include "ztdummy.h"
 
+#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) )
+/* compatibility with new hrtimer interface */
+static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
+{
+       return timer->expires;
+}
+
+static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
+{
+       timer->expires = time;
+}
+#endif
 
 static struct ztdummy *ztd;
 
@@ -199,7 +211,7 @@
 	 * expired.
 	 * We should worry if overrun is 2 or more; then we really missed 
 	 * a tick */
-	overrun = hrtimer_forward(&zaptimer, htmr->expires, 
+	overrun = hrtimer_forward(&zaptimer, hrtimer_get_expires(htmr),
 			ktime_set(0, ZAPTEL_TIME_NS));
 	if(overrun > 1) {
 		if(printk_ratelimit())
@@ -222,7 +234,7 @@
 /* use kernel system tick timer if PC architecture RTC is not available */
 static void ztdummy_timer(unsigned long param)
 {
-	timer.expires = jiffies + 1;
+	hrtimer_set_expires(timer, jiffies + 1);
 	add_timer(&timer);
 
 	ztd->counter += ZAPTEL_TIME;




More information about the zaptel-commits mailing list