summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-08-16 14:13:55 +0000
committerthompsa <thompsa@FreeBSD.org>2009-08-16 14:13:55 +0000
commit5176f40a2845db311fcc49d85903a6bd8d27fc67 (patch)
treecd2fa5bb9c9491e0eebff225d6d85ceb66113345
parentb4deaa79448cabef0b0928c695ef20fb95a034d6 (diff)
downloadFreeBSD-src-5176f40a2845db311fcc49d85903a6bd8d27fc67.zip
FreeBSD-src-5176f40a2845db311fcc49d85903a6bd8d27fc67.tar.gz
Change the usb workers from kernel processes to threads, this is mostly a
cosmetic change to reduce cruft in the proc table. Also change the idle wait message to `-` like how taskqueues are. Reviewed by: julian Approved by: re (kib)
-rw-r--r--sys/dev/usb/usb_process.c12
-rw-r--r--sys/dev/usb/usb_process.h4
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c
index eb79f16..5b98a81 100644
--- a/sys/dev/usb/usb_process.c
+++ b/sys/dev/usb/usb_process.c
@@ -63,10 +63,12 @@
#endif
#if (__FreeBSD_version >= 800000)
+static struct proc *usbproc;
#define USB_THREAD_CREATE(f, s, p, ...) \
- kproc_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
-#define USB_THREAD_SUSPEND(p) kproc_suspend(p,0)
-#define USB_THREAD_EXIT(err) kproc_exit(err)
+ kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \
+ 0, "usb", __VA_ARGS__)
+#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
+#define USB_THREAD_EXIT(err) kthread_exit()
#else
#define USB_THREAD_CREATE(f, s, p, ...) \
kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
@@ -207,8 +209,8 @@ usb_proc_create(struct usb_process *up, struct mtx *p_mtx,
TAILQ_INIT(&up->up_qhead);
- cv_init(&up->up_cv, "wmsg");
- cv_init(&up->up_drain, "dmsg");
+ cv_init(&up->up_cv, "-");
+ cv_init(&up->up_drain, "usbdrain");
if (USB_THREAD_CREATE(&usb_process, up,
&up->up_ptr, pmesg)) {
diff --git a/sys/dev/usb/usb_process.h b/sys/dev/usb/usb_process.h
index c717dc1..71432c3 100644
--- a/sys/dev/usb/usb_process.h
+++ b/sys/dev/usb/usb_process.h
@@ -49,7 +49,11 @@ struct usb_process {
struct cv up_cv;
struct cv up_drain;
+#if (__FreeBSD_version >= 800000)
+ struct thread *up_ptr;
+#else
struct proc *up_ptr;
+#endif
struct thread *up_curtd;
struct mtx *up_mtx;
OpenPOWER on IntegriCloud