Source-Changes-HG archive

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

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/linux Add some conver...



details:   https://anonhg.NetBSD.org/src/rev/58d75c70a2f3
branches:  riastradh-drm2
changeset: 788281:58d75c70a2f3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 03:03:23 2013 +0000

description:
Add some conversion and comparison stuff to <linux/jiffies.h>.

diffstat:

 sys/external/bsd/drm2/include/linux/jiffies.h |  42 ++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diffs (54 lines):

diff -r 2747f2b5eb26 -r 58d75c70a2f3 sys/external/bsd/drm2/include/linux/jiffies.h
--- a/sys/external/bsd/drm2/include/linux/jiffies.h     Wed Jul 24 03:03:06 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/jiffies.h     Wed Jul 24 03:03:23 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jiffies.h,v 1.1.2.2 2013/07/24 02:28:22 riastradh Exp $        */
+/*     $NetBSD: jiffies.h,v 1.1.2.3 2013/07/24 03:03:23 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,4 +37,44 @@
 
 #define        jiffies hardclock_ticks
 
+static inline unsigned int
+msecs_to_jiffies(unsigned int msec)
+{
+       return mstohz(msec);
+}
+
+static inline unsigned int
+usecs_to_jiffies(unsigned int usec)
+{
+       return mstohz((usec + (1000 / hz) - 1) / (1000 / hz));
+}
+
+/* XXX long is the wrong type here times...  */
+
+#define        __linux_time_compare(A, OP, B)  (((long)(A) - (long)(B)) OP 0)
+
+static inline bool
+time_after(unsigned long a, unsigned long b)
+{
+       return __linux_time_compare(a, >, b);
+}
+
+static inline bool
+time_after_eq(unsigned long a, unsigned long b)
+{
+       return __linux_time_compare(a, >=, b);
+}
+
+static inline bool
+time_before(unsigned long a, unsigned long b)
+{
+       return __linux_time_compare(a, <, b);
+}
+
+static inline bool
+time_before_eq(unsigned long a, unsigned long b)
+{
+       return __linux_time_compare(a, <=, b);
+}
+
 #endif  /* _LINUX_JIFFIES_H_ */



Home | Main Index | Thread Index | Old Index