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 Buncha new cruf...



details:   https://anonhg.NetBSD.org/src/rev/601dfe2818df
branches:  riastradh-drm2
changeset: 788534:601dfe2818df
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 15:58:24 2013 +0000

description:
Buncha new cruft for <linux/*.h>.

diffstat:

 sys/external/bsd/drm2/include/linux/jiffies.h   |   8 +++++++-
 sys/external/bsd/drm2/include/linux/kernel.h    |   9 ++++++++-
 sys/external/bsd/drm2/include/linux/kgdb.h      |  24 +++++++++++++++++++++++-
 sys/external/bsd/drm2/include/linux/workqueue.h |  22 +++++++++++++++++-----
 4 files changed, 55 insertions(+), 8 deletions(-)

diffs (123 lines):

diff -r 6cee398fc8c2 -r 601dfe2818df sys/external/bsd/drm2/include/linux/jiffies.h
--- a/sys/external/bsd/drm2/include/linux/jiffies.h     Sun Sep 08 15:57:54 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/jiffies.h     Sun Sep 08 15:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jiffies.h,v 1.1.2.4 2013/09/08 15:38:04 riastradh Exp $        */
+/*     $NetBSD: jiffies.h,v 1.1.2.5 2013/09/08 15:58:24 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -44,6 +44,12 @@
 }
 
 static inline unsigned int
+jiffies_to_msecs(unsigned int j)
+{
+       return hztoms(j);
+}
+
+static inline unsigned int
 usecs_to_jiffies(unsigned int usec)
 {
        return mstohz((usec + (1000 / hz) - 1) / (1000 / hz));
diff -r 6cee398fc8c2 -r 601dfe2818df sys/external/bsd/drm2/include/linux/kernel.h
--- a/sys/external/bsd/drm2/include/linux/kernel.h      Sun Sep 08 15:57:54 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/kernel.h      Sun Sep 08 15:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernel.h,v 1.1.2.20 2013/07/24 03:45:24 riastradh Exp $        */
+/*     $NetBSD: kernel.h,v 1.1.2.21 2013/09/08 15:58:24 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,6 +51,13 @@
 #define        min_t(T, X, Y)  MIN(X, Y)
 
 /*
+ * Rounding to nearest.
+ */
+#define        DIV_ROUND_CLOSEST(N, D)                                         \
+       ((0 < (N)) ? (((N) + ((D) / 2)) / (D))                          \
+           : (((N) - ((D) / 2)) / (D)))
+
+/*
  * Rounding to what may or may not be powers of two.
  */
 #define        DIV_ROUND_UP(X, N)      (((X) + (N) - 1) / (N))
diff -r 6cee398fc8c2 -r 601dfe2818df sys/external/bsd/drm2/include/linux/kgdb.h
--- a/sys/external/bsd/drm2/include/linux/kgdb.h        Sun Sep 08 15:57:54 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/kgdb.h        Sun Sep 08 15:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kgdb.h,v 1.1.2.1 2013/07/24 00:33:12 riastradh Exp $   */
+/*     $NetBSD: kgdb.h,v 1.1.2.2 2013/09/08 15:58:24 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,4 +32,26 @@
 #ifndef _LINUX_KGDB_H_
 #define _LINUX_KGDB_H_
 
+#if 0                          /* XXX */
+#include "opt_ddb.h"
+#else
+#define        DDB
+#endif
+
+#ifdef DDB
+extern int     db_active;
+
+static inline bool
+in_dbg_master(void)
+{
+       return db_active;
+}
+#else
+static inline bool
+in_dbg_master(void)
+{
+       return false;
+}
+#endif
+
 #endif  /* _LINUX_KGDB_H_ */
diff -r 6cee398fc8c2 -r 601dfe2818df sys/external/bsd/drm2/include/linux/workqueue.h
--- a/sys/external/bsd/drm2/include/linux/workqueue.h   Sun Sep 08 15:57:54 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/workqueue.h   Sun Sep 08 15:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: workqueue.h,v 1.1.2.8 2013/09/08 15:39:05 riastradh Exp $      */
+/*     $NetBSD: workqueue.h,v 1.1.2.9 2013/09/08 15:58:24 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -86,16 +86,28 @@
        callout_schedule(&dw->work.ws_callout, (int)ticks);
 }
 
-static inline void
+static inline bool
+cancel_work(struct work_struct *work)
+{
+       return !callout_stop(&work->ws_callout);
+}
+
+static inline bool
 cancel_work_sync(struct work_struct *work)
 {
-       callout_halt(&work->ws_callout, NULL);
+       return !callout_halt(&work->ws_callout, NULL);
 }
 
-static inline void
+static inline bool
+cancel_delayed_work(struct delayed_work *dw)
+{
+       return cancel_work(&dw->work);
+}
+
+static inline bool
 cancel_delayed_work_sync(struct delayed_work *dw)
 {
-       cancel_work_sync(&dw->work);
+       return cancel_work_sync(&dw->work);
 }
 
 /*



Home | Main Index | Thread Index | Old Index