[packages] liboping: update to 1.6.2
[openwrt/svn-archive/archive.git] / libs / zaptel-1.4.x / patches / 002-upstream_hrtimer.patch
1 ---
2 kernel/ztdummy.c | 18 +++++++++++++++---
3 1 file changed, 15 insertions(+), 3 deletions(-)
4
5 --- zaptel-1.4.12.1.orig/kernel/ztdummy.c
6 +++ zaptel-1.4.12.1/kernel/ztdummy.c
7 @@ -54,7 +54,7 @@
8 * the #define USE_RTC should be commented out.
9 */
10 #if defined(__i386__) || defined(__x86_64__)
11 -#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,13)
12 +#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,15)
13 /* The symbol hrtimer_forward is only exported as of 2.6.22: */
14 #if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22)
15 #define USE_HIGHRESTIMER
16 @@ -90,6 +90,18 @@
17 #endif
18 #include "ztdummy.h"
19
20 +#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) )
21 +/* compatibility with new hrtimer interface */
22 +static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
23 +{
24 + return timer->expires;
25 +}
26 +
27 +static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
28 +{
29 + timer->expires = time;
30 +}
31 +#endif
32
33 static struct ztdummy *ztd;
34
35 @@ -199,7 +211,7 @@ static enum hrtimer_restart ztdummy_hr_i
36 * expired.
37 * We should worry if overrun is 2 or more; then we really missed
38 * a tick */
39 - overrun = hrtimer_forward(&zaptimer, htmr->expires,
40 + overrun = hrtimer_forward(&zaptimer, hrtimer_get_expires(htmr),
41 ktime_set(0, ZAPTEL_TIME_NS));
42 if(overrun > 1) {
43 if(printk_ratelimit())
44 @@ -222,7 +234,7 @@ static enum hrtimer_restart ztdummy_hr_i
45 /* use kernel system tick timer if PC architecture RTC is not available */
46 static void ztdummy_timer(unsigned long param)
47 {
48 - timer.expires = jiffies + 1;
49 + hrtimer_set_expires(timer, jiffies + 1);
50 add_timer(&timer);
51
52 ztd->counter += ZAPTEL_TIME;