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 kludgey non...
details: https://anonhg.NetBSD.org/src/rev/697c91286e3d
branches: riastradh-drm2
changeset: 788284:697c91286e3d
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 03:04:04 2013 +0000
description:
Add kludgey non-delayed work to <linux/workqueue.h>.
diffstat:
sys/external/bsd/drm2/include/linux/workqueue.h | 60 ++++++++++++++++++++++--
1 files changed, 54 insertions(+), 6 deletions(-)
diffs (94 lines):
diff -r d0fc83123379 -r 697c91286e3d sys/external/bsd/drm2/include/linux/workqueue.h
--- a/sys/external/bsd/drm2/include/linux/workqueue.h Wed Jul 24 03:03:50 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/workqueue.h Wed Jul 24 03:04:04 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: workqueue.h,v 1.1.2.4 2013/07/24 02:09:43 riastradh Exp $ */
+/* $NetBSD: workqueue.h,v 1.1.2.5 2013/07/24 03:04:04 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,14 +51,19 @@
};
static inline void
-INIT_DELAYED_WORK(struct delayed_work *dw, void (*fn)(struct work_struct *))
+INIT_WORK(struct work_struct *work, void (*fn)(struct work_struct *))
{
- callout_init(&dw->dw_work.ws_callout, 0);
+ callout_init(&work->ws_callout, 0);
/* XXX This cast business is sketchy. */
- callout_setfunc(&dw->dw_work.ws_callout, (void (*)(void *))fn,
- &dw->dw_work);
+ callout_setfunc(&work->ws_callout, (void (*)(void *))fn, work);
+}
+
+static inline void
+INIT_DELAYED_WORK(struct delayed_work *dw, void (*fn)(struct work_struct *))
+{
+ INIT_WORK(&dw->dw_work, fn);
}
static inline struct delayed_work *
@@ -68,6 +73,12 @@
}
static inline void
+schedule_work(struct work_struct *work)
+{
+ callout_schedule(&work->ws_callout, 0);
+}
+
+static inline void
schedule_delayed_work(struct delayed_work *dw, unsigned long ticks)
{
KASSERT(ticks < INT_MAX);
@@ -75,9 +86,46 @@
}
static inline void
+cancel_work_sync(struct work_struct *work)
+{
+ callout_halt(&work->ws_callout, NULL);
+}
+
+static inline void
cancel_delayed_work_sync(struct delayed_work *dw)
{
- callout_halt(&dw->dw_work.ws_callout, NULL);
+ cancel_work_sync(&dw->dw_work);
+}
+
+/*
+ * XXX Bogus stubs for Linux work queues.
+ */
+
+struct workqueue_struct;
+
+static inline struct workqueue_struct *
+alloc_ordered_workqueue(const char *name __unused, int flags __unused)
+{
+ return NULL;
+}
+
+static inline void
+destroy_workqueue(struct workqueue_struct *wq __unused)
+{
+}
+
+static inline void
+queue_work(struct workqueue_struct *wq __unused, struct work_struct *work)
+{
+ schedule_work(work);
+}
+
+static inline void
+queue_delayed_work(struct workqueue_struct *wq __unused,
+ struct delayed_work *dw,
+ unsigned int ticks)
+{
+ schedule_delayed_work(dw, ticks);
}
#endif /* _LINUX_WORKQUEUE_H_ */
Home |
Main Index |
Thread Index |
Old Index