Sun Sep 21 17:48:40 2014 UTC ()
Pull up following revision(s) (requested by riastradh in ticket #96):
	sys/external/bsd/drm2/include/linux/timer.h: revision 1.5
Add Linux timer_pending and del_timer.


(snj)
diff -r1.4 -r1.4.2.1 src/sys/external/bsd/drm2/include/linux/timer.h

cvs diff -r1.4 -r1.4.2.1 src/sys/external/bsd/drm2/include/linux/timer.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/timer.h 2014/07/16 20:56:25 1.4
+++ src/sys/external/bsd/drm2/include/linux/timer.h 2014/09/21 17:48:40 1.4.2.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: timer.h,v 1.4 2014/07/16 20:56:25 riastradh Exp $ */ 1/* $NetBSD: timer.h,v 1.4.2.1 2014/09/21 17:48:40 snj Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -73,32 +73,46 @@ mod_timer(struct timer_list *timer, unsi @@ -73,32 +73,46 @@ mod_timer(struct timer_list *timer, unsi
73 73
74 callout_schedule(&timer->tl_callout, (now < then? (then - now) : 0)); 74 callout_schedule(&timer->tl_callout, (now < then? (then - now) : 0));
75} 75}
76 76
77static inline void 77static inline void
78mod_timer_pinned(struct timer_list *timer, unsigned long then) 78mod_timer_pinned(struct timer_list *timer, unsigned long then)
79{ 79{
80 80
81 /* XXX Stay on the same CPU it was originally on... */ 81 /* XXX Stay on the same CPU it was originally on... */
82 mod_timer(timer, then); 82 mod_timer(timer, then);
83} 83}
84 84
85static inline void 85static inline void
 86del_timer(struct timer_list *timer)
 87{
 88
 89 callout_stop(&timer->tl_callout);
 90}
 91
 92static inline void
86del_timer_sync(struct timer_list *timer) 93del_timer_sync(struct timer_list *timer)
87{ 94{
88 95
89 callout_halt(&timer->tl_callout, NULL); 96 callout_halt(&timer->tl_callout, NULL);
90} 97}
91 98
 99static inline bool
 100timer_pending(struct timer_list *timer)
 101{
 102
 103 return callout_pending(&timer->tl_callout);
 104}
 105
92/* 106/*
93 * XXX This is bogus -- the Linux version does various machinations to 107 * XXX This is bogus -- the Linux version does various machinations to
94 * give some jitter so that stuff doesn't wake up all at once. 108 * give some jitter so that stuff doesn't wake up all at once.
95 */ 109 */
96 110
97static inline unsigned long 111static inline unsigned long
98round_jiffies_up(unsigned long j) 112round_jiffies_up(unsigned long j)
99{ 113{
100 return roundup(j, hz); 114 return roundup(j, hz);
101} 115}
102 116
103static inline unsigned long 117static inline unsigned long
104round_jiffies_up_relative(unsigned long j) 118round_jiffies_up_relative(unsigned long j)