From 67743126fafc34816a78caa7d867608683b2dec6 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sat, 30 Jun 2007 20:39:22 +0000 Subject: [PATCH] Nuke PROC_(UN)LOCK, usb_callout_t, usb_kthread_create* and uio_procp. --- sys/bus/usb/ehcivar.h | 6 +++--- sys/bus/usb/ohcivar.h | 4 ++-- sys/bus/usb/uhcivar.h | 4 ++-- sys/bus/usb/usb.c | 8 +++----- sys/bus/usb/usbdivar.h | 4 ++-- sys/dev/usbmisc/ugen/ugen.c | 4 ++-- sys/dev/usbmisc/uhid/uhid.c | 4 +--- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/sys/bus/usb/ehcivar.h b/sys/bus/usb/ehcivar.h index 2ff58f6dfc..9f5becc313 100644 --- a/sys/bus/usb/ehcivar.h +++ b/sys/bus/usb/ehcivar.h @@ -1,6 +1,6 @@ /* $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ehcivar.h,v 1.9.2.1 2006/01/26 01:43:13 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/ehcivar.h,v 1.10 2007/06/28 13:55:12 hasso Exp $ */ +/* $DragonFly: src/sys/bus/usb/ehcivar.h,v 1.11 2007/06/30 20:39:22 hasso Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -144,8 +144,8 @@ typedef struct ehci_softc { struct lock sc_doorbell_lock; - usb_callout_t sc_tmo_pcd; - usb_callout_t sc_tmo_intrlist; + struct callout sc_tmo_pcd; + struct callout sc_tmo_intrlist; char sc_dying; } ehci_softc_t; diff --git a/sys/bus/usb/ohcivar.h b/sys/bus/usb/ohcivar.h index f83d2a162e..16eafffda1 100644 --- a/sys/bus/usb/ohcivar.h +++ b/sys/bus/usb/ohcivar.h @@ -1,6 +1,6 @@ /* $NetBSD: ohcivar.h,v 1.30 2001/12/31 12:20:35 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.40.2.1 2005/12/04 05:52:23 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/ohcivar.h,v 1.8 2007/06/28 13:55:12 hasso Exp $ */ +/* $DragonFly: src/sys/bus/usb/ohcivar.h,v 1.9 2007/06/30 20:39:22 hasso Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -139,7 +139,7 @@ typedef struct ohci_softc { u_int sc_overrun_cnt; struct timeval sc_overrun_ntc; - usb_callout_t sc_tmo_rhsc; + struct callout sc_tmo_rhsc; char sc_dying; } ohci_softc_t; diff --git a/sys/bus/usb/uhcivar.h b/sys/bus/usb/uhcivar.h index 800f604b38..e0f1779ee1 100644 --- a/sys/bus/usb/uhcivar.h +++ b/sys/bus/usb/uhcivar.h @@ -1,6 +1,6 @@ /* $NetBSD: uhcivar.h,v 1.33 2002/02/11 11:41:30 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.40 2005/03/19 19:08:46 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/uhcivar.h,v 1.8 2007/06/28 13:55:12 hasso Exp $ */ +/* $DragonFly: src/sys/bus/usb/uhcivar.h,v 1.9 2007/06/30 20:39:22 hasso Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -186,7 +186,7 @@ typedef struct uhci_softc { /* Info for the root hub interrupt channel. */ int sc_ival; /* time between root hub intrs */ usbd_xfer_handle sc_intr_xfer; /* root hub interrupt transfer */ - usb_callout_t sc_poll_handle; + struct callout sc_poll_handle; char sc_vendor[16]; /* vendor string for root hub */ int sc_id_vendor; /* vendor ID for root hub */ diff --git a/sys/bus/usb/usb.c b/sys/bus/usb/usb.c index eed60cc7f1..806427fe94 100644 --- a/sys/bus/usb/usb.c +++ b/sys/bus/usb/usb.c @@ -1,7 +1,7 @@ /* * $NetBSD: usb.c,v 1.68 2002/02/20 20:30:12 christos Exp $ * $FreeBSD: src/sys/dev/usb/usb.c,v 1.106 2005/03/27 15:31:23 iedowse Exp $ - * $DragonFly: src/sys/bus/usb/usb.c,v 1.34 2007/06/29 22:56:31 hasso Exp $ + * $DragonFly: src/sys/bus/usb/usb.c,v 1.35 2007/06/30 20:39:22 hasso Exp $ */ /* Also already merged from NetBSD: @@ -316,7 +316,7 @@ usb_create_event_thread(void *arg) struct usb_softc *sc = arg; int i; - if (usb_kthread_create1(usb_event_thread, sc, &sc->sc_event_thread, + if (kthread_create(usb_event_thread, sc, &sc->sc_event_thread, "%s", device_get_nameunit(sc->sc_dev))) { kprintf("%s: unable to create event thread for\n", device_get_nameunit(sc->sc_dev)); @@ -330,7 +330,7 @@ usb_create_event_thread(void *arg) taskq->taskcreated = 1; taskq->name = taskq_names[i]; TAILQ_INIT(&taskq->tasks); - if (usb_kthread_create2(usb_task_thread, taskq, + if (kthread_create(usb_task_thread, taskq, &taskq->task_thread_proc, taskq->name)) { kprintf("unable to create task thread\n"); panic("usb_create_event_thread task"); @@ -810,9 +810,7 @@ usb_add_event(int type, struct usb_event *uep) wakeup(&usb_events); selwakeuppri(&usb_selevent, 0); if (usb_async_proc != NULL) { - PROC_LOCK(usb_async_proc); ksignal(usb_async_proc, SIGIO); - PROC_UNLOCK(usb_async_proc); } crit_exit(); } diff --git a/sys/bus/usb/usbdivar.h b/sys/bus/usb/usbdivar.h index c59c555bd3..0029d2eb64 100644 --- a/sys/bus/usb/usbdivar.h +++ b/sys/bus/usb/usbdivar.h @@ -1,6 +1,6 @@ /* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.43.2.1 2006/03/01 01:59:05 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/usbdivar.h,v 1.9 2007/06/28 13:55:12 hasso Exp $ */ +/* $DragonFly: src/sys/bus/usb/usbdivar.h,v 1.10 2007/06/30 20:39:22 hasso Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -223,7 +223,7 @@ struct usbd_xfer { void *hcpriv; /* private use by the HC driver */ - usb_callout_t timeout_handle; + struct callout timeout_handle; }; void usbd_init(void); diff --git a/sys/dev/usbmisc/ugen/ugen.c b/sys/dev/usbmisc/ugen/ugen.c index f6590eacb6..b82fed25a7 100644 --- a/sys/dev/usbmisc/ugen/ugen.c +++ b/sys/dev/usbmisc/ugen/ugen.c @@ -2,7 +2,7 @@ * $NetBSD: ugen.c,v 1.27 1999/10/28 12:08:38 augustss Exp $ * $NetBSD: ugen.c,v 1.59 2002/07/11 21:14:28 augustss Exp $ * $FreeBSD: src/sys/dev/usb/ugen.c,v 1.81 2003/11/09 09:17:22 tanimura Exp $ - * $DragonFly: src/sys/dev/usbmisc/ugen/ugen.c,v 1.27 2007/06/28 13:55:13 hasso Exp $ + * $DragonFly: src/sys/dev/usbmisc/ugen/ugen.c,v 1.28 2007/06/30 20:39:22 hasso Exp $ */ /* @@ -1279,7 +1279,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, uio.uio_offset = 0; uio.uio_segflg = UIO_USERSPACE; uio.uio_rw = UIO_READ; - uio.uio_procp = curthread; + uio.uio_td = curthread; error = uiomove((void *)cdesc, len, &uio); kfree(cdesc, M_TEMP); return (error); diff --git a/sys/dev/usbmisc/uhid/uhid.c b/sys/dev/usbmisc/uhid/uhid.c index d46a71b266..0c383a3a3a 100644 --- a/sys/dev/usbmisc/uhid/uhid.c +++ b/sys/dev/usbmisc/uhid/uhid.c @@ -1,7 +1,7 @@ /* * $NetBSD: uhid.c,v 1.46 2001/11/13 06:24:55 lukem Exp $ * $FreeBSD: src/sys/dev/usb/uhid.c,v 1.65 2003/11/09 09:17:22 tanimura Exp $ - * $DragonFly: src/sys/dev/usbmisc/uhid/uhid.c,v 1.24 2007/06/28 13:55:13 hasso Exp $ + * $DragonFly: src/sys/dev/usbmisc/uhid/uhid.c,v 1.25 2007/06/30 20:39:22 hasso Exp $ */ /* Also already merged from NetBSD: @@ -320,9 +320,7 @@ uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) selwakeuppri(&sc->sc_rsel, 0); if (sc->sc_async != NULL) { DPRINTFN(3, ("uhid_intr: sending SIGIO %p\n", sc->sc_async)); - PROC_LOCK(sc->sc_async); ksignal(sc->sc_async, SIGIO); - PROC_UNLOCK(sc->sc_async); } } -- 2.41.0