diff options
| author | ad <ad@NetBSD.org> | 2007-07-09 20:51:58 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2007-07-09 20:51:58 +0000 |
| commit | 88ab7da936c561aba9ff7492617ffb08f8d08ece (patch) | |
| tree | d9d78b17ff651178241606f2e7766abdd0f15137 /sys/dev | |
| parent | 317bac119f13240650ea6882854b381cf1024fa1 (diff) | |
Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
Diffstat (limited to 'sys/dev')
187 files changed, 851 insertions, 1139 deletions
diff --git a/sys/dev/acpi/acpi_tz.c b/sys/dev/acpi/acpi_tz.c index 7d3dc531d14..3094265b0b5 100644 --- a/sys/dev/acpi/acpi_tz.c +++ b/sys/dev/acpi/acpi_tz.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_tz.c,v 1.22 2007/07/01 07:37:12 xtraeme Exp $ */ +/* $NetBSD: acpi_tz.c,v 1.23 2007/07/09 21:00:30 ad Exp $ */ /* * Copyright (c) 2003 Jared D. McNeill <jmcneill@invisible.ca> @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.22 2007/07/01 07:37:12 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.23 2007/07/09 21:00:30 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -196,7 +196,7 @@ acpitz_attach(struct device *parent, struct device *self, void *aux) return; } - callout_init(&sc->sc_callout); + callout_init(&sc->sc_callout, 0); callout_reset(&sc->sc_callout, sc->sc_zone.tzp * hz / 10, acpitz_tick, sc); diff --git a/sys/dev/acpi/pckbc_acpi.c b/sys/dev/acpi/pckbc_acpi.c index a9f9247ebae..342345bc816 100644 --- a/sys/dev/acpi/pckbc_acpi.c +++ b/sys/dev/acpi/pckbc_acpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_acpi.c,v 1.19 2006/11/16 01:32:47 christos Exp $ */ +/* $NetBSD: pckbc_acpi.c,v 1.20 2007/07/09 21:00:30 ad Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.19 2006/11/16 01:32:47 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.20 2007/07/09 21:00:30 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -221,7 +221,7 @@ pckbc_acpi_attach(struct device *parent, struct device *self, t->t_ioh_c = ioh_c; t->t_addr = io0->ar_base; t->t_cmdbyte = KC8_CPU; /* Enable ports */ - callout_init(&t->t_cleanup); + callout_init(&t->t_cleanup, 0); } t->t_sc = &first->sc_pckbc; diff --git a/sys/dev/apm/apm.c b/sys/dev/apm/apm.c index a222f945b03..955bd499c98 100644 --- a/sys/dev/apm/apm.c +++ b/sys/dev/apm/apm.c @@ -1,4 +1,4 @@ -/* $NetBSD: apm.c,v 1.10 2007/03/04 06:01:44 christos Exp $ */ +/* $NetBSD: apm.c,v 1.11 2007/07/09 21:00:30 ad Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.10 2007/03/04 06:01:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.11 2007/07/09 21:00:30 ad Exp $"); #include "opt_apm.h" @@ -693,27 +693,17 @@ apm_attach(struct apm_softc *sc) * Create a kernel thread to periodically check for APM events, * and notify other subsystems when they occur. */ - kthread_create(apm_create_thread, sc); - - return; -} - -void -apm_create_thread(void *arg) -{ - struct apm_softc *sc = arg; - - if (kthread_create1(apm_thread, sc, &sc->sc_thread, - "%s", sc->sc_dev.dv_xname) == 0) - return; - - /* - * We were unable to create the APM thread; bail out. - */ - if (sc->sc_ops->aa_disconnect) - (*sc->sc_ops->aa_disconnect)(sc->sc_cookie); - printf("%s: unable to create thread, kernel APM support disabled\n", - sc->sc_dev.dv_xname); + if (kthread_create(PRI_NONE, 0, NULL, apm_thread, sc, + &sc->sc_thread, "%s", sc->sc_dev.dv_xname) != 0) { + /* + * We were unable to create the APM thread; bail out. + */ + if (sc->sc_ops->aa_disconnect) + (*sc->sc_ops->aa_disconnect)(sc->sc_cookie); + printf("%s: unable to create thread, " + "kernel APM support disabled\n", + sc->sc_dev.dv_xname); + } } void diff --git a/sys/dev/arcbios/arcbios_tty.c b/sys/dev/arcbios/arcbios_tty.c index 3c5e37f0ac3..095b7dadc71 100644 --- a/sys/dev/arcbios/arcbios_tty.c +++ b/sys/dev/arcbios/arcbios_tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: arcbios_tty.c,v 1.16 2007/03/04 06:01:44 christos Exp $ */ +/* $NetBSD: arcbios_tty.c,v 1.17 2007/07/09 21:00:30 ad Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.16 2007/03/04 06:01:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.17 2007/07/09 21:00:30 ad Exp $"); #include <sys/param.h> #include <sys/user.h> @@ -47,8 +47,8 @@ __KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.16 2007/03/04 06:01:44 christos Ex #include <dev/arcbios/arcbios.h> #include <dev/arcbios/arcbiosvar.h> -struct callout arcbios_tty_ch = CALLOUT_INITIALIZER; - +callout_t arcbios_tty_ch; +bool arcbios_ch_init; static struct tty *arcbios_tty[1]; void arcbios_tty_start(struct tty *); @@ -77,6 +77,11 @@ arcbios_ttyopen(dev_t dev, int flag, int mode, struct lwp *l) struct tty *tp; int s, error = 0, setuptimeout = 0; + if (!arcbios_ch_init) { + arcbios_ch_init = true; + callout_init(&arcbios_tty_ch); + } + if (unit != 0) return (ENODEV); diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c index bd9dfd0d471..1d611336e4c 100644 --- a/sys/dev/ata/ata.c +++ b/sys/dev/ata/ata.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata.c,v 1.89 2007/07/01 09:47:19 dsl Exp $ */ +/* $NetBSD: ata.c,v 1.90 2007/07/09 21:00:30 ad Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.89 2007/07/01 09:47:19 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.90 2007/07/09 21:00:30 ad Exp $"); #include "opt_ata.h" @@ -155,7 +155,7 @@ ata_channel_attach(struct ata_channel *chp) if (chp->ch_flags & ATACH_DISABLED) return; - callout_init(&chp->ch_callout); + callout_init(&chp->ch_callout, 0); TAILQ_INIT(&chp->ch_queue->queue_xfer); chp->ch_queue->queue_freeze = 0; @@ -366,24 +366,6 @@ atabus_thread(void *arg) } /* - * atabus_create_thread: - * - * Helper routine to create the ATA bus worker thread. - */ -static void -atabus_create_thread(void *arg) -{ - struct atabus_softc *sc = arg; - struct ata_channel *chp = sc->sc_chan; - int error; - - if ((error = kthread_create1(atabus_thread, sc, &chp->ch_thread, - "%s", sc->sc_dev.dv_xname)) != 0) - aprint_error("%s: unable to create kernel thread: error %d\n", - sc->sc_dev.dv_xname, error); -} - -/* * atabus_match: * * Autoconfiguration match routine. @@ -414,6 +396,7 @@ atabus_attach(struct device *parent, struct device *self, void *aux) struct atabus_softc *sc = (void *) self; struct ata_channel *chp = aux; struct atabus_initq *initq; + int error; sc->sc_chan = chp; @@ -427,7 +410,11 @@ atabus_attach(struct device *parent, struct device *self, void *aux) initq->atabus_sc = sc; TAILQ_INSERT_TAIL(&atabus_initq_head, initq, atabus_initq); config_pending_incr(); - kthread_create(atabus_create_thread, sc); + + if ((error = kthread_create(PRI_NONE, 0, NULL, atabus_thread, sc, + &chp->ch_thread, "%s", sc->sc_dev.dv_xname)) != 0) + aprint_error("%s: unable to create kernel thread: error %d\n", + sc->sc_dev.dv_xname, error); sc->sc_powerhook = powerhook_establish(sc->sc_dev.dv_xname, atabus_powerhook, sc); diff --git a/sys/dev/ata/ata_raid.c b/sys/dev/ata/ata_raid.c index 94f70fc3172..7049f288816 100644 --- a/sys/dev/ata/ata_raid.c +++ b/sys/dev/ata/ata_raid.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.22 2007/03/27 00:10:20 garbled Exp $ */ +/* $NetBSD: ata_raid.c,v 1.23 2007/07/09 21:00:30 ad Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.22 2007/03/27 00:10:20 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.23 2007/07/09 21:00:30 ad Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.22 2007/03/27 00:10:20 garbled Exp $" #include <sys/fcntl.h> #include <sys/malloc.h> #include <sys/vnode.h> +#include <sys/proc.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/dev/ata/atavar.h b/sys/dev/ata/atavar.h index b15d2628286..3460505104a 100644 --- a/sys/dev/ata/atavar.h +++ b/sys/dev/ata/atavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: atavar.h,v 1.73 2006/09/30 15:56:18 itohy Exp $ */ +/* $NetBSD: atavar.h,v 1.74 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. @@ -369,7 +369,7 @@ struct ata_channel { struct ata_queue *ch_queue; /* The channel kernel thread */ - struct proc *ch_thread; + struct lwp *ch_thread; }; /* diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 8b87c7f0335..eea6bac1799 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.339 2007/07/01 09:48:37 dsl Exp $ */ +/* $NetBSD: wd.c,v 1.340 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.339 2007/07/01 09:48:37 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.340 2007/07/09 21:00:31 ad Exp $"); #include "opt_ata.h" @@ -301,7 +301,7 @@ wdattach(struct device *parent, struct device *self, void *aux) const struct wd_quirk *wdq; ATADEBUG_PRINT(("wdattach\n"), DEBUG_FUNCS | DEBUG_PROBE); - callout_init(&wd->sc_restart_ch); + callout_init(&wd->sc_restart_ch, 0); bufq_alloc(&wd->sc_q, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK); #ifdef WD_SOFTBADSECT SLIST_INIT(&wd->sc_bslist); diff --git a/sys/dev/bluetooth/bthidev.c b/sys/dev/bluetooth/bthidev.c index 85fdef68e68..ec8cd8d9e61 100644 --- a/sys/dev/bluetooth/bthidev.c +++ b/sys/dev/bluetooth/bthidev.c @@ -1,4 +1,4 @@ -/* $NetBSD: bthidev.c,v 1.8 2007/04/21 06:15:22 plunky Exp $ */ +/* $NetBSD: bthidev.c,v 1.9 2007/07/09 21:00:31 ad Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.8 2007/04/21 06:15:22 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.9 2007/07/09 21:00:31 ad Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -186,7 +186,7 @@ bthidev_attach(struct device *parent, struct device *self, void *aux) * Init softc */ LIST_INIT(&sc->sc_list); - callout_init(&sc->sc_reconnect); + callout_init(&sc->sc_reconnect, 0); callout_setfunc(&sc->sc_reconnect, bthidev_timeout, sc); sc->sc_state = BTHID_CLOSED; sc->sc_flags = BTHID_CONNECTING; diff --git a/sys/dev/bluetooth/btkbd.c b/sys/dev/bluetooth/btkbd.c index 6bdc8d35625..ea3203333f4 100644 --- a/sys/dev/bluetooth/btkbd.c +++ b/sys/dev/bluetooth/btkbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: btkbd.c,v 1.6 2007/03/04 06:01:45 christos Exp $ */ +/* $NetBSD: btkbd.c,v 1.7 2007/07/09 21:00:31 ad Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.6 2007/03/04 06:01:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.7 2007/07/09 21:00:31 ad Exp $"); #include <sys/param.h> #include <sys/callout.h> @@ -197,7 +197,7 @@ btkbd_attach(struct device *parent, struct device *self, void *aux) #ifdef WSDISPLAY_COMPAT_RAWKBD #ifdef BTKBD_REPEAT - callout_init(&sc->sc_repeat); + callout_init(&sc->sc_repeat, 0); callout_setfunc(&sc->sc_repeat, btkbd_repeat, sc); #endif #endif diff --git a/sys/dev/cardbus/cardslot.c b/sys/dev/cardbus/cardslot.c index 46506dc2180..9f68f858340 100644 --- a/sys/dev/cardbus/cardslot.c +++ b/sys/dev/cardbus/cardslot.c @@ -1,4 +1,4 @@ -/* $NetBSD: cardslot.c,v 1.34 2007/02/04 23:39:02 dyoung Exp $ */ +/* $NetBSD: cardslot.c,v 1.35 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1999 and 2000 @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.34 2007/02/04 23:39:02 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.35 2007/07/09 21:00:31 ad Exp $"); #include "opt_cardslot.h" @@ -68,7 +68,6 @@ __KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.34 2007/02/04 23:39:02 dyoung Exp $") STATIC void cardslotattach(struct device *, struct device *, void *); STATIC int cardslotmatch(struct device *, struct cfdata *, void *); -static void create_slot_manager(void *); static void cardslot_event_thread(void *arg); STATIC int cardslot_cb_print(void *aux, const char *pcic); @@ -146,7 +145,13 @@ cardslotattach(struct device *parent, struct device *self, if (csc != NULL || psc != NULL) { config_pending_incr(); - kthread_create(create_slot_manager, (void *)sc); + if (kthread_create(PRI_NONE, 0, NULL, cardslot_event_thread, + sc, &sc->sc_event_thread, "%s", sc->sc_dev.dv_xname)) { + printf("%s: unable to create thread for slot %d\n", + sc->sc_dev.dv_xname, sc->sc_slot); + panic("cardslotattach"); + } + sc->sc_th_enable = 1; } if (csc && (csc->sc_cf->cardbus_ctrl)(csc->sc_cc, CARDBUS_CD)) { @@ -209,26 +214,6 @@ cardslot_16_print(void *arg, const char *pnp) } - - -static void -create_slot_manager(void *arg) -{ - struct cardslot_softc *sc = (struct cardslot_softc *)arg; - - sc->sc_th_enable = 1; - - if (kthread_create1(cardslot_event_thread, sc, &sc->sc_event_thread, - "%s", sc->sc_dev.dv_xname)) { - printf("%s: unable to create event thread for slot %d\n", - sc->sc_dev.dv_xname, sc->sc_slot); - panic("create_slot_manager"); - } -} - - - - /* * void cardslot_event_throw(struct cardslot_softc *sc, int ev) * diff --git a/sys/dev/cardbus/cardslotvar.h b/sys/dev/cardbus/cardslotvar.h index 4d69cbcb64d..6af70e2d6fa 100644 --- a/sys/dev/cardbus/cardslotvar.h +++ b/sys/dev/cardbus/cardslotvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: cardslotvar.h,v 1.10 2005/12/11 12:21:15 christos Exp $ */ +/* $NetBSD: cardslotvar.h,v 1.11 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1999 @@ -76,7 +76,7 @@ struct cardslot_softc { struct cardbus_softc *sc_cb_softc; struct pcmcia_softc *sc_16_softc; - struct proc *sc_event_thread; + struct lwp *sc_event_thread; int sc_th_enable; /* true if the thread is enabled */ /* An event queue for the thread which processes slot state events. */ diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 9fb7cb491ce..95ba0c138df 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccd.c,v 1.120 2007/06/26 15:22:24 cube Exp $ */ +/* $NetBSD: ccd.c,v 1.121 2007/07/09 21:00:28 ad Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 1999, 2007 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.120 2007/06/26 15:22:24 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.121 2007/07/09 21:00:28 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -766,7 +766,7 @@ ccdstart(struct ccd_softc *cs) SIMPLEQ_REMOVE_HEAD(&cbufq, cb_q); if ((cbp->cb_buf.b_flags & B_READ) == 0) cbp->cb_buf.b_vp->v_numoutput++; - DEV_STRATEGY(&cbp->cb_buf); + bdev_strategy(&cbp->cb_buf); } } } diff --git a/sys/dev/cons.c b/sys/dev/cons.c index f75272d1f59..0bc16a07e31 100644 --- a/sys/dev/cons.c +++ b/sys/dev/cons.c @@ -1,4 +1,4 @@ -/* $NetBSD: cons.c,v 1.63 2007/03/04 06:01:41 christos Exp $ */ +/* $NetBSD: cons.c,v 1.64 2007/07/09 21:00:28 ad Exp $ */ /* * Copyright (c) 1990, 1993 @@ -78,7 +78,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.63 2007/03/04 06:01:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.64 2007/07/09 21:00:28 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -104,7 +104,7 @@ dev_type_ioctl(cnioctl); dev_type_poll(cnpoll); dev_type_kqfilter(cnkqfilter); -static const struct cdevsw *cn_redirect(dev_t *, int, int *); +static bool cn_redirect(dev_t *, int, int *); const struct cdevsw cons_cdevsw = { cnopen, cnclose, cnread, cnwrite, cnioctl, @@ -160,7 +160,7 @@ cnopen(dev_t dev, int flag, int mode, struct lwp *l) /* try to get a reference on its vnode, but fail silently */ cdevvp(cndev, &cn_devvp[unit]); } - return ((*cdev->d_open)(cndev, flag, mode, l)); + return cdev_open(cndev, flag, mode, l); } int @@ -191,13 +191,12 @@ cnclose(dev_t dev, int flag, int mode, struct lwp *l) } if (vfinddev(dev, VCHR, &vp) && vcount(vp)) return (0); - return ((*cdev->d_close)(dev, flag, mode, l)); + return cdev_close(dev, flag, mode, l); } int cnread(dev_t dev, struct uio *uio, int flag) { - const struct cdevsw *cdev; int error; /* @@ -207,30 +206,25 @@ cnread(dev_t dev, struct uio *uio, int flag) * input (except a shell in single-user mode, but then, * one wouldn't TIOCCONS then). */ - cdev = cn_redirect(&dev, 1, &error); - if (cdev == NULL) + if (!cn_redirect(&dev, 1, &error)) return error; - return ((*cdev->d_read)(dev, uio, flag)); + return cdev_read(dev, uio, flag); } int cnwrite(dev_t dev, struct uio *uio, int flag) { - const struct cdevsw *cdev; int error; /* Redirect output, if that's appropriate. */ - cdev = cn_redirect(&dev, 0, &error); - if (cdev == NULL) + if (!cn_redirect(&dev, 0, &error)) return error; - - return ((*cdev->d_write)(dev, uio, flag)); + return cdev_write(dev, uio, flag); } int cnioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) { - const struct cdevsw *cdev; int error; error = 0; @@ -239,17 +233,11 @@ cnioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) * Superuser can always use this to wrest control of console * output from the "virtual" console. */ -#ifdef notyet - mutex_enter(&tty_mutex); -#endif if (cmd == TIOCCONS && constty != NULL) { error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER, NULL); if (!error) constty = NULL; -#ifdef notyet - mutex_exit(&tty_mutex); -#endif return (error); } @@ -259,20 +247,15 @@ cnioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) * ioctls on /dev/console, then the console is redirected * out from under it. */ - cdev = cn_redirect(&dev, 0, &error); -#ifdef notyet - mutex_exit(&tty_mutex); -#endif - if (cdev != NULL) - error = (*cdev->d_ioctl)(dev, cmd, data, flag, l); - return (error); + if (!cn_redirect(&dev, 0, &error)) + return error; + return cdev_ioctl(dev, cmd, data, flag, l); } /*ARGSUSED*/ int cnpoll(dev_t dev, int events, struct lwp *l) { - const struct cdevsw *cdev; int error; /* @@ -280,17 +263,15 @@ cnpoll(dev_t dev, int events, struct lwp *l) * I don't want to think of the possible side effects * of console redirection here. */ - cdev = cn_redirect(&dev, 0, &error); - if (cdev == NULL) + if (!cn_redirect(&dev, 0, &error)) return POLLHUP; - return ((*cdev->d_poll)(dev, events, l)); + return cdev_poll(dev, events, l); } /*ARGSUSED*/ int cnkqfilter(dev_t dev, struct knote *kn) { - const struct cdevsw *cdev; int error; /* @@ -298,10 +279,9 @@ cnkqfilter(dev_t dev, struct knote *kn) * I don't want to think of the possible side effects * of console redirection here. */ - cdev = cn_redirect(&dev, 0, &error); - if (cdev == NULL) + if (!cn_redirect(&dev, 0, &error)) return error; - return ((*cdev->d_kqfilter)(dev, kn)); + return cdev_kqfilter(dev, kn); } int @@ -424,7 +404,7 @@ cnhalt(void) * * Call with tty_mutex held. */ -static const struct cdevsw * +static bool cn_redirect(dev_t *devp, int is_read, int *error) { dev_t dev = *devp; @@ -434,13 +414,13 @@ cn_redirect(dev_t *devp, int is_read, int *error) (cn_tab == NULL || (cn_tab->cn_pri != CN_REMOTE))) { if (is_read) { *error = 0; - return NULL; + return false; } dev = constty->t_dev; } else if (cn_tab == NULL) - return NULL; + return false; else dev = cn_tab->cn_dev; *devp = dev; - return cdevsw_lookup(dev); + return true; } diff --git a/sys/dev/dec/dz.c b/sys/dev/dec/dz.c index 2f687e9e5fb..32f32cb0135 100644 --- a/sys/dev/dec/dz.c +++ b/sys/dev/dec/dz.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz.c,v 1.25 2007/03/04 06:01:45 christos Exp $ */ +/* $NetBSD: dz.c,v 1.26 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.25 2007/03/04 06:01:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.26 2007/07/09 21:00:31 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -198,7 +198,7 @@ dzattach(struct dz_softc *sc, struct evcnt *parent_evcnt, int consline) if (dz_timer == 0) { dz_timer = 1; - callout_init(&dzscan_ch); + callout_init(&dzscan_ch, 0); callout_reset(&dzscan_ch, hz, dzscan, NULL); } printf("\n"); diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c index d954fd18ec5..62631613550 100644 --- a/sys/dev/dkwedge/dk.c +++ b/sys/dev/dkwedge/dk.c @@ -1,4 +1,4 @@ -/* $NetBSD: dk.c,v 1.25 2007/06/24 01:43:34 dyoung Exp $ */ +/* $NetBSD: dk.c,v 1.26 2007/07/09 21:00:32 ad Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.25 2007/06/24 01:43:34 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.26 2007/07/09 21:00:32 ad Exp $"); #include "opt_dkwedge.h" @@ -306,7 +306,7 @@ dkwedge_add(struct dkwedge_info *dkw) bufq_alloc(&sc->sc_bufq, "fcfs", 0); - callout_init(&sc->sc_restart_ch); + callout_init(&sc->sc_restart_ch, 0); callout_setfunc(&sc->sc_restart_ch, dkrestart, sc); /* diff --git a/sys/dev/dmover/dmover_backend.c b/sys/dev/dmover/dmover_backend.c index 05e6314a8be..89d2d778416 100644 --- a/sys/dev/dmover/dmover_backend.c +++ b/sys/dev/dmover/dmover_backend.c @@ -1,4 +1,4 @@ -/* $NetBSD: dmover_backend.c,v 1.5 2003/04/26 04:44:18 briggs Exp $ */ +/* $NetBSD: dmover_backend.c,v 1.6 2007/07/09 21:00:32 ad Exp $ */ /* * Copyright (c) 2002 Wasabi Systems, Inc. @@ -40,39 +40,16 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dmover_backend.c,v 1.5 2003/04/26 04:44:18 briggs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmover_backend.c,v 1.6 2007/07/09 21:00:32 ad Exp $"); #include <sys/param.h> -#include <sys/lock.h> +#include <sys/mutex.h> #include <sys/systm.h> #include <dev/dmover/dmovervar.h> TAILQ_HEAD(, dmover_backend) dmover_backend_list; -struct lock dmover_backend_list_lock; - -#define BACKEND_LIST_LOCK_READ() \ -do { \ - (void) spinlockmgr(&dmover_backend_list_lock, LK_SHARED, NULL); \ -} while (/*CONSTCOND*/0) - -#define BACKEND_LIST_UNLOCK_READ() \ -do { \ - (void) spinlockmgr(&dmover_backend_list_lock, LK_RELEASE, NULL);\ -} while (/*CONSTCOND*/0) - -#define BACKEND_LIST_LOCK_WRITE(s) \ -do { \ - (s) = splbio(); \ - (void) spinlockmgr(&dmover_backend_list_lock, LK_EXCLUSIVE, NULL); \ -} while (/*CONSTCOND*/0) - -#define BACKEND_LIST_UNLOCK_WRITE(s) \ -do { \ - (void) spinlockmgr(&dmover_backend_list_lock, LK_RELEASE, NULL);\ - splx((s)); \ -} while (/*CONSTCOND*/0) - +kmutex_t dmover_backend_list_lock; static int initialized; static struct simplelock initialized_slock = SIMPLELOCK_INITIALIZER; @@ -83,7 +60,7 @@ initialize(void) simple_lock(&initialized_slock); if (__predict_true(initialized == 0)) { TAILQ_INIT(&dmover_backend_list); - spinlockinit(&dmover_backend_list_lock, "dmbelk", 0); + mutex_init(&dmover_backend_list_lock, MUTEX_DRIVER, IPL_BIO); /* Initialize the other bits of dmover. */ dmover_session_initialize(); @@ -103,7 +80,6 @@ initialize(void) void dmover_backend_register(struct dmover_backend *dmb) { - int s; if (__predict_false(initialized == 0)) initialize(); @@ -114,9 +90,9 @@ dmover_backend_register(struct dmover_backend *dmb) TAILQ_INIT(&dmb->dmb_pendreqs); dmb->dmb_npendreqs = 0; - BACKEND_LIST_LOCK_WRITE(s); + mutex_enter(&dmover_backend_list_lock); TAILQ_INSERT_TAIL(&dmover_backend_list, dmb, dmb_list); - BACKEND_LIST_UNLOCK_WRITE(s); + mutex_exit(&dmover_backend_list_lock); } /* @@ -127,7 +103,6 @@ dmover_backend_register(struct dmover_backend *dmb) void dmover_backend_unregister(struct dmover_backend *dmb) { - int s; #ifdef DIAGNOSTIC if (__predict_false(initialized == 0)) { @@ -146,9 +121,9 @@ dmover_backend_unregister(struct dmover_backend *dmb) if (dmb->dmb_nsessions) panic("dmover_backend_unregister"); - BACKEND_LIST_LOCK_WRITE(s); + mutex_enter(&dmover_backend_list_lock); TAILQ_REMOVE(&dmover_backend_list, dmb, dmb_list); - BACKEND_LIST_UNLOCK_WRITE(s); + mutex_exit(&dmover_backend_list_lock); } /* @@ -173,7 +148,7 @@ dmover_backend_alloc(struct dmover_session *dses, const char *type) return (ESRCH); } - BACKEND_LIST_LOCK_READ(); + mutex_enter(&dmover_backend_list_lock); /* First, find a back-end that can handle the session parts. */ for (dmb = TAILQ_FIRST(&dmover_backend_list); dmb != NULL; @@ -225,7 +200,7 @@ dmover_backend_alloc(struct dmover_session *dses, const char *type) } } if (best_dmb == NULL) { - BACKEND_LIST_UNLOCK_READ(); + mutex_exit(&dmover_backend_list_lock); return (ESRCH); } @@ -240,7 +215,7 @@ dmover_backend_alloc(struct dmover_session *dses, const char *type) LIST_INSERT_HEAD(&best_dmb->dmb_sessions, dses, __dses_list); best_dmb->dmb_nsessions++; - BACKEND_LIST_UNLOCK_READ(); + mutex_exit(&dmover_backend_list_lock); return (0); } @@ -255,7 +230,7 @@ dmover_backend_release(struct dmover_session *dses) { struct dmover_backend *dmb; - BACKEND_LIST_LOCK_READ(); + mutex_enter(&dmover_backend_list_lock); /* XXX Clear out the static assignment. */ dmb = dses->__dses_assignment.das_backend; @@ -265,5 +240,5 @@ dmover_backend_release(struct dmover_session *dses) LIST_REMOVE(dses, __dses_list); dmb->dmb_nsessions--; - BACKEND_LIST_UNLOCK_READ(); + mutex_exit(&dmover_backend_list_lock); } diff --git a/sys/dev/dmover/swdmover.c b/sys/dev/dmover/swdmover.c index a4506151682..eb81b29df01 100644 --- a/sys/dev/dmover/swdmover.c +++ b/sys/dev/dmover/swdmover.c @@ -1,4 +1,4 @@ -/* $NetBSD: swdmover.c,v 1.9 2005/12/11 12:21:20 christos Exp $ */ +/* $NetBSD: swdmover.c,v 1.10 2007/07/09 21:00:32 ad Exp $ */ /* * Copyright (c) 2002, 2003 Wasabi Systems, Inc. @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: swdmover.c,v 1.9 2005/12/11 12:21:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: swdmover.c,v 1.10 2007/07/09 21:00:32 ad Exp $"); #include <sys/param.h> #include <sys/lock.h> @@ -723,23 +723,6 @@ const struct dmover_algdesc swdmover_algdescs[] = { (sizeof(swdmover_algdescs) / sizeof(swdmover_algdescs[0])) /* - * swdmover_create_thread: - * - * Actually create the swdmover processing thread. - */ -static void -swdmover_create_thread(void *arg) -{ - int error; - - error = kthread_create1(swdmover_thread, arg, &swdmover_proc, - "swdmover"); - if (error) - printf("WARNING: unable to create swdmover thread, " - "error = %d\n", error); -} - -/* * swdmoverattach: * * Pesudo-device attach routine. @@ -747,6 +730,7 @@ swdmover_create_thread(void *arg) void swdmoverattach(int count) { + int error; swdmover_backend.dmb_name = "swdmover"; swdmover_backend.dmb_speed = 1; /* XXX */ @@ -755,7 +739,11 @@ swdmoverattach(int count) swdmover_backend.dmb_nalgdescs = SWDMOVER_ALGDESC_COUNT; swdmover_backend.dmb_process = swdmover_process; - kthread_create(swdmover_create_thread, &swdmover_backend); + error = kthread_create(PRI_NONE, 0, NULL, swdmover_thread, + arg, &swdmover_proc, "swdmover"); + if (error) + printf("WARNING: unable to create swdmover thread, " + "error = %d\n", error); /* XXX Should only register this when kthread creation succeeds. */ dmover_backend_register(&swdmover_backend); diff --git a/sys/dev/fss.c b/sys/dev/fss.c index 120184c5d3d..f812b34b29c 100644 --- a/sys/dev/fss.c +++ b/sys/dev/fss.c @@ -1,4 +1,4 @@ -/* $NetBSD: fss.c,v 1.32 2007/03/04 06:01:42 christos Exp $ */ +/* $NetBSD: fss.c,v 1.33 2007/07/09 21:00:28 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.32 2007/03/04 06:01:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.33 2007/07/09 21:00:28 ad Exp $"); #include "fss.h" @@ -244,7 +244,7 @@ fss_strategy(struct buf *bp) bp->b_rawblkno = bp->b_blkno; BUFQ_PUT(sc->sc_bufq, bp); - wakeup(&sc->sc_bs_proc); + wakeup(&sc->sc_bs_lwp); FSS_UNLOCK(sc, s); } @@ -416,8 +416,8 @@ fss_softc_alloc(struct fss_softc *sc) if (sc->sc_indir_data == NULL) return(ENOMEM); - if ((error = kthread_create1(fss_bs_thread, sc, &sc->sc_bs_proc, - "fssbs%d", sc->sc_unit)) != 0) + if ((error = kthread_create(PINOD, 0, NULL, fss_bs_thread, sc, + &sc->sc_bs_lwp, "fssbs%d", sc->sc_unit)) != 0) return error; sc->sc_flags |= FSS_BS_THREAD; @@ -435,9 +435,9 @@ fss_softc_free(struct fss_softc *sc) if ((sc->sc_flags & FSS_BS_THREAD) != 0) { FSS_LOCK(sc, s); sc->sc_flags &= ~FSS_BS_THREAD; - wakeup(&sc->sc_bs_proc); - while (sc->sc_bs_proc != NULL) - ltsleep(&sc->sc_bs_proc, PRIBIO, "fssthread", 0, + wakeup(&sc->sc_bs_lwp); + while (sc->sc_bs_lwp != NULL) + ltsleep(&sc->sc_bs_lwp, PRIBIO, "fssthread", 0, &sc->sc_slock); FSS_UNLOCK(sc, s); } @@ -911,7 +911,7 @@ restart: bp->b_private = scp; bp->b_iodone = fss_cluster_iodone; - DEV_STRATEGY(bp); + bdev_strategy(bp); FSS_LOCK(sc, s); scp->fc_xfercount++; @@ -933,7 +933,7 @@ restart: setbit(sc->sc_copied, scp->fc_cluster); FSS_UNLOCK(sc, s); - wakeup(&sc->sc_bs_proc); + wakeup(&sc->sc_bs_lwp); } /* @@ -953,7 +953,7 @@ fss_bs_io(struct fss_softc *sc, fss_io_type rw, error = vn_rdwr((rw == FSS_READ ? UIO_READ : UIO_WRITE), sc->sc_bs_vp, data, len, off, UIO_SYSSPACE, IO_UNIT|IO_NODELOCKED, - sc->sc_bs_proc->p_cred, NULL, NULL); + sc->sc_bs_lwp->l_cred, NULL, NULL); if (error == 0) { simple_lock(&sc->sc_bs_vp->v_interlock); error = VOP_PUTPAGES(sc->sc_bs_vp, trunc_page(off), @@ -1030,12 +1030,12 @@ fss_bs_thread(void *arg) for (;;) { if (nfreed == 0 && nio == 0) - ltsleep(&sc->sc_bs_proc, PVM-1, "fssbs", 0, + ltsleep(&sc->sc_bs_lwp, PVM-1, "fssbs", 0, &sc->sc_slock); if ((sc->sc_flags & FSS_BS_THREAD) == 0) { - sc->sc_bs_proc = NULL; - wakeup(&sc->sc_bs_proc); + sc->sc_bs_lwp = NULL; + wakeup(&sc->sc_bs_lwp); FSS_UNLOCK(sc, s); @@ -1164,7 +1164,7 @@ fss_bs_thread(void *arg) nbp->b_dev = sc->sc_bdev; nbp->b_vp = NULLVP; - DEV_STRATEGY(nbp); + bdev_strategy(nbp); if (biowait(nbp) != 0) { bp->b_resid = bp->b_bcount; diff --git a/sys/dev/fssvar.h b/sys/dev/fssvar.h index 434e466ddb6..c1dca341957 100644 --- a/sys/dev/fssvar.h +++ b/sys/dev/fssvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: fssvar.h,v 1.15 2007/03/04 06:01:42 christos Exp $ */ +/* $NetBSD: fssvar.h,v 1.16 2007/07/09 21:00:28 ad Exp $ */ /*- * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. @@ -162,7 +162,7 @@ struct fss_softc { off_t sc_bs_size; /* Its size in bytes */ int sc_bs_bshift; /* Shift of backing store block */ u_int32_t sc_bs_bmask; /* Mask of backing store block */ - struct proc *sc_bs_proc; /* Our kernel thread */ + struct lwp *sc_bs_lwp; /* Our kernel thread */ int sc_clshift; /* Shift of cluster size */ u_int32_t sc_clmask; /* Mask of cluster size */ u_int32_t sc_clcount; /* # clusters in file system */ diff --git a/sys/dev/gpib/mt.c b/sys/dev/gpib/mt.c index 0133a034235..1296cdd7737 100644 --- a/sys/dev/gpib/mt.c +++ b/sys/dev/gpib/mt.c @@ -1,4 +1,4 @@ -/* $NetBSD: mt.c,v 1.9 2007/03/04 06:01:46 christos Exp $ */ +/* $NetBSD: mt.c,v 1.10 2007/07/09 21:00:32 ad Exp $ */ /*- * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. @@ -121,7 +121,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.9 2007/03/04 06:01:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.10 2007/07/09 21:00:32 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -279,8 +279,8 @@ mtattach(parent, self, aux) sc->sc_flags = MTF_EXISTS; bufq_alloc(&sc->sc_tab, "fcfs", 0); - callout_init(&sc->sc_start_ch); - callout_init(&sc->sc_intr_ch); + callout_init(&sc->sc_start_ch, 0); + callout_init(&sc->sc_intr_ch, 0); if (gpibregister(sc->sc_ic, sc->sc_slave, mtcallback, sc, &sc->sc_hdl)) { diff --git a/sys/dev/gpib/ppi.c b/sys/dev/gpib/ppi.c index 5966ffd6f90..2cbed43ac0b 100644 --- a/sys/dev/gpib/ppi.c +++ b/sys/dev/gpib/ppi.c @@ -1,4 +1,4 @@ -/* $NetBSD: ppi.c,v 1.9 2007/03/04 06:01:46 christos Exp $ */ +/* $NetBSD: ppi.c,v 1.10 2007/07/09 21:00:32 ad Exp $ */ /*- * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.9 2007/03/04 06:01:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.10 2007/07/09 21:00:32 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -172,8 +172,8 @@ ppiattach(parent, self, aux) sc->sc_ic = ga->ga_ic; sc->sc_address = ga->ga_address; - callout_init(&sc->sc_timo_ch); - callout_init(&sc->sc_start_ch); + callout_init(&sc->sc_timo_ch, 0); + callout_init(&sc->sc_start_ch, 0); if (gpibregister(sc->sc_ic, sc->sc_address, ppicallback, sc, &sc->sc_hdl)) { diff --git a/sys/dev/gpib/rd.c b/sys/dev/gpib/rd.c index 98199dc13cf..16e140fd1ce 100644 --- a/sys/dev/gpib/rd.c +++ b/sys/dev/gpib/rd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rd.c,v 1.15 2007/03/04 06:01:46 christos Exp $ */ +/* $NetBSD: rd.c,v 1.16 2007/07/09 21:00:32 ad Exp $ */ /*- * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.15 2007/03/04 06:01:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.16 2007/07/09 21:00:32 ad Exp $"); #include "rnd.h" @@ -451,7 +451,7 @@ rdattach(parent, self, aux) sc->sc_dk.dk_name = sc->sc_dev.dv_xname; disk_attach(&sc->sc_dk); - callout_init(&sc->sc_restart_ch); + callout_init(&sc->sc_restart_ch, 0); if (gpibregister(sc->sc_ic, sc->sc_slave, rdcallback, sc, &sc->sc_hdl)) { diff --git a/sys/dev/hpc/apm/apmdev.c b/sys/dev/hpc/apm/apmdev.c index 0ab7e3c936c..4403d4b64f0 100644 --- a/sys/dev/hpc/apm/apmdev.c +++ b/sys/dev/hpc/apm/apmdev.c @@ -1,4 +1,4 @@ -/* $NetBSD: apmdev.c,v 1.10 2007/03/04 06:01:47 christos Exp $ */ +/* $NetBSD: apmdev.c,v 1.11 2007/07/09 21:00:32 ad Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: apmdev.c,v 1.10 2007/03/04 06:01:47 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apmdev.c,v 1.11 2007/07/09 21:00:32 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_apmdev.h" @@ -135,7 +135,6 @@ static int apmmatch(struct device *, struct cfdata *, void *); static void apm_event_handle(struct apm_softc *, u_int, u_int); static void apm_periodic_check(struct apm_softc *); -static void apm_create_thread(void *); static void apm_thread(void *); static void apm_perror(const char *, int, ...) __attribute__((__format__(__printf__,1,3))); @@ -714,9 +713,16 @@ apmattach(struct device *parent, struct device *self, void *aux) * Create a kernel thread to periodically check for APM events, * and notify other subsystems when they occur. */ - kthread_create(apm_create_thread, sc); - - return; + if (kthread_create(PRI_NONE, 0, NULL, apm_thread, sc, + &sc->sc_thread, "%s", sc->sc_dev.dv_xname) != 0) { + /* + * We were unable to create the APM thread; bail out. + */ + sc->ops->disconnect(sc->cookie); + printf("%s: unable to create thread, " + "kernel APM support disabled\n", + sc->sc_dev.dv_xname); + } } /* @@ -730,24 +736,6 @@ apmprint(void *aux, const char *pnp) return (UNCONF); } - -void -apm_create_thread(void *arg) -{ - struct apm_softc *sc = arg; - - if (kthread_create1(apm_thread, sc, &sc->sc_thread, - "%s", sc->sc_dev.dv_xname) == 0) - return; - - /* - * We were unable to create the APM thread; bail out. - */ - sc->ops->disconnect(sc->cookie); - printf("%s: unable to create thread, kernel APM support disabled\n", - sc->sc_dev.dv_xname); -} - void apm_thread(void *arg) { diff --git a/sys/dev/hpc/hpcfb.c b/sys/dev/hpc/hpcfb.c index c8cc20750ff..7cafceccc3c 100644 --- a/sys/dev/hpc/hpcfb.c +++ b/sys/dev/hpc/hpcfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpcfb.c,v 1.41 2007/03/04 06:01:46 christos Exp $ */ +/* $NetBSD: hpcfb.c,v 1.42 2007/07/09 21:00:32 ad Exp $ */ /*- * Copyright (c) 1999 @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.41 2007/03/04 06:01:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.42 2007/07/09 21:00:32 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_hpcfb.h" @@ -187,7 +187,6 @@ void hpcfb_refresh_screen(struct hpcfb_softc *); void hpcfb_doswitch(struct hpcfb_softc *); #ifdef HPCFB_JUMP -static void hpcfb_create_thread(void *); static void hpcfb_thread(void *); #endif /* HPCFB_JUMP */ @@ -318,7 +317,7 @@ hpcfbattach(struct device *parent, sc->sc_polling = 0; /* XXX */ sc->sc_mapping = 0; /* XXX */ - callout_init(&sc->sc_switch_callout); + callout_init(&sc->sc_switch_callout, 0); /* Add a power hook to power management */ sc->sc_powerhook = powerhook_establish(sc->sc_dev.dv_xname, @@ -338,29 +337,21 @@ hpcfbattach(struct device *parent, /* * Create a kernel thread to scroll, */ - kthread_create(hpcfb_create_thread, sc); + if (kthread_create(PRI_NONE, 0, NULL, hpcfb_thread, sc, + &sc->sc_thread, "%s", sc->sc_dev.dv_xname) != 0) { + /* + * We were unable to create the HPCFB thread; bail out. + */ + sc->sc_thread = 0; + printf("%s: unable to create thread, kernel " + "hpcfb scroll support disabled\n", + sc->sc_dev.dv_xname); + } #endif /* HPCFB_JUMP */ } #ifdef HPCFB_JUMP void -hpcfb_create_thread(void *arg) -{ - struct hpcfb_softc *sc = arg; - - if (kthread_create1(hpcfb_thread, sc, &sc->sc_thread, - "%s", sc->sc_dev.dv_xname) == 0) - return; - - /* - * We were unable to create the HPCFB thread; bail out. - */ - sc->sc_thread = 0; - printf("%s: unable to create thread, kernel hpcfb scroll support disabled\n", - sc->sc_dev.dv_xname); -} - -void hpcfb_thread(void *arg) { struct hpcfb_softc *sc = arg; @@ -497,7 +488,7 @@ hpcfb_init(struct hpcfb_fbconf *fbconf, struct hpcfb_devconfig *dc) dc->dc_max_row = 0; dc->dc_min_row = dc->dc_rows; dc->dc_scroll = 0; - callout_init(&dc->dc_scroll_ch); + callout_init(&dc->dc_scroll_ch, 0); #endif /* HPCFB_JUMP */ dc->dc_memsize = ri->ri_stride * ri->ri_height; /* hook rasops in hpcfb_ops */ diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c index 0d4c025eab9..066edba30c5 100644 --- a/sys/dev/i2c/i2c.c +++ b/sys/dev/i2c/i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.13 2007/02/06 12:39:15 jmcneill Exp $ */ +/* $NetBSD: i2c.c,v 1.14 2007/07/09 21:00:32 ad Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -56,7 +56,6 @@ struct iic_softc { }; static void iic_smbus_intr_thread(void *); -static void iic_smbus_intr_thread1(void *); int iicbus_print(void *aux, const char *pnp) @@ -110,17 +109,24 @@ iic_attach(struct device *parent, struct device *self, void *aux) { struct iic_softc *sc = device_private(self); struct i2cbus_attach_args *iba = aux; + i2c_tag_t ic; + int rv; aprint_naive(": I2C bus\n"); aprint_normal(": I2C bus\n"); sc->sc_tag = iba->iba_tag; sc->sc_type = iba->iba_type; - sc->sc_tag->ic_devname = self->dv_xname; + ic = sc->sc_tag; + ic->ic_devname = self->dv_xname; LIST_INIT(&(sc->sc_tag->ic_list)); LIST_INIT(&(sc->sc_tag->ic_proc_list)); - kthread_create(iic_smbus_intr_thread, sc->sc_tag); + + rv = kthread_create(PRI_NONE, 0, NULL, iic_smbus_intr_thread, + ic, &ic->ic_intr_thread, "%s", ic->ic_devname); + if (rv) + printf("%s: unable to create intr thread\n", ic->ic_devname); /* * Attach all i2c devices described in the kernel @@ -130,7 +136,7 @@ iic_attach(struct device *parent, struct device *self, void *aux) } static void -iic_smbus_intr_thread1(void *aux) +iic_smbus_intr_thread(void *aux) { i2c_tag_t ic; struct ic_intr_list *il; @@ -154,20 +160,6 @@ iic_smbus_intr_thread1(void *aux) kthread_exit(0); } -static void -iic_smbus_intr_thread(void *aux) -{ - i2c_tag_t ic; - int rv; - - ic = (i2c_tag_t)aux; - - rv = kthread_create1(iic_smbus_intr_thread1, ic, &ic->ic_intr_thread, - "%s", ic->ic_devname); - if (rv) - printf("%s: unable to create intr thread\n", ic->ic_devname); -} - void * iic_smbus_intr_establish(i2c_tag_t ic, int (*intr)(void *), void *intrarg) { diff --git a/sys/dev/i2c/i2cvar.h b/sys/dev/i2c/i2cvar.h index cb19e78d0ce..6972ea996ea 100644 --- a/sys/dev/i2c/i2cvar.h +++ b/sys/dev/i2c/i2cvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: i2cvar.h,v 1.5 2007/02/05 23:31:37 jmcneill Exp $ */ +/* $NetBSD: i2cvar.h,v 1.6 2007/07/09 21:00:33 ad Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -99,7 +99,7 @@ typedef struct i2c_controller { LIST_HEAD(, ic_intr_list) ic_proc_list; volatile int ic_running; volatile int ic_pending; - struct proc *ic_intr_thread; + struct lwp *ic_intr_thread; const char *ic_devname; } *i2c_tag_t; diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c index 55dfc12482d..9e6de436f41 100644 --- a/sys/dev/i2o/iop.c +++ b/sys/dev/i2o/iop.c @@ -1,4 +1,4 @@ -/* $NetBSD: iop.c,v 1.65 2007/06/16 12:32:12 ad Exp $ */ +/* $NetBSD: iop.c,v 1.66 2007/07/09 21:00:33 ad Exp $ */ /*- * Copyright (c) 2000, 2001, 2002, 2007 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.65 2007/06/16 12:32:12 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.66 2007/07/09 21:00:33 ad Exp $"); #include "iop.h" @@ -218,7 +218,6 @@ static int iop_print(void *, const char *); static void iop_shutdown(void *); static void iop_adjqparam(struct iop_softc *, int); -static void iop_create_reconf_thread(void *); static int iop_handle_reply(struct iop_softc *, u_int32_t); static int iop_hrt_get(struct iop_softc *); static int iop_hrt_get0(struct iop_softc *, struct i2o_hrt *, int); @@ -601,30 +600,11 @@ iop_config_interrupts(struct device *self) if ((rv = iop_reconfigure(sc, 0)) == -1) printf("%s: configure failed (%d)\n", sc->sc_dv.dv_xname, rv); - mutex_exit(&sc->sc_conflock); - - if (rv == 0) - kthread_create(iop_create_reconf_thread, sc); - -} - -/* - * Create the reconfiguration thread. Called after the standard kernel - * threads have been created. - */ -static void -iop_create_reconf_thread(void *cookie) -{ - struct iop_softc *sc; - int rv; - sc = cookie; - mutex_enter(&sc->sc_conflock); sc->sc_flags |= IOP_ONLINE; + rv = kthread_create(PRI_NONE, 0, NULL, iop_reconf_thread, sc, + &sc->sc_reconf_thread, "%s", sc->sc_dv.dv_xname); mutex_exit(&sc->sc_conflock); - - rv = kthread_create1(iop_reconf_thread, sc, &sc->sc_reconf_proc, - "%s", sc->sc_dv.dv_xname); if (rv != 0) { printf("%s: unable to create reconfiguration thread (%d)", sc->sc_dv.dv_xname, rv); @@ -1122,9 +1102,9 @@ iop_hrt_get(struct iop_softc *sc) struct i2o_hrt hrthdr, *hrt; int size, rv; - PHOLD(curlwp); + uvm_lwp_hold(curlwp); rv = iop_hrt_get0(sc, &hrthdr, sizeof(hrthdr)); - PRELE(curlwp); + uvm_lwp_rele(curlwp); if (rv != 0) return (rv); @@ -1298,7 +1278,7 @@ iop_field_get_all(struct iop_softc *sc, int tid, int group, void *buf, pgop->oat.group = htole16(group); if (ii == NULL) - PHOLD(curlwp); + uvm_lwp_hold(curlwp); memset(buf, 0, size); iop_msg_map(sc, im, mb, pgop, sizeof(*pgop), 1, NULL); @@ -1306,7 +1286,7 @@ iop_field_get_all(struct iop_softc *sc, int tid, int group, void *buf, rv = iop_msg_post(sc, im, mb, (ii == NULL ? 30000 : 0)); if (ii == NULL) - PRELE(curlwp); + uvm_lwp_rele(curlwp); /* Detect errors; let partial transfers to count as success. */ if (ii == NULL && rv == 0) { @@ -1406,7 +1386,7 @@ iop_table_clear(struct iop_softc *sc, int tid, int group) pgop.oat.group = htole16(group); pgop.oat.fields[0] = htole16(0); - PHOLD(curlwp); + uvm_lwp_hold(curlwp); iop_msg_map(sc, im, mb, &pgop, sizeof(pgop), 1, NULL); rv = iop_msg_post(sc, im, mb, 30000); if (rv != 0) @@ -1414,7 +1394,7 @@ iop_table_clear(struct iop_softc *sc, int tid, int group) sc->sc_dv.dv_xname, tid, group); iop_msg_unmap(sc, im); - PRELE(curlwp); + uvm_lwp_rele(curlwp); iop_msg_free(sc, im); return (rv); } @@ -1545,14 +1525,14 @@ iop_systab_set(struct iop_softc *sc) } } - PHOLD(curlwp); + uvm_lwp_hold(curlwp); iop_msg_map(sc, im, mb, iop_systab, iop_systab_size, 1, NULL); iop_msg_map(sc, im, mb, mema, sizeof(mema), 1, NULL); iop_msg_map(sc, im, mb, ioa, sizeof(ioa), 1, NULL); rv = iop_msg_post(sc, im, mb, 5000); iop_msg_unmap(sc, im); iop_msg_free(sc, im); - PRELE(curlwp); + uvm_lwp_rele(curlwp); return (rv); } diff --git a/sys/dev/i2o/iopl.c b/sys/dev/i2o/iopl.c index 6d169fb2ea7..6ae1ebb817e 100644 --- a/sys/dev/i2o/iopl.c +++ b/sys/dev/i2o/iopl.c @@ -1,4 +1,4 @@ -/* $NetBSD: iopl.c,v 1.25 2007/06/16 12:32:12 ad Exp $ */ +/* $NetBSD: iopl.c,v 1.26 2007/07/09 21:00:33 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iopl.c,v 1.25 2007/06/16 12:32:12 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iopl.c,v 1.26 2007/07/09 21:00:33 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -1390,7 +1390,7 @@ iopl_init(struct ifnet *ifp) sc->sc_flags |= (IOPL_MEDIA_CHANGE | IOPL_INITTED); splx(s); - callout_init(&sc->sc_pg_callout); + callout_init(&sc->sc_pg_callout, 0); sc->sc_next_pg = -1; iopl_tick_sched(sc); diff --git a/sys/dev/i2o/iopvar.h b/sys/dev/i2o/iopvar.h index 26acb7c7db2..405fb3c1ff0 100644 --- a/sys/dev/i2o/iopvar.h +++ b/sys/dev/i2o/iopvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: iopvar.h,v 1.19 2007/06/16 12:32:13 ad Exp $ */ +/* $NetBSD: iopvar.h,v 1.20 2007/07/09 21:00:33 ad Exp $ */ /*- * Copyright (c) 2000, 2001, 2002, 2007 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ struct iop_softc { u_int32_t sc_chgind; /* Configuration change indicator */ kmutex_t sc_conflock; /* Configuration lock */ kcondvar_t sc_confcv; /* Configuration CV */ - struct proc *sc_reconf_proc;/* Auto reconfiguration process */ + lwp_t *sc_reconf_thread;/* Auto reconfiguration process */ LIST_HEAD(, iop_initiator) sc_iilist;/* Initiator list */ int sc_nii; /* Total number of initiators */ int sc_nuii; /* Number of utility initiators */ diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index afad716f84b..d72d4cfbfd9 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $NetBSD: aac.c,v 1.34 2007/06/05 04:04:13 briggs Exp $ */ +/* $NetBSD: aac.c,v 1.35 2007/07/09 21:00:33 ad Exp $ */ /*- * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.34 2007/06/05 04:04:13 briggs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.35 2007/07/09 21:00:33 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -85,6 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.34 2007/06/05 04:04:13 briggs Exp $"); #include <sys/device.h> #include <sys/kernel.h> #include <sys/malloc.h> +#include <sys/proc.h> #include <machine/bus.h> diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index a1c4df95215..c93efa269f6 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,4 +1,4 @@ -/* $NetBSD: adv.c,v 1.39 2007/03/04 06:01:48 christos Exp $ */ +/* $NetBSD: adv.c,v 1.40 2007/07/09 21:00:33 ad Exp $ */ /* * Generic driver for the Advanced Systems Inc. Narrow SCSI controllers @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: adv.c,v 1.39 2007/03/04 06:01:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adv.c,v 1.40 2007/07/09 21:00:33 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -232,7 +232,7 @@ adv_init_ccb(sc, ccb) { int hashnum, error; - callout_init(&ccb->ccb_watchdog); + callout_init(&ccb->ccb_watchdog, 0); /* * Create the DMA map for this CCB. diff --git a/sys/dev/ic/ahcisata_core.c b/sys/dev/ic/ahcisata_core.c index d36536bef2b..fc0a1a72860 100644 --- a/sys/dev/ic/ahcisata_core.c +++ b/sys/dev/ic/ahcisata_core.c @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_core.c,v 1.3 2007/06/25 20:58:07 bouyer Exp $ */ +/* $NetBSD: ahcisata_core.c,v 1.4 2007/07/09 21:00:34 ad Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.3 2007/06/25 20:58:07 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.4 2007/07/09 21:00:34 ad Exp $"); #include <sys/types.h> #include <sys/malloc.h> @@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.3 2007/06/25 20:58:07 bouyer Exp #include <sys/kernel.h> #include <sys/systm.h> #include <sys/disklabel.h> +#include <sys/proc.h> #include <uvm/uvm_extern.h> diff --git a/sys/dev/ic/aic6915.c b/sys/dev/ic/aic6915.c index 5bca7720173..416e43599f4 100644 --- a/sys/dev/ic/aic6915.c +++ b/sys/dev/ic/aic6915.c @@ -1,4 +1,4 @@ -/* $NetBSD: aic6915.c,v 1.16 2007/03/04 06:01:48 christos Exp $ */ +/* $NetBSD: aic6915.c,v 1.17 2007/07/09 21:00:34 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.16 2007/03/04 06:01:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.17 2007/07/09 21:00:34 ad Exp $"); #include "bpfilter.h" @@ -156,7 +156,7 @@ sf_attach(struct sf_softc *sc) bus_dma_segment_t seg; u_int8_t enaddr[ETHER_ADDR_LEN]; - callout_init(&sc->sc_tick_callout); + callout_init(&sc->sc_tick_callout, 0); /* * If we're I/O mapped, the functional register handle is diff --git a/sys/dev/ic/aic79xx_osm.h b/sys/dev/ic/aic79xx_osm.h index 7a89725d510..59b62eafd0c 100644 --- a/sys/dev/ic/aic79xx_osm.h +++ b/sys/dev/ic/aic79xx_osm.h @@ -1,4 +1,4 @@ -/* $NetBSD: aic79xx_osm.h,v 1.12 2006/11/16 01:32:50 christos Exp $ */ +/* $NetBSD: aic79xx_osm.h,v 1.13 2007/07/09 21:00:34 ad Exp $ */ /* * NetBSD platform specific driver option settings, data structures, @@ -32,9 +32,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: aic79xx_osm.h,v 1.12 2006/11/16 01:32:50 christos Exp $ + * $NetBSD: aic79xx_osm.h,v 1.13 2007/07/09 21:00:34 ad Exp $ * - * //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#19 $$NetBSD: aic79xx_osm.h,v 1.12 2006/11/16 01:32:50 christos Exp $ + * //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#19 $$NetBSD: aic79xx_osm.h,v 1.13 2007/07/09 21:00:34 ad Exp $ * * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.9 2003/05/26 21:43:29 gibbs Exp $ */ @@ -188,7 +188,7 @@ typedef struct callout ahd_timer_t; /***************************** Timer Facilities *******************************/ void ahd_timeout(void*); -#define ahd_timer_init(timer) callout_init(timer) +#define ahd_timer_init(timer) callout_init(timer, 0) #define ahd_timer_stop callout_stop static __inline void diff --git a/sys/dev/ic/aic7xxx_osm.h b/sys/dev/ic/aic7xxx_osm.h index 39ce1f0cbfa..786c7dce966 100644 --- a/sys/dev/ic/aic7xxx_osm.h +++ b/sys/dev/ic/aic7xxx_osm.h @@ -1,4 +1,4 @@ -/* $NetBSD: aic7xxx_osm.h,v 1.17 2006/11/16 01:32:51 christos Exp $ */ +/* $NetBSD: aic7xxx_osm.h,v 1.18 2007/07/09 21:00:34 ad Exp $ */ /* * NetBSD platform specific driver option settings, data structures, @@ -206,7 +206,7 @@ typedef struct callout ahc_timer_t; /***************************** Timer Facilities *******************************/ void ahc_timeout(void*); -#define ahc_timer_init callout_init +#define ahc_timer_init(x) callout_init(x, 0) #define ahc_timer_stop callout_stop static __inline void diff --git a/sys/dev/ic/ath_netbsd.h b/sys/dev/ic/ath_netbsd.h index a427a8426fe..ae6056b3173 100644 --- a/sys/dev/ic/ath_netbsd.h +++ b/sys/dev/ic/ath_netbsd.h @@ -1,4 +1,4 @@ -/* $NetBSD: ath_netbsd.h,v 1.5 2006/02/05 06:03:26 xtraeme Exp $ */ +/* $NetBSD: ath_netbsd.h,v 1.6 2007/07/09 21:00:34 ad Exp $ */ /*- * Copyright (c) 2003, 2004 David Young @@ -39,8 +39,7 @@ typedef struct ath_task { #define M_RDONLY M_EXT /* XXX check different/additional flags? */ -#define CALLOUT_MPSAFE 0 -#define ATH_CALLOUT_INIT(__ch, __mpsafe) callout_init((__ch)) +#define ATH_CALLOUT_INIT(__ch, __mpsafe) callout_init((__ch), 0) #define TASK_INIT(__task, __zero, __func, __context) \ do { \ diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index 30bf11381e8..6f150b0f769 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.126 2007/03/04 06:01:50 christos Exp $ */ +/* $NetBSD: atw.c,v 1.127 2007/07/09 21:00:34 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.126 2007/03/04 06:01:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.127 2007/07/09 21:00:34 ad Exp $"); #include "bpfilter.h" @@ -853,7 +853,7 @@ atw_attach(struct atw_softc *sc) /* complete initialization */ ieee80211_media_init(ic, atw_media_change, ieee80211_media_status); - callout_init(&sc->sc_scan_ch); + callout_init(&sc->sc_scan_ch, 0); #if NBPFILTER > 0 bpfattach2(ifp, DLT_IEEE802_11_RADIO, diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 93dc8eac074..62933a59e95 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $NetBSD: cac.c,v 1.40 2007/03/04 06:01:51 christos Exp $ */ +/* $NetBSD: cac.c,v 1.41 2007/07/09 21:00:34 ad Exp $ */ /*- * Copyright (c) 2000, 2006, 2007 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.40 2007/03/04 06:01:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.41 2007/07/09 21:00:34 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -366,7 +366,7 @@ cac_ccb_poll(struct cac_softc *sc, struct cac_ccb *wantccb, int timo) { struct cac_ccb *ccb; - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); timo *= 1000; @@ -396,7 +396,7 @@ static int cac_ccb_start(struct cac_softc *sc, struct cac_ccb *ccb) { - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); if (ccb != NULL) SIMPLEQ_INSERT_TAIL(&sc->sc_ccb_queue, ccb, ccb_chain); @@ -426,7 +426,7 @@ cac_ccb_done(struct cac_softc *sc, struct cac_ccb *ccb) error = 0; - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); #ifdef DIAGNOSTIC if ((ccb->ccb_flags & CAC_CCB_ACTIVE) == 0) @@ -493,7 +493,7 @@ static void cac_ccb_free(struct cac_softc *sc, struct cac_ccb *ccb) { - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); ccb->ccb_flags = 0; if (SIMPLEQ_EMPTY(&sc->sc_ccb_free)) @@ -509,7 +509,7 @@ static int cac_l0_fifo_full(struct cac_softc *sc) { - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); return (cac_inl(sc, CAC_REG_CMD_FIFO) == 0); } @@ -518,7 +518,7 @@ static void cac_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb) { - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, (char *)ccb - (char *)sc->sc_ccbs, @@ -532,7 +532,7 @@ cac_l0_completed(struct cac_softc *sc) struct cac_ccb *ccb; paddr_t off; - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); if ((off = cac_inl(sc, CAC_REG_DONE_FIFO)) == 0) return (NULL); @@ -557,7 +557,7 @@ static int cac_l0_intr_pending(struct cac_softc *sc) { - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); return (cac_inl(sc, CAC_REG_INTR_PENDING) & CAC_INTR_ENABLE); } @@ -566,7 +566,7 @@ static void cac_l0_intr_enable(struct cac_softc *sc, int state) { - LOCK_ASSERT(mutex_owned(&sc->sc_mutex)); + KASSERT(mutex_owned(&sc->sc_mutex)); cac_outl(sc, CAC_REG_INTR_MASK, state ? CAC_INTR_ENABLE : CAC_INTR_DISABLE); diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 27df63e6616..766e48dc316 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $NetBSD: ciss.c,v 1.7 2007/03/04 06:01:53 christos Exp $ */ +/* $NetBSD: ciss.c,v 1.8 2007/07/09 21:00:35 ad Exp $ */ /* $OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $ */ /* @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.7 2007/03/04 06:01:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.8 2007/07/09 21:00:35 ad Exp $"); /* #define CISS_DEBUG */ @@ -312,7 +312,7 @@ ciss_attach(struct ciss_softc *sc) CISS_UNLOCK_SCRATCH(sc, lock); - callout_init(&sc->sc_hb); + callout_init(&sc->sc_hb, 0); callout_setfunc(&sc->sc_hb, ciss_heartbeat, sc); callout_schedule(&sc->sc_hb, hz * 3); diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index e45832ff295..be259e0f347 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.259 2007/03/04 06:01:53 christos Exp $ */ +/* $NetBSD: com.c,v 1.260 2007/07/09 21:00:35 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.259 2007/03/04 06:01:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.260 2007/07/09 21:00:35 ad Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -400,7 +400,7 @@ com_attach_subr(struct com_softc *sc) aprint_naive("\n"); - callout_init(&sc->sc_diag_callout); + callout_init(&sc->sc_diag_callout, 0); simple_lock_init(&sc->sc_lock); /* Disable interrupts before configuring the device. */ diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index 03df74c551e..f6dbbc3c923 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $NetBSD: cy.c,v 1.50 2007/03/04 06:01:53 christos Exp $ */ +/* $NetBSD: cy.c,v 1.51 2007/07/09 21:00:35 ad Exp $ */ /* * cy.c @@ -16,7 +16,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.50 2007/03/04 06:01:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.51 2007/07/09 21:00:35 ad Exp $"); #include <sys/param.h> #include <sys/ioctl.h> @@ -67,8 +67,8 @@ static int cy_open = 0; static int cy_events = 0; int cy_attached_ttys; - -struct callout cy_poll_callout = CALLOUT_INITIALIZER; +bool cy_callout_init; +callout_t cy_poll_callout; /* * Common probe routine @@ -175,6 +175,11 @@ cy_attach(struct cy_softc *sc) int port, cy_chip, num_chips, cdu, chip; int cy_clock; + if (!cy_callout_init) { + cy_callout_init = true; + callout_init(&cy_poll_callout, 0); + } + num_chips = sc->sc_nchips; if (num_chips == 0) return; diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c index 41bf83cd62f..13333a501bd 100644 --- a/sys/dev/ic/dpt.c +++ b/sys/dev/ic/dpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dpt.c,v 1.56 2007/03/04 06:01:54 christos Exp $ */ +/* $NetBSD: dpt.c,v 1.57 2007/07/09 21:00:35 ad Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.56 2007/03/04 06:01:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.57 2007/07/09 21:00:35 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -88,6 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.56 2007/03/04 06:01:54 christos Exp $"); #include <sys/endian.h> #include <sys/conf.h> #include <sys/kauth.h> +#include <sys/proc.h> #include <uvm/uvm_extern.h> @@ -1348,7 +1349,7 @@ dpt_passthrough(struct dpt_softc *sc, struct eata_ucp *ucp, struct lwp *l) /* * Start the command and sleep on completion. */ - PHOLD(curlwp); /* XXXJRT curlwp */ + uvm_lwp_hold(curlwp); bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, CCB_OFF(sc, ccb), sizeof(struct dpt_ccb), BUS_DMASYNC_PREWRITE); s = splbio(); @@ -1358,7 +1359,7 @@ dpt_passthrough(struct dpt_softc *sc, struct eata_ucp *ucp, struct lwp *l) panic("%s: dpt_cmd failed", sc->sc_dv.dv_xname); tsleep(ccb, PWAIT, "dptucmd", 0); splx(s); - PRELE(curlwp); /* XXXJRT curlwp */ + uvm_lwp_rele(curlwp); /* * Sync up the DMA map and copy out results. diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 1f1e28bc9d8..fdd58a8c46c 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $NetBSD: elink3.c,v 1.121 2007/03/04 06:01:54 christos Exp $ */ +/* $NetBSD: elink3.c,v 1.122 2007/07/09 21:00:35 ad Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.121 2007/03/04 06:01:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.122 2007/07/09 21:00:35 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -348,8 +348,8 @@ epconfig(sc, chipset, enaddr) u_int16_t i; u_int8_t myla[ETHER_ADDR_LEN]; - callout_init(&sc->sc_mii_callout); - callout_init(&sc->sc_mbuf_callout); + callout_init(&sc->sc_mii_callout, 0); + callout_init(&sc->sc_mbuf_callout, 0); sc->ep_chipset = chipset; diff --git a/sys/dev/ic/elinkxl.c b/sys/dev/ic/elinkxl.c index d353cf17ec5..55705612245 100644 --- a/sys/dev/ic/elinkxl.c +++ b/sys/dev/ic/elinkxl.c @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.96 2007/03/04 06:01:54 christos Exp $ */ +/* $NetBSD: elinkxl.c,v 1.97 2007/07/09 21:00:35 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.96 2007/03/04 06:01:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.97 2007/07/09 21:00:35 ad Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -192,7 +192,7 @@ ex_config(sc) bus_space_handle_t ioh = sc->sc_ioh; int i, error, attach_stage; - callout_init(&sc->ex_mii_callout); + callout_init(&sc->ex_mii_callout, 0); ex_reset(sc); diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 1203eb52ffa..a1522933b12 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.56 2007/04/12 06:14:40 dyoung Exp $ */ +/* $NetBSD: gem.c,v 1.57 2007/07/09 21:00:35 ad Exp $ */ /* * @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.56 2007/04/12 06:14:40 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.57 2007/07/09 21:00:35 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -444,7 +444,7 @@ gem_attach(sc, enaddr) sc->sc_dev.dv_xname); #endif - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); return; /* diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index f683aec6ea0..ce2e9d460b8 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $NetBSD: hme.c,v 1.56 2007/03/04 06:01:55 christos Exp $ */ +/* $NetBSD: hme.c,v 1.57 2007/07/09 21:00:36 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.56 2007/03/04 06:01:55 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.57 2007/07/09 21:00:36 ad Exp $"); /* #define HMEDEBUG */ @@ -324,7 +324,7 @@ hme_config(sc) RND_TYPE_NET, 0); #endif - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); } void diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c index f87b17d6fff..ad6e6c70644 100644 --- a/sys/dev/ic/i82365.c +++ b/sys/dev/ic/i82365.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82365.c,v 1.98 2007/03/04 06:01:55 christos Exp $ */ +/* $NetBSD: i82365.c,v 1.99 2007/07/09 21:00:36 ad Exp $ */ /* * Copyright (c) 2004 Charles M. Hannum. All rights reserved. @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.98 2007/03/04 06:01:55 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.99 2007/07/09 21:00:36 ad Exp $"); #define PCICDEBUG @@ -100,7 +100,6 @@ void pcic_deactivate_card(struct pcic_handle *); void pcic_chip_do_mem_map(struct pcic_handle *, int); void pcic_chip_do_io_map(struct pcic_handle *, int); -void pcic_create_event_thread(void *); void pcic_event_thread(void *); void pcic_queue_event(struct pcic_handle *, int); @@ -398,6 +397,7 @@ pcic_attach_socket(h) struct pcmciabus_attach_args paa; struct pcic_softc *sc = (struct pcic_softc *)h->ph_parent; int locs[PCMCIABUSCF_NLOCS]; + char cs[4]; /* initialize the rest of the handle */ @@ -432,7 +432,14 @@ pcic_attach_socket(h) panic("pcic_attach_socket: event thread"); #endif config_pending_incr(); - kthread_create(pcic_create_event_thread, h); + snprintf(cs, sizeof(cs), "%d,%d", h->chip, h->socket); + + if (kthread_create(PRI_NONE, 0, NULL, pcic_event_thread, h, + &h->event_thread, "%s,%s", h->ph_parent->dv_xname, cs)) { + printf("%s: unable to create event thread for sock 0x%02x\n", + h->ph_parent->dv_xname, h->sock); + panic("pcic_attach_socket"); + } } /* @@ -476,7 +483,7 @@ pcic_attach_socket_finish(h) reg = PCIC_CSC_INTR_CD_ENABLE; if (sc->irq == -1) { if (sc->poll_established == 0) { - callout_init(&sc->poll_ch); + callout_init(&sc->poll_ch, 0); callout_reset(&sc->poll_ch, hz / 2, pcic_poll_intr, sc); sc->poll_established = 1; } @@ -517,23 +524,6 @@ pcic_attach_socket_finish(h) } void -pcic_create_event_thread(arg) - void *arg; -{ - struct pcic_handle *h = arg; - char cs[4]; - - snprintf(cs, sizeof(cs), "%d,%d", h->chip, h->socket); - - if (kthread_create1(pcic_event_thread, h, &h->event_thread, - "%s,%s", h->ph_parent->dv_xname, cs)) { - printf("%s: unable to create event thread for sock 0x%02x\n", - h->ph_parent->dv_xname, h->sock); - panic("pcic_create_event_thread"); - } -} - -void pcic_event_thread(arg) void *arg; { diff --git a/sys/dev/ic/i82365var.h b/sys/dev/ic/i82365var.h index ad3936fe197..acc365a21da 100644 --- a/sys/dev/ic/i82365var.h +++ b/sys/dev/ic/i82365var.h @@ -1,4 +1,4 @@ -/* $NetBSD: i82365var.h,v 1.26 2006/02/16 20:17:16 perry Exp $ */ +/* $NetBSD: i82365var.h,v 1.27 2007/07/09 21:00:36 ad Exp $ */ /* * Copyright (c) 1997 Marc Horowitz. All rights reserved. @@ -79,7 +79,7 @@ struct pcic_handle { struct device *pcmcia; int shutdown; - struct proc *event_thread; + struct lwp *event_thread; SIMPLEQ_HEAD(, pcic_event) events; }; diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index 07a2922c2aa..9e0a24c8c3a 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.101 2007/03/04 06:01:55 christos Exp $ */ +/* $NetBSD: i82557.c,v 1.102 2007/07/09 21:00:36 ad Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.101 2007/03/04 06:01:55 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.102 2007/07/09 21:00:36 ad Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -271,7 +271,7 @@ fxp_attach(struct fxp_softc *sc) int rseg, i, error; struct fxp_phytype *fp; - callout_init(&sc->sc_callout); + callout_init(&sc->sc_callout, 0); /* * Enable some good stuff on i82558 and later. diff --git a/sys/dev/ic/icp.c b/sys/dev/ic/icp.c index fc10505a837..72044d9cccc 100644 --- a/sys/dev/ic/icp.c +++ b/sys/dev/ic/icp.c @@ -1,4 +1,4 @@ -/* $NetBSD: icp.c,v 1.24 2007/03/11 22:16:32 ad Exp $ */ +/* $NetBSD: icp.c,v 1.25 2007/07/09 21:00:36 ad Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -83,7 +83,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.24 2007/03/11 22:16:32 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.25 2007/07/09 21:00:36 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -150,7 +150,7 @@ icp_init(struct icp_softc *icp, const char *intrstr) SIMPLEQ_INIT(&icp->icp_ccb_queue); SIMPLEQ_INIT(&icp->icp_ccb_freelist); SIMPLEQ_INIT(&icp->icp_ucmd_queue); - callout_init(&icp->icp_wdog_callout); + callout_init(&icp->icp_wdog_callout, 0); /* * Allocate a scratch area. diff --git a/sys/dev/ic/isp_netbsd.c b/sys/dev/ic/isp_netbsd.c index 756dc8276b3..d33534578a5 100644 --- a/sys/dev/ic/isp_netbsd.c +++ b/sys/dev/ic/isp_netbsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: isp_netbsd.c,v 1.74 2007/05/24 21:30:43 mjacob Exp $ */ +/* $NetBSD: isp_netbsd.c,v 1.75 2007/07/09 21:00:36 ad Exp $ */ /* * Platform (NetBSD) dependent common attachment code for Qlogic adapters. */ @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.74 2007/05/24 21:30:43 mjacob Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.75 2007/07/09 21:00:36 ad Exp $"); #include <dev/ic/isp_netbsd.h> #include <dev/ic/isp_ioctl.h> @@ -72,7 +72,6 @@ static void isp_gdt(void *); static void isp_ldt(void *); static void isp_make_here(ispsoftc_t *, int); static void isp_make_gone(ispsoftc_t *, int); -static void isp_create_fc_worker(void *); static void isp_fc_worker(void *); static const char *roles[4] = { @@ -120,16 +119,15 @@ isp_attach(struct ispsoftc *isp) */ isp->isp_osinfo._chan.chan_nluns = min(isp->isp_maxluns, 8); - callout_init(&isp->isp_osinfo.gdt); + callout_init(&isp->isp_osinfo.gdt, 0); callout_setfunc(&isp->isp_osinfo.gdt, isp_gdt, isp); - callout_init(&isp->isp_osinfo.ldt); + callout_init(&isp->isp_osinfo.ldt, 0); callout_setfunc(&isp->isp_osinfo.ldt, isp_ldt, isp); if (IS_FC(isp)) { isp->isp_osinfo._chan.chan_ntargets = MAX_FC_TARG; isp->isp_osinfo._chan.chan_id = MAX_FC_TARG; - kthread_create(isp_create_fc_worker, isp); #ifdef ISP_FW_CRASH_DUMP if (IS_2200(isp)) { FCPARAM(isp)->isp_dump_data = @@ -186,7 +184,15 @@ static void isp_config_interrupts(struct device *self) { struct ispsoftc *isp = (struct ispsoftc *) self; - isp->isp_osinfo.mbox_sleep_ok = 1; + + isp->isp_osinfo.mbox_sleep_ok = 1; + + if (kthread_create(PRI_NONE, 0, NULL, isp_fc_worker, isp, + &isp->isp_osinfo.thread, "%s:fc_thrd", isp->isp_name)) { + isp_prt(isp, ISP_LOGERR, + "unable to create FC worker thread"); + panic("isp_config_interrupts"); + } } @@ -878,22 +884,6 @@ isp_make_gone(ispsoftc_t *isp, int tgt) isp_prt(isp, ISP_LOGINFO, "target %d has departed", tgt); } -/* - * Fibre Channel state cleanup thread - */ -static void -isp_create_fc_worker(void *arg) -{ - struct ispsoftc *isp = arg; - if (kthread_create1(isp_fc_worker, isp, &isp->isp_osinfo.thread, - "%s:fc_thrd", isp->isp_name)) { - isp_prt(isp, ISP_LOGERR, "unable to create FC worker thread"); - panic("isp_create_fc_worker"); - } - -} - - static void isp_fc_worker(void *arg) { diff --git a/sys/dev/ic/isp_netbsd.h b/sys/dev/ic/isp_netbsd.h index 59f7a4ac216..c608ee7529d 100644 --- a/sys/dev/ic/isp_netbsd.h +++ b/sys/dev/ic/isp_netbsd.h @@ -1,4 +1,4 @@ -/* $NetBSD: isp_netbsd.h,v 1.61 2007/07/08 05:22:33 mjacob Exp $ */ +/* $NetBSD: isp_netbsd.h,v 1.62 2007/07/09 21:00:37 ad Exp $ */ /* * NetBSD Specific definitions for the Qlogic ISP Host Adapter */ @@ -104,7 +104,7 @@ struct isposinfo { #define wwn_seed un._wwn #define discovered un._discovered } un; - struct proc * thread; + struct lwp * thread; }; #define isp_dmatag isp_osinfo.dmatag #define isp_rqdmap isp_osinfo.rqdmap diff --git a/sys/dev/ic/lpt.c b/sys/dev/ic/lpt.c index 231f3f2c428..e7557586374 100644 --- a/sys/dev/ic/lpt.c +++ b/sys/dev/ic/lpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt.c,v 1.69 2007/03/04 06:01:57 christos Exp $ */ +/* $NetBSD: lpt.c,v 1.70 2007/07/09 21:00:37 ad Exp $ */ /* * Copyright (c) 1993, 1994 Charles M. Hannum. @@ -54,7 +54,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.69 2007/03/04 06:01:57 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.70 2007/07/09 21:00:37 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -118,7 +118,7 @@ lpt_attach_subr(sc) bus_space_write_1(iot, ioh, lpt_control, LPC_NINIT); - callout_init(&sc->sc_wakeup_ch); + callout_init(&sc->sc_wakeup_ch, 0); sc->sc_dev_ok = 1; } diff --git a/sys/dev/ic/matrixkp_subr.c b/sys/dev/ic/matrixkp_subr.c index e81ad611e63..087396f61d7 100644 --- a/sys/dev/ic/matrixkp_subr.c +++ b/sys/dev/ic/matrixkp_subr.c @@ -46,7 +46,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: matrixkp_subr.c,v 1.5 2007/03/04 06:01:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: matrixkp_subr.c,v 1.6 2007/07/09 21:00:37 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -81,7 +81,7 @@ mxkp_attach(struct matrixkp_softc *sc) { u_int32_t i; - callout_init(&sc->sc_callout); + callout_init(&sc->sc_callout, 0); callout_setfunc(&sc->sc_callout, mxkp_poll, sc); if (sc->poll_freq > hz || sc->poll_freq == 0) sc->poll_freq = hz; diff --git a/sys/dev/ic/mlx.c b/sys/dev/ic/mlx.c index 7a7f1cbc5b5..67c944357f4 100644 --- a/sys/dev/ic/mlx.c +++ b/sys/dev/ic/mlx.c @@ -1,4 +1,4 @@ -/* $NetBSD: mlx.c,v 1.51 2007/03/04 06:01:58 christos Exp $ */ +/* $NetBSD: mlx.c,v 1.52 2007/07/09 21:00:37 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.51 2007/03/04 06:01:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.52 2007/07/09 21:00:37 ad Exp $"); #include "ld.h" @@ -125,7 +125,6 @@ static int mlx_fw_message(struct mlx_softc *, int, int, int); static void mlx_pause_action(struct mlx_softc *); static void mlx_pause_done(struct mlx_ccb *); static void mlx_periodic(struct mlx_softc *); -static void mlx_periodic_create(void *); static void mlx_periodic_enquiry(struct mlx_ccb *); static void mlx_periodic_eventlog_poll(struct mlx_softc *); static void mlx_periodic_eventlog_respond(struct mlx_ccb *); @@ -146,7 +145,7 @@ const struct cdevsw mlx_cdevsw = { }; extern struct cfdriver mlx_cd; -static struct proc *mlx_periodic_proc; +static struct lwp *mlx_periodic_lwp; static void *mlx_sdh; static struct { @@ -491,6 +490,11 @@ mlx_init(struct mlx_softc *mlx, const char *intrstr) } #endif + /* Attach child devices and enable interrupts. */ + mlx_configure(mlx, 0); + (*mlx->mlx_intaction)(mlx, 1); + mlx->mlx_flags |= MLXF_INITOK; + if (mlx_sdh == NULL) { /* * Set our `shutdownhook' before we start any device @@ -498,15 +502,12 @@ mlx_init(struct mlx_softc *mlx, const char *intrstr) */ mlx_sdh = shutdownhook_establish(mlx_shutdown, NULL); - /* Arrange to create a status monitoring thread. */ - kthread_create(mlx_periodic_create, NULL); + /* Create a status monitoring thread. */ + rv = kthread_create(PRI_NONE, 0, NULL, mlx_periodic_thread, + NULL, &mlx_periodic_lwp, "mlxtask"); + if (rv != 0) + printf("mlx_init: unable to create thread (%d)\n", rv); } - - /* Finally, attach child devices and enable interrupts. */ - mlx_configure(mlx, 0); - (*mlx->mlx_intaction)(mlx, 1); - - mlx->mlx_flags |= MLXF_INITOK; } /* @@ -947,23 +948,6 @@ mlxioctl(dev_t dev, u_long cmd, void *data, int flag, return (ENOTTY); /* XXX shut up gcc */ } -/* - * Fire off commands to periodically check the status of connected drives. - * Check for commands that have timed out. - */ -static void -mlx_periodic_create(void *cookie) -{ - int rv; - - rv = kthread_create1(mlx_periodic_thread, NULL, &mlx_periodic_proc, - "mlxtask"); - if (rv == 0) - return; - - printf("mlx_periodic_create: unable to create thread (%d)\n", rv); -} - static void mlx_periodic_thread(void *cookie) { diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index 9efd4fe5bfb..eb9db6be1af 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $NetBSD: ncr53c9x.c,v 1.127 2007/03/12 18:18:30 ad Exp $ */ +/* $NetBSD: ncr53c9x.c,v 1.128 2007/07/09 21:00:37 ad Exp $ */ /*- * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.127 2007/03/12 18:18:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.128 2007/07/09 21:00:37 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -204,7 +204,7 @@ ncr53c9x_attach(sc) simple_lock_init(&sc->sc_lock); - callout_init(&sc->sc_watchdog); + callout_init(&sc->sc_watchdog, 0); /* * Note, the front-end has set us up to print the chip variation. diff --git a/sys/dev/ic/ninjaata32.c b/sys/dev/ic/ninjaata32.c index 294ea451ac8..bea94864ca3 100644 --- a/sys/dev/ic/ninjaata32.c +++ b/sys/dev/ic/ninjaata32.c @@ -1,4 +1,4 @@ -/* $NetBSD: ninjaata32.c,v 1.7 2007/03/04 06:01:59 christos Exp $ */ +/* $NetBSD: ninjaata32.c,v 1.8 2007/07/09 21:00:37 ad Exp $ */ /* * Copyright (c) 2006 ITOH Yasufumi <itohy@NetBSD.org>. @@ -27,11 +27,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ninjaata32.c,v 1.7 2007/03/04 06:01:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ninjaata32.c,v 1.8 2007/07/09 21:00:37 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> #include <sys/device.h> +#include <sys/proc.h> #include <machine/bus.h> #include <machine/intr.h> diff --git a/sys/dev/ic/ninjascsi32.c b/sys/dev/ic/ninjascsi32.c index da1543af468..310ae769471 100644 --- a/sys/dev/ic/ninjascsi32.c +++ b/sys/dev/ic/ninjascsi32.c @@ -1,4 +1,4 @@ -/* $NetBSD: ninjascsi32.c,v 1.10 2007/03/04 06:01:59 christos Exp $ */ +/* $NetBSD: ninjascsi32.c,v 1.11 2007/07/09 21:00:37 ad Exp $ */ /*- * Copyright (c) 2004, 2006 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ninjascsi32.c,v 1.10 2007/03/04 06:01:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ninjascsi32.c,v 1.11 2007/07/09 21:00:37 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: ninjascsi32.c,v 1.10 2007/03/04 06:01:59 christos Ex #include <sys/kernel.h> #include <sys/buf.h> #include <sys/scsiio.h> +#include <sys/proc.h> #include <machine/bus.h> #include <machine/intr.h> diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index a6448b23688..f3f5e170c04 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc.c,v 1.36 2007/06/24 19:07:00 christos Exp $ */ +/* $NetBSD: pckbc.c,v 1.37 2007/07/09 21:00:38 ad Exp $ */ /* * Copyright (c) 2004 Ben Harris. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.36 2007/06/24 19:07:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.37 2007/07/09 21:00:38 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -668,7 +668,7 @@ pckbc_cnattach(iot, addr, cmd_offset, slot) pckbc_consdata.t_ioh_d = ioh_d; pckbc_consdata.t_ioh_c = ioh_c; pckbc_consdata.t_addr = addr; - callout_init(&pckbc_consdata.t_cleanup); + callout_init(&pckbc_consdata.t_cleanup, 0); /* flush */ (void) pckbc_poll_data1(&pckbc_consdata, PCKBC_KBD_SLOT); diff --git a/sys/dev/ic/rrunner.c b/sys/dev/ic/rrunner.c index ee55f101e04..347c0be048c 100644 --- a/sys/dev/ic/rrunner.c +++ b/sys/dev/ic/rrunner.c @@ -1,4 +1,4 @@ -/* $NetBSD: rrunner.c,v 1.61 2007/03/04 06:02:00 christos Exp $ */ +/* $NetBSD: rrunner.c,v 1.62 2007/07/09 21:00:38 ad Exp $ */ /* * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.61 2007/03/04 06:02:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.62 2007/07/09 21:00:38 ad Exp $"); #include "opt_inet.h" @@ -1037,7 +1037,7 @@ esh_fpread(dev_t dev, struct uio *uio, int ioflag) } } - PHOLD(l); /* Lock process info into memory */ + uvm_lwp_hold(l); /* Lock process info into memory */ /* Lock down the pages */ for (i = 0; i < uio->uio_iovcnt; i++) { @@ -1141,7 +1141,7 @@ esh_fpread(dev_t dev, struct uio *uio, int ioflag) uvm_vsunlock(p->p_vmspace, iovp->iov_base, iovp->iov_len); } - PRELE(l); /* Release process info */ + uvm_lwp_rele(l); /* Release process info */ esh_free_dmainfo(sc, di); fpread_done: @@ -1195,7 +1195,7 @@ esh_fpwrite(dev_t dev, struct uio *uio, int ioflag) } } - PHOLD(l); /* Lock process info into memory */ + uvm_lwp_hold(l); /* Lock process info into memory */ /* Lock down the pages */ for (i = 0; i < uio->uio_iovcnt; i++) { @@ -1295,7 +1295,7 @@ esh_fpwrite(dev_t dev, struct uio *uio, int ioflag) uvm_vsunlock(p->p_vmspace, iovp->iov_base, iovp->iov_len); } - PRELE(l); /* Release process info */ + uvm_lwp_rele(l); /* Release process info */ esh_free_dmainfo(sc, di); fpwrite_done: diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index 33fab93a0c5..514562961aa 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2560.c,v 1.8 2007/03/04 06:02:00 christos Exp $ */ +/* $NetBSD: rt2560.c,v 1.9 2007/07/09 21:00:38 ad Exp $ */ /* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */ /* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/ @@ -24,7 +24,7 @@ * http://www.ralinktech.com/ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.8 2007/03/04 06:02:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.9 2007/07/09 21:00:38 ad Exp $"); #include "bpfilter.h" @@ -345,8 +345,8 @@ rt2560_attach(void *xsc, int id) struct ifnet *ifp = &sc->sc_if; int error, i; - callout_init(&sc->scan_ch); - callout_init(&sc->rssadapt_ch); + callout_init(&sc->scan_ch, 0); + callout_init(&sc->rssadapt_ch, 0); /* retrieve RT2560 rev. no */ sc->asic_rev = RAL_READ(sc, RT2560_CSR0); diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index 136f3bffa06..0d580277b21 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2661.c,v 1.14 2007/03/04 06:02:00 christos Exp $ */ +/* $NetBSD: rt2661.c,v 1.15 2007/07/09 21:00:38 ad Exp $ */ /* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */ /* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */ @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.14 2007/03/04 06:02:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.15 2007/07/09 21:00:38 ad Exp $"); #include "bpfilter.h" @@ -356,8 +356,8 @@ rt2661_attach(void *xsc, int id) sc->sc_id = id; - callout_init(&sc->scan_ch); - callout_init(&sc->rssadapt_ch); + callout_init(&sc->scan_ch, 0); + callout_init(&sc->rssadapt_ch, 0); /* wait for NIC to initialize */ for (ntries = 0; ntries < 1000; ntries++) { diff --git a/sys/dev/ic/rtl8169.c b/sys/dev/ic/rtl8169.c index 905f5a41425..3466216f932 100644 --- a/sys/dev/ic/rtl8169.c +++ b/sys/dev/ic/rtl8169.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl8169.c,v 1.85 2007/05/10 14:04:47 tsutsui Exp $ */ +/* $NetBSD: rtl8169.c,v 1.86 2007/07/09 21:00:38 ad Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -775,7 +775,7 @@ re_attach(struct rtk_softc *sc) ifp->if_capenable = ifp->if_capabilities; IFQ_SET_READY(&ifp->if_snd); - callout_init(&sc->rtk_tick_ch); + callout_init(&sc->rtk_tick_ch, 0); /* Do MII setup */ sc->mii.mii_ifp = ifp; diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index d91a981ed19..9c0b9c2a7e7 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl81x9.c,v 1.74 2007/05/18 14:10:37 joerg Exp $ */ +/* $NetBSD: rtl81x9.c,v 1.75 2007/07/09 21:00:38 ad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -86,7 +86,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.74 2007/05/18 14:10:37 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.75 2007/07/09 21:00:38 ad Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -633,7 +633,7 @@ rtk_attach(struct rtk_softc *sc) int error; int i, addr_len; - callout_init(&sc->rtk_tick_ch); + callout_init(&sc->rtk_tick_ch, 0); /* * Check EEPROM type 9346 or 9356. diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index 3fb0dc7c3f2..c4330d3744c 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtw.c,v 1.88 2007/05/29 18:38:20 dyoung Exp $ */ +/* $NetBSD: rtw.c,v 1.89 2007/07/09 21:00:39 ad Exp $ */ /*- * Copyright (c) 2004, 2005 David Young. All rights reserved. * @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.88 2007/05/29 18:38:20 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.89 2007/07/09 21:00:39 ad Exp $"); #include "bpfilter.h" @@ -2898,8 +2898,8 @@ rtw_led_slowblink(void *arg) static inline void rtw_led_attach(struct rtw_led_state *ls, void *arg) { - callout_init(&ls->ls_fast_ch); - callout_init(&ls->ls_slow_ch); + callout_init(&ls->ls_fast_ch, 0); + callout_init(&ls->ls_slow_ch, 0); callout_setfunc(&ls->ls_fast_ch, rtw_led_fastblink, arg); callout_setfunc(&ls->ls_slow_ch, rtw_led_slowblink, arg); } @@ -4169,7 +4169,7 @@ rtw_attach(struct rtw_softc *sc) /* complete initialization */ ieee80211_media_init(&sc->sc_ic, rtw_media_change, rtw_media_status); - callout_init(&sc->sc_scan_ch); + callout_init(&sc->sc_scan_ch, 0); rtw_init_radiotap(sc); diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c index 3dde283007a..55fb4206947 100644 --- a/sys/dev/ic/smc83c170.c +++ b/sys/dev/ic/smc83c170.c @@ -1,4 +1,4 @@ -/* $NetBSD: smc83c170.c,v 1.64 2007/03/04 06:02:01 christos Exp $ */ +/* $NetBSD: smc83c170.c,v 1.65 2007/07/09 21:00:39 ad Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.64 2007/03/04 06:02:01 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.65 2007/07/09 21:00:39 ad Exp $"); #include "bpfilter.h" @@ -125,7 +125,7 @@ epic_attach(sc) uint16_t myea[ETHER_ADDR_LEN / 2], mydevname[6]; char *nullbuf; - callout_init(&sc->sc_mii_callout); + callout_init(&sc->sc_mii_callout, 0); /* * Allocate the control data structures, and create and load the diff --git a/sys/dev/ic/spic.c b/sys/dev/ic/spic.c index b1698dfc398..79c9fddb2f1 100644 --- a/sys/dev/ic/spic.c +++ b/sys/dev/ic/spic.c @@ -1,4 +1,4 @@ -/* $NetBSD: spic.c,v 1.7 2007/03/04 06:02:02 christos Exp $ */ +/* $NetBSD: spic.c,v 1.8 2007/07/09 21:00:39 ad Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spic.c,v 1.7 2007/03/04 06:02:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spic.c,v 1.8 2007/07/09 21:00:39 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -259,7 +259,7 @@ spic_attach(struct spic_softc *sc) printf("spic_attach %x %x\n", sc->sc_iot, (uint)sc->sc_ioh); #endif - callout_init(&sc->sc_poll); + callout_init(&sc->sc_poll, 0); spic_call1(sc, 0x82); spic_call2(sc, 0x81, 0xff); diff --git a/sys/dev/ic/tcic2.c b/sys/dev/ic/tcic2.c index cae9530361f..eff9d4ec03a 100644 --- a/sys/dev/ic/tcic2.c +++ b/sys/dev/ic/tcic2.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcic2.c,v 1.26 2006/11/16 01:32:52 christos Exp $ */ +/* $NetBSD: tcic2.c,v 1.27 2007/07/09 21:00:39 ad Exp $ */ /* * Copyright (c) 1998, 1999 Christoph Badura. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.26 2006/11/16 01:32:52 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.27 2007/07/09 21:00:39 ad Exp $"); #undef TCICDEBUG @@ -457,8 +457,8 @@ tcic_create_event_thread(arg) panic("tcic_create_event_thread: unknown tcic socket"); } - if (kthread_create1(tcic_event_thread, h, &h->event_thread, - "%s,%s", h->sc->dev.dv_xname, cs)) { + if (kthread_create(PRI_NONE, 0, NULL, tcic_event_thread, h, + &h->event_thread, "%s,%s", h->sc->dev.dv_xname, cs)) { printf("%s: unable to create event thread for sock 0x%02x\n", h->sc->dev.dv_xname, h->sock); panic("tcic_create_event_thread"); diff --git a/sys/dev/ic/tcic2var.h b/sys/dev/ic/tcic2var.h index 806eef0c0b9..f15fd3242a8 100644 --- a/sys/dev/ic/tcic2var.h +++ b/sys/dev/ic/tcic2var.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcic2var.h,v 1.9 2006/09/03 06:42:44 christos Exp $ */ +/* $NetBSD: tcic2var.h,v 1.10 2007/07/09 21:00:39 ad Exp $ */ /* * Copyright (c) 1998, 1999 Christoph Badura. All rights reserved. @@ -78,7 +78,7 @@ struct tcic_handle { struct device *pcmcia; int shutdown; - struct proc *event_thread; + struct lwp *event_thread; SIMPLEQ_HEAD(, tcic_event) events; }; diff --git a/sys/dev/ic/tropic.c b/sys/dev/ic/tropic.c index 9c831bfbc26..7d39ff78dca 100644 --- a/sys/dev/ic/tropic.c +++ b/sys/dev/ic/tropic.c @@ -1,4 +1,4 @@ -/* $NetBSD: tropic.c,v 1.30 2007/03/04 06:02:02 christos Exp $ */ +/* $NetBSD: tropic.c,v 1.31 2007/07/09 21:00:39 ad Exp $ */ /* * Ported to NetBSD by Onno van der Linden @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tropic.c,v 1.30 2007/03/04 06:02:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tropic.c,v 1.31 2007/07/09 21:00:39 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -435,8 +435,8 @@ tr_attach(sc) printf("%s: address %s ring speed %d Mbps\n", sc->sc_dev.dv_xname, token_sprintf(myaddr), (sc->sc_init_status & RSP_16) ? 16 : 4); - callout_init(&sc->sc_init_callout); - callout_init(&sc->sc_reinit_callout); + callout_init(&sc->sc_init_callout, 0); + callout_init(&sc->sc_reinit_callout, 0); sc->sc_sdhook = shutdownhook_establish(tr_shutdown, sc); return 0; diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c index 87e8b88bd17..a0b29ab9731 100644 --- a/sys/dev/ic/tulip.c +++ b/sys/dev/ic/tulip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.149 2007/03/04 06:02:02 christos Exp $ */ +/* $NetBSD: tulip.c,v 1.150 2007/07/09 21:00:40 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.149 2007/03/04 06:02:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.150 2007/07/09 21:00:40 ad Exp $"); #include "bpfilter.h" @@ -201,8 +201,8 @@ tlp_attach(struct tulip_softc *sc, const u_int8_t *enaddr) struct ifnet *ifp = &sc->sc_ethercom.ec_if; int i, error; - callout_init(&sc->sc_nway_callout); - callout_init(&sc->sc_tick_callout); + callout_init(&sc->sc_nway_callout, 0); + callout_init(&sc->sc_tick_callout, 0); /* * NOTE: WE EXPECT THE FRONT-END TO INITIALIZE sc_regshift! diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index 983c3d24fb8..6a4b3817e38 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $NetBSD: vga.c,v 1.92 2007/03/04 06:02:03 christos Exp $ */ +/* $NetBSD: vga.c,v 1.93 2007/07/09 21:00:40 ad Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -35,7 +35,7 @@ #include "opt_wsmsgattrs.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.92 2007/03/04 06:02:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.93 2007/07/09 21:00:40 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -565,7 +565,7 @@ vga_init(struct vga_config *vc, bus_space_tag_t iot, bus_space_tag_t memt) LIST_INIT(&vc->screens); vc->active = NULL; vc->currenttype = vh->vh_mono ? &vga_25lscreen_mono : &vga_25lscreen; - callout_init(&vc->vc_switch_callout); + callout_init(&vc->vc_switch_callout, 0); wsfont_init(); if (vga_no_builtinfont) { diff --git a/sys/dev/ic/vga_raster.c b/sys/dev/ic/vga_raster.c index c4398bcc34b..fd94672389b 100644 --- a/sys/dev/ic/vga_raster.c +++ b/sys/dev/ic/vga_raster.c @@ -1,4 +1,4 @@ -/* $NetBSD: vga_raster.c,v 1.27 2007/03/15 16:58:36 dogcow Exp $ */ +/* $NetBSD: vga_raster.c,v 1.28 2007/07/09 21:00:40 ad Exp $ */ /* * Copyright (c) 2001, 2002 Bang Jun-Young @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vga_raster.c,v 1.27 2007/03/15 16:58:36 dogcow Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vga_raster.c,v 1.28 2007/07/09 21:00:40 ad Exp $"); #include "opt_wsmsgattrs.h" /* for WSDISPLAY_CUSTOM_OUTPUT */ @@ -411,7 +411,7 @@ vga_raster_init(struct vga_config *vc, bus_space_tag_t iot, LIST_INIT(&vc->screens); vc->active = NULL; vc->currenttype = vh->vh_mono ? &vga_25lscreen_mono : &vga_25lscreen; - callout_init(&vc->vc_switch_callout); + callout_init(&vc->vc_switch_callout, 0); wsfont_init(); vc->nfonts = 1; diff --git a/sys/dev/ic/wd33c93.c b/sys/dev/ic/wd33c93.c index 974e1680bb0..14b88a70aa5 100644 --- a/sys/dev/ic/wd33c93.c +++ b/sys/dev/ic/wd33c93.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd33c93.c,v 1.16 2007/05/21 19:25:54 rumble Exp $ */ +/* $NetBSD: wd33c93.c,v 1.17 2007/07/09 21:00:40 ad Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wd33c93.c,v 1.16 2007/05/21 19:25:54 rumble Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd33c93.c,v 1.17 2007/07/09 21:00:40 ad Exp $"); #include "opt_ddb.h" @@ -205,7 +205,7 @@ wd33c93_attach(struct wd33c93_softc *dev) chan->chan_nluns = SBIC_NLUN; chan->chan_id = dev->sc_id; - callout_init(&dev->sc_watchdog); + callout_init(&dev->sc_watchdog, 0); /* * Add reference to adapter so that we drop the reference after diff --git a/sys/dev/ic/wi.c b/sys/dev/ic/wi.c index 91f6fc6bd82..8abc61a1d87 100644 --- a/sys/dev/ic/wi.c +++ b/sys/dev/ic/wi.c @@ -1,4 +1,4 @@ -/* $NetBSD: wi.c,v 1.219 2007/03/04 06:02:03 christos Exp $ */ +/* $NetBSD: wi.c,v 1.220 2007/07/09 21:00:40 ad Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.219 2007/03/04 06:02:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.220 2007/07/09 21:00:40 ad Exp $"); #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -547,7 +547,7 @@ wi_attach(struct wi_softc *sc, const u_int8_t *macaddr) sc->sc_cnfauthmode = IEEE80211_AUTH_OPEN; sc->sc_roaming_mode = 1; - callout_init(&sc->sc_rssadapt_ch); + callout_init(&sc->sc_rssadapt_ch, 0); /* * Call MI attach routines. diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c index 3966ddffb75..1d7b79b90cc 100644 --- a/sys/dev/ic/z8530tty.c +++ b/sys/dev/ic/z8530tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: z8530tty.c,v 1.113 2007/03/04 06:02:04 christos Exp $ */ +/* $NetBSD: z8530tty.c,v 1.114 2007/07/09 21:00:41 ad Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999 @@ -137,7 +137,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.113 2007/03/04 06:02:04 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.114 2007/07/09 21:00:41 ad Exp $"); #include "opt_kgdb.h" #include "opt_ntp.h" @@ -349,7 +349,7 @@ zstty_attach(parent, self, aux) int dtr_on; int resetbit; - callout_init(&zst->zst_diag_ch); + callout_init(&zst->zst_diag_ch, 0); cn_init_magic(&zstty_cnm_state); tty_unit = device_unit(&zst->zst_dev); diff --git a/sys/dev/ieee1394/firewire.c b/sys/dev/ieee1394/firewire.c index d3aac2f1e7f..7156d667d58 100644 --- a/sys/dev/ieee1394/firewire.c +++ b/sys/dev/ieee1394/firewire.c @@ -1,4 +1,4 @@ -/* $NetBSD: firewire.c,v 1.13 2007/04/21 15:27:43 kiyohara Exp $ */ +/* $NetBSD: firewire.c,v 1.14 2007/07/09 21:00:41 ad Exp $ */ /*- * Copyright (c) 2003 Hidetoshi Shimokawa * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa @@ -1472,13 +1472,12 @@ static void fw_kthread_create0(void *arg) { struct firewire_comm *fc = (struct firewire_comm *)arg; - fw_thread *p; config_pending_incr(); /* create thread */ if (THREAD_CREATE(fw_bus_probe_thread, - (void *)fc, &p, "fw%d_probe", device_get_unit(fc->bdev))) { + (void *)fc, NULL, "fw%d_probe", device_get_unit(fc->bdev))) { device_printf(fc->bdev, "unable to create thread"); panic("fw_kthread_create"); diff --git a/sys/dev/ieee1394/fw_port.h b/sys/dev/ieee1394/fw_port.h index 19ceed3b7ad..d8b2e62bd84 100644 --- a/sys/dev/ieee1394/fw_port.h +++ b/sys/dev/ieee1394/fw_port.h @@ -1,4 +1,4 @@ -/* $NetBSD: fw_port.h,v 1.22 2007/04/21 15:27:43 kiyohara Exp $ */ +/* $NetBSD: fw_port.h,v 1.23 2007/07/09 21:00:41 ad Exp $ */ /* * Copyright (c) 2004 KIYOHARA Takashi * All rights reserved. @@ -570,15 +570,14 @@ typedef struct lwp fw_proc; typedef struct proc fw_thread; #include <sys/select.h> -#define CALLOUT_INIT(x) callout_init(x) +#define CALLOUT_INIT(x) callout_init(x, 0) #define DEV_T dev_t #define FW_LOCK #define FW_UNLOCK #define THREAD_CREATE(f, sc, p, name, arg) \ - kthread_create1(f, (void *)sc, p, name, arg) + kthread_create(PRI_NONE, 0, NULL, f, (void *)sc, p, name, arg) #define THREAD_EXIT(x) kthread_exit(x) -#define fw_kthread_create(func, arg) \ - kthread_create((func), (arg)) +#define fw_kthread_create(func, arg) (*(func))(arg) struct fwbus_attach_args { const char *name; @@ -957,8 +956,8 @@ struct fwbus_attach_args { #define SBP_BUS_FREEZE(b) scsipi_channel_freeze(&(b)->sc_channel, 1) #define SBP_BUS_THAW(b) scsipi_channel_thaw(&(b)->sc_channel, 1) #define SBP_DEVICE_PREATTACH() \ - if (!sbp->proc) \ - fw_kthread_create(fw_kthread_create0, sbp) + if (!sbp->lwp) \ + fw_kthread_create0(sbp) /* * fwip macro for NetBSD diff --git a/sys/dev/ieee1394/sbp.c b/sys/dev/ieee1394/sbp.c index a784a624b1b..0e778d4643e 100644 --- a/sys/dev/ieee1394/sbp.c +++ b/sys/dev/ieee1394/sbp.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbp.c,v 1.16 2007/04/21 15:27:44 kiyohara Exp $ */ +/* $NetBSD: sbp.c,v 1.17 2007/07/09 21:00:41 ad Exp $ */ /*- * Copyright (c) 2003 Hidetoshi Shimokawa * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa @@ -421,7 +421,7 @@ struct sbp_softc { struct scsipi_adapter sc_adapter; struct scsipi_channel sc_channel; struct device *sc_bus; - struct proc *proc; + struct lwp *lwp; #endif struct sbp_target target; struct fw_bind fwb; @@ -1200,8 +1200,8 @@ fw_kthread_create0(void *arg) struct sbp_softc *sbp = (struct sbp_softc *)arg; /* create thread */ - if (kthread_create1(sbp_scsipi_scan_target, - &sbp->target, &sbp->proc, "sbp%d_attach", + if (kthread_create(PRI_NONE, 0, NULL, sbp_scsipi_scan_target, + &sbp->target, &sbp->lwp, "sbp%d_attach", device_unit(sbp->fd.dev))) { device_printf(sbp->fd.dev, "unable to create thread"); @@ -1245,7 +1245,7 @@ sbp_scsipi_scan_target(void *arg) } } while (yet > 0); - sbp->proc = NULL; + sbp->lwp = NULL; kthread_exit(0); } diff --git a/sys/dev/ir/irframe_tty.c b/sys/dev/ir/irframe_tty.c index a39be56d76b..8044fb39b3b 100644 --- a/sys/dev/ir/irframe_tty.c +++ b/sys/dev/ir/irframe_tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: irframe_tty.c,v 1.43 2007/03/08 19:35:44 drochner Exp $ */ +/* $NetBSD: irframe_tty.c,v 1.44 2007/07/09 21:00:48 ad Exp $ */ /* * TODO @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.43 2007/03/08 19:35:44 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.44 2007/07/09 21:00:48 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -539,7 +539,7 @@ irframet_open(void *h, int flag, int mode, sc->sc_nframes = 0; sc->sc_framei = 0; sc->sc_frameo = 0; - callout_init(&sc->sc_timeout); + callout_init(&sc->sc_timeout, 0); lockinit(&sc->sc_wr_lk, PZERO, "irfrtl", 0, 0); return (0); diff --git a/sys/dev/isa/boca.c b/sys/dev/isa/boca.c index c90213f891b..cbb60c00317 100644 --- a/sys/dev/isa/boca.c +++ b/sys/dev/isa/boca.c @@ -1,4 +1,4 @@ -/* $NetBSD: boca.c,v 1.47 2006/11/16 01:33:00 christos Exp $ */ +/* $NetBSD: boca.c,v 1.48 2007/07/09 21:00:49 ad Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.47 2006/11/16 01:33:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.48 2007/07/09 21:00:49 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -64,7 +64,7 @@ struct boca_softc { int sc_alive; /* mask of slave units attached */ void *sc_slaves[NSLAVES]; /* com device unit numbers */ bus_space_handle_t sc_slaveioh[NSLAVES]; - struct callout fixup; + callout_t fixup; }; int bocaprobe(struct device *, struct cfdata *, void *); @@ -187,7 +187,7 @@ bocaattach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_SERIAL, bocaintr, sc); - callout_init(&sc->fixup); + callout_init(&sc->fixup, 0); callout_reset(&sc->fixup, hz/10, boca_fixup, sc); } diff --git a/sys/dev/isa/cec.c b/sys/dev/isa/cec.c index c16b01e491e..419da2aec7d 100644 --- a/sys/dev/isa/cec.c +++ b/sys/dev/isa/cec.c @@ -1,4 +1,4 @@ -/* $NetBSD: cec.c,v 1.5 2007/01/10 20:38:32 cube Exp $ */ +/* $NetBSD: cec.c,v 1.6 2007/07/09 21:00:49 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cec.c,v 1.5 2007/01/10 20:38:32 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cec.c,v 1.6 2007/07/09 21:00:49 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -91,7 +91,7 @@ struct cec_softc { #define CECF_TIMO 0x10 #define CECF_USEDMA 0x20 int sc_ppoll_slave; /* XXX stash our ppoll address */ - struct callout sc_timeout_ch; + callout_t sc_timeout_ch; }; int cecprobe(struct device *, struct cfdata *, void *); @@ -230,7 +230,7 @@ cecattach(struct device *parent, struct device *self, void *aux) return; } - callout_init(&sc->sc_timeout_ch); + callout_init(&sc->sc_timeout_ch, 0); /* attach MI GPIB bus */ cec_ic.cookie = (void *)sc; diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c index 15fa024c11b..3c076cb3fad 100644 --- a/sys/dev/isa/ega.c +++ b/sys/dev/isa/ega.c @@ -1,4 +1,4 @@ -/* $NetBSD: ega.c,v 1.21 2007/03/04 06:02:10 christos Exp $ */ +/* $NetBSD: ega.c,v 1.22 2007/07/09 21:00:49 ad Exp $ */ /* * Copyright (c) 1999 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ega.c,v 1.21 2007/03/04 06:02:10 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ega.c,v 1.22 2007/07/09 21:00:49 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -86,7 +86,7 @@ struct ega_config { void (*switchcb)(void *, int, int); void *switchcbarg; - struct callout switch_callout; + callout_t switch_callout; }; struct ega_softc { @@ -431,7 +431,7 @@ ega_init(vc, iot, memt, mono) LIST_INIT(&vc->screens); vc->active = NULL; vc->currenttype = vh->vh_mono ? &ega_stdscreen_mono : &ega_stdscreen; - callout_init(&vc->switch_callout); + callout_init(&vc->switch_callout, 0); vc->vc_fonts[0] = &ega_builtinfont; for (i = 1; i < 4; i++) diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c index f99a099c8f4..2d1d445efc7 100644 --- a/sys/dev/isa/ess.c +++ b/sys/dev/isa/ess.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess.c,v 1.73 2006/11/16 01:33:00 christos Exp $ */ +/* $NetBSD: ess.c,v 1.74 2007/07/09 21:00:49 ad Exp $ */ /* * Copyright 1997 @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ess.c,v 1.73 2006/11/16 01:33:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess.c,v 1.74 2007/07/09 21:00:49 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -811,8 +811,8 @@ int ess_setup_sc(struct ess_softc *sc, int doinit) { - callout_init(&sc->sc_poll1_ch); - callout_init(&sc->sc_poll2_ch); + callout_init(&sc->sc_poll1_ch, 0); + callout_init(&sc->sc_poll2_ch, 0); /* Reset the chip. */ if (ess_reset(sc) != 0) { diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c index 79725f46ae9..868e999a061 100644 --- a/sys/dev/isa/fd.c +++ b/sys/dev/isa/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.73 2007/03/08 23:23:45 jnemeth Exp $ */ +/* $NetBSD: fd.c,v 1.74 2007/07/09 21:00:49 ad Exp $ */ /*- * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.73 2007/03/08 23:23:45 jnemeth Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.74 2007/07/09 21:00:49 ad Exp $"); #include "rnd.h" #include "opt_ddb.h" @@ -291,8 +291,8 @@ void fdcattach(fdc) struct fdc_softc *fdc; { - callout_init(&fdc->sc_timo_ch); - callout_init(&fdc->sc_intr_ch); + callout_init(&fdc->sc_timo_ch, 0); + callout_init(&fdc->sc_intr_ch, 0); fdc->sc_state = DEVIDLE; TAILQ_INIT(&fdc->sc_drives); @@ -480,8 +480,8 @@ fdattach(parent, self, aux) const struct fd_type *type = fa->fa_deftype; int drive = fa->fa_drive; - callout_init(&fd->sc_motoron_ch); - callout_init(&fd->sc_motoroff_ch); + callout_init(&fd->sc_motoron_ch, 0); + callout_init(&fd->sc_motoroff_ch, 0); /* XXX Allow `flags' to override device type? */ diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index 09c6645f3d7..ccb5bf9eda9 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $NetBSD: gus.c,v 1.97 2007/03/04 06:02:11 christos Exp $ */ +/* $NetBSD: gus.c,v 1.98 2007/07/09 21:00:49 ad Exp $ */ /*- * Copyright (c) 1996, 1999 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.97 2007/03/04 06:02:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.98 2007/07/09 21:00:49 ad Exp $"); #include "gus.h" #if NGUS > 0 @@ -188,7 +188,7 @@ struct gus_softc { bus_space_handle_t sc_ioh3; /* ICS2101 handle */ bus_space_handle_t sc_ioh4; /* MIDI handle */ - struct callout sc_dmaout_ch; + callout_t sc_dmaout_ch; int sc_iobase; /* I/O base address */ int sc_irq; /* IRQ used */ @@ -834,7 +834,7 @@ gusattach(struct device *parent, struct device *self, void *aux) sc = (void *) self; ia = aux; - callout_init(&sc->sc_dmaout_ch); + callout_init(&sc->sc_dmaout_ch, 0); sc->sc_iot = iot = ia->ia_iot; sc->sc_ic = ia->ia_ic; diff --git a/sys/dev/isa/isic_isa.c b/sys/dev/isa/isic_isa.c index f1973b523ba..d3e829063af 100644 --- a/sys/dev/isa/isic_isa.c +++ b/sys/dev/isa/isic_isa.c @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.27 2006/11/16 01:33:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.28 2007/07/09 21:00:49 ad Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -622,8 +622,8 @@ isicattach(int flags, struct isic_softc *sc) #endif #if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000 - callout_init(&sc->sc_T3_callout); - callout_init(&sc->sc_T4_callout); + callout_init(&sc->sc_T3_callout, 0); + callout_init(&sc->sc_T4_callout, 0); #endif /* announce manufacturer and card type */ diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c index 90223fb3da7..92cba7ddefe 100644 --- a/sys/dev/isa/mcd.c +++ b/sys/dev/isa/mcd.c @@ -1,4 +1,4 @@ -/* $NetBSD: mcd.c,v 1.98 2007/06/30 22:16:38 dsl Exp $ */ +/* $NetBSD: mcd.c,v 1.99 2007/07/09 21:00:49 ad Exp $ */ /* * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. @@ -56,7 +56,7 @@ /*static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.98 2007/06/30 22:16:38 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.99 2007/07/09 21:00:49 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -125,7 +125,7 @@ struct mcd_softc { struct lock sc_lock; void *sc_ih; - struct callout sc_pintr_ch; + callout_t sc_pintr_ch; bus_space_tag_t sc_iot; bus_space_handle_t sc_ioh; @@ -263,7 +263,7 @@ mcdattach(struct device *parent, struct device *self, void *aux) } bufq_alloc(&sc->buf_queue, "disksort", BUFQ_SORT_RAWBLOCK); - callout_init(&sc->sc_pintr_ch); + callout_init(&sc->sc_pintr_ch, 0); /* * Initialize and attach the disk structure. diff --git a/sys/dev/isa/pckbc_isa.c b/sys/dev/isa/pckbc_isa.c index c72a62262ac..d45056630a8 100644 --- a/sys/dev/isa/pckbc_isa.c +++ b/sys/dev/isa/pckbc_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_isa.c,v 1.20 2006/11/16 01:33:00 christos Exp $ */ +/* $NetBSD: pckbc_isa.c,v 1.21 2007/07/09 21:00:50 ad Exp $ */ /* * Copyright (c) 1998 @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbc_isa.c,v 1.20 2006/11/16 01:33:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc_isa.c,v 1.21 2007/07/09 21:00:50 ad Exp $"); #include "opt_pckbc.h" @@ -196,7 +196,7 @@ pckbc_isa_attach(struct device *parent, struct device *self, void *aux) t->t_ioh_c = ioh_c; t->t_addr = IO_KBD; t->t_cmdbyte = KC8_CPU; /* Enable ports */ - callout_init(&t->t_cleanup); + callout_init(&t->t_cleanup, 0); } t->t_sc = sc; diff --git a/sys/dev/isa/pcppi.c b/sys/dev/isa/pcppi.c index ccafc933575..743df29b945 100644 --- a/sys/dev/isa/pcppi.c +++ b/sys/dev/isa/pcppi.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcppi.c,v 1.22 2006/12/10 22:10:57 cube Exp $ */ +/* $NetBSD: pcppi.c,v 1.23 2007/07/09 21:00:50 ad Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.22 2006/12/10 22:10:57 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.23 2007/07/09 21:00:50 ad Exp $"); #include "attimer.h" @@ -172,7 +172,7 @@ pcppi_attach(struct pcppi_softc *sc) { struct pcppi_attach_args pa; - callout_init(&sc->sc_bell_ch); + callout_init(&sc->sc_bell_ch, 0); sc->sc_bellactive = sc->sc_bellpitch = sc->sc_slp = 0; diff --git a/sys/dev/isa/satlink.c b/sys/dev/isa/satlink.c index e9337a25922..a902fd7e793 100644 --- a/sys/dev/isa/satlink.c +++ b/sys/dev/isa/satlink.c @@ -1,4 +1,4 @@ -/* $NetBSD: satlink.c,v 1.31 2007/03/04 06:02:13 christos Exp $ */ +/* $NetBSD: satlink.c,v 1.32 2007/07/09 21:00:50 ad Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: satlink.c,v 1.31 2007/03/04 06:02:13 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: satlink.c,v 1.32 2007/07/09 21:00:50 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -87,7 +87,7 @@ struct satlink_softc { int sc_lastresid; /* residual */ struct selinfo sc_selq; /* our select/poll queue */ struct satlink_id sc_id; /* ID cached at attach time */ - struct callout sc_ch; /* callout pseudo-interrupt */ + callout_t sc_ch; /* callout pseudo-interrupt */ }; /* sc_flags */ @@ -209,7 +209,7 @@ satlinkattach(struct device *parent, struct device *self, void *aux) sc->sc_id.sid_grpid, sc->sc_id.sid_userid, sc->sc_id.sid_serial); - callout_init(&sc->sc_ch); + callout_init(&sc->sc_ch, 0); sc->sc_bufsize = isa_dmamaxsize(sc->sc_ic, sc->sc_drq); diff --git a/sys/dev/isa/toaster.c b/sys/dev/isa/toaster.c index a290411781f..ee809993f37 100644 --- a/sys/dev/isa/toaster.c +++ b/sys/dev/isa/toaster.c @@ -1,4 +1,4 @@ -/* $NetBSD: toaster.c,v 1.3 2007/01/29 01:52:45 hubertf Exp $ */ +/* $NetBSD: toaster.c,v 1.4 2007/07/09 21:00:50 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: toaster.c,v 1.3 2007/01/29 01:52:45 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: toaster.c,v 1.4 2007/07/09 21:00:50 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -67,7 +67,7 @@ struct toaster_softc { u_int32_t led_duty[4]; u_int32_t led_width_sysctl[4]; u_int32_t led_duty_sysctl[4]; - struct callout led_callout[4]; + callout_t led_callout[4]; }; static int toaster_match(struct device *, struct cfdata *, void *); @@ -251,10 +251,10 @@ toaster_attach(parent, self, aux) aprint_normal("%s: using port A, bit 0 for magnetic latch\n", sc->sc_dev.dv_xname); aprint_normal("%s: using port A, bit 1 for burner element\n", sc->sc_dev.dv_xname); - callout_init(&sc->led_callout[0]); - callout_init(&sc->led_callout[1]); - callout_init(&sc->led_callout[2]); - callout_init(&sc->led_callout[3]); + callout_init(&sc->led_callout[0], 0); + callout_init(&sc->led_callout[1], 0); + callout_init(&sc->led_callout[2], 0); + callout_init(&sc->led_callout[3], 0); sc->led_duty[0] = sc->led_width[0] = 0; sc->led_duty[1] = sc->led_width[1] = 0; sc->led_duty[2] = sc->led_width[2] = 0; diff --git a/sys/dev/isa/wt.c b/sys/dev/isa/wt.c index 9af2f434ebf..3e2f77b079f 100644 --- a/sys/dev/isa/wt.c +++ b/sys/dev/isa/wt.c @@ -1,4 +1,4 @@ -/* $NetBSD: wt.c,v 1.75 2007/03/04 06:02:13 christos Exp $ */ +/* $NetBSD: wt.c,v 1.76 2007/07/09 21:00:50 ad Exp $ */ /* * Streamer tape driver. @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wt.c,v 1.75 2007/03/04 06:02:13 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wt.c,v 1.76 2007/07/09 21:00:50 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -127,7 +127,7 @@ struct wt_softc { bus_space_handle_t sc_ioh; isa_chipset_tag_t sc_ic; - struct callout sc_timer_ch; + callout_t sc_timer_ch; enum wttype type; /* type of controller */ int chan; /* DMA channel number, 1..3 */ @@ -276,7 +276,7 @@ wtattach(struct device *parent, struct device *self, void *aux) sc->sc_ioh = ioh; sc->sc_ic = ia->ia_ic; - callout_init(&sc->sc_timer_ch); + callout_init(&sc->sc_timer_ch, 0); /* Try Wangtek. */ if (wtreset(iot, ioh, &wtregs)) { diff --git a/sys/dev/isa/ym.c b/sys/dev/isa/ym.c index bf1692d82d9..10b3612a84d 100644 --- a/sys/dev/isa/ym.c +++ b/sys/dev/isa/ym.c @@ -1,4 +1,4 @@ -/* $NetBSD: ym.c,v 1.30 2007/02/16 13:42:29 ad Exp $ */ +/* $NetBSD: ym.c,v 1.31 2007/07/09 21:00:50 ad Exp $ */ /*- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ym.c,v 1.30 2007/02/16 13:42:29 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ym.c,v 1.31 2007/07/09 21:00:50 ad Exp $"); #include "mpu_ym.h" #include "opt_ym.h" @@ -217,7 +217,7 @@ ym_attach(struct ym_softc *sc) struct audio_attach_args arg; ac = &sc->sc_ad1848.sc_ad1848; - callout_init(&sc->sc_powerdown_ch); + callout_init(&sc->sc_powerdown_ch, 0); /* Mute the output to reduce noise during initialization. */ ym_mute(sc, SA3_VOL_L, 1); diff --git a/sys/dev/isapnp/isic_isapnp.c b/sys/dev/isapnp/isic_isapnp.c index fa04c59c09e..dc8957ddee4 100644 --- a/sys/dev/isapnp/isic_isapnp.c +++ b/sys/dev/isapnp/isic_isapnp.c @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.25 2007/01/29 01:52:45 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.26 2007/07/09 21:00:51 ad Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -314,8 +314,8 @@ isic_isapnp_attach(struct device *parent, sc->sc_freeflag2 = 0; #if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000 - callout_init(&sc->sc_T3_callout); - callout_init(&sc->sc_T4_callout); + callout_init(&sc->sc_T3_callout, 0); + callout_init(&sc->sc_T4_callout, 0); #endif /* announce chip versions */ diff --git a/sys/dev/isapnp/isic_isapnp_elsa_qs1i.c b/sys/dev/isapnp/isic_isapnp_elsa_qs1i.c index 3223d23e62a..82ebbcca25d 100644 --- a/sys/dev/isapnp/isic_isapnp_elsa_qs1i.c +++ b/sys/dev/isapnp/isic_isapnp_elsa_qs1i.c @@ -27,14 +27,14 @@ * isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro ISA * ===================================================================== * - * $Id: isic_isapnp_elsa_qs1i.c,v 1.14 2007/03/04 06:02:13 christos Exp $ + * $Id: isic_isapnp_elsa_qs1i.c,v 1.15 2007/07/09 21:00:51 ad Exp $ * * last edit-date: [Fri Jan 5 11:38:29 2001] * *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_isapnp_elsa_qs1i.c,v 1.14 2007/03/04 06:02:13 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isapnp_elsa_qs1i.c,v 1.15 2007/07/09 21:00:51 ad Exp $"); #include "opt_isicpnp.h" #if defined(ISICPNP_ELSA_QS1ISA) || defined(ISICPNP_ELSA_PCC16) @@ -600,7 +600,7 @@ isic_attach_Eqs1pi(struct isic_softc *sc) sc->sc_ipac = 0; sc->sc_bfifolen = HSCX_FIFO_LEN; - callout_init(&sc->sc_driver_callout); + callout_init(&sc->sc_driver_callout, 0); sc->sc_driver_specific = 0; } diff --git a/sys/dev/marvell/gtidma.c b/sys/dev/marvell/gtidma.c index 3489e8008e5..dd7e9a1043a 100644 --- a/sys/dev/marvell/gtidma.c +++ b/sys/dev/marvell/gtidma.c @@ -1,4 +1,4 @@ -/* $NetBSD: gtidma.c,v 1.10 2007/03/04 06:02:14 christos Exp $ */ +/* $NetBSD: gtidma.c,v 1.11 2007/07/09 21:00:51 ad Exp $ */ /* * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gtidma.c,v 1.10 2007/03/04 06:02:14 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gtidma.c,v 1.11 2007/07/09 21:00:51 ad Exp $"); #include "opt_idma.h" #include "opt_ddb.h" @@ -299,7 +299,7 @@ idma_attach( sc->idma_reg_size = 0x100; sc->idma_ien = 0; sc->idma_callout_state = 0; - callout_init(&sc->idma_callout); + callout_init(&sc->idma_callout, 0); for (i=0; i < NIDMA_CHANS; i++) idma_chan_init(sc, &sc->idma_chan[i], i); diff --git a/sys/dev/marvell/if_gfe.c b/sys/dev/marvell/if_gfe.c index 52307789a7a..4d9cf81ce6f 100644 --- a/sys/dev/marvell/if_gfe.c +++ b/sys/dev/marvell/if_gfe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_gfe.c,v 1.22 2007/03/07 09:15:21 he Exp $ */ +/* $NetBSD: if_gfe.c,v 1.23 2007/07/09 21:00:51 ad Exp $ */ /* * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.22 2007/03/07 09:15:21 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.23 2007/07/09 21:00:51 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -245,7 +245,7 @@ gfe_attach(struct device *parent, struct device *self, void *aux) aprint_error(": failed to map registers\n"); } - callout_init(&sc->sc_co); + callout_init(&sc->sc_co, 0); data = bus_space_read_4(sc->sc_gt_memt, sc->sc_gt_memh, ETH_EPAR); phyaddr = ETH_EPAR_PhyAD_GET(data, sc->sc_macno); diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c index 73a88e73b61..e8d83f5c6cc 100644 --- a/sys/dev/mca/edc_mca.c +++ b/sys/dev/mca/edc_mca.c @@ -1,4 +1,4 @@ -/* $NetBSD: edc_mca.c,v 1.35 2006/11/16 01:33:05 christos Exp $ */ +/* $NetBSD: edc_mca.c,v 1.36 2007/07/09 21:00:51 ad Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.35 2006/11/16 01:33:05 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.36 2007/07/09 21:00:51 ad Exp $"); #include "rnd.h" @@ -132,7 +132,6 @@ static void edc_dump_status_block(struct edc_mca_softc *, static int edc_do_attn(struct edc_mca_softc *, int, int, int); static void edc_cmd_wait(struct edc_mca_softc *, int, int); static void edcworker(void *); -static void edc_spawn_worker(void *); int edc_mca_probe(struct device *parent, struct cfdata *match, @@ -341,7 +340,12 @@ edc_mca_attach(struct device *parent, struct device *self, void *aux) * Run the worker thread. */ config_pending_incr(); - kthread_create(edc_spawn_worker, (void *) sc); + if ((error = kthread_create(PRI_NONE, 0, NULL, edcworker, sc, NULL, + "%s", sc->sc_dev.dv_xname))) { + printf("%s: cannot spawn worker thread: errno=%d\n", + sc->sc_dev.dv_xname, error); + panic("edc_mca_attach"); + } } void @@ -801,23 +805,6 @@ edc_dump_status_block(struct edc_mca_softc *sc, u_int16_t *status_block, #endif } } - -static void -edc_spawn_worker(void *arg) -{ - struct edc_mca_softc *sc = (struct edc_mca_softc *) arg; - int error; - struct proc *wrk; - - /* Now, everything is ready, start a kthread */ - if ((error = kthread_create1(edcworker, sc, &wrk, - "%s", sc->sc_dev.dv_xname))) { - printf("%s: cannot spawn worker thread: errno=%d\n", - sc->sc_dev.dv_xname, error); - panic("edc_spawn_worker"); - } -} - /* * Main worker thread function. */ diff --git a/sys/dev/midi.c b/sys/dev/midi.c index 7dc74f386f1..5b326924941 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $NetBSD: midi.c,v 1.54 2007/06/16 10:25:03 pavel Exp $ */ +/* $NetBSD: midi.c,v 1.55 2007/07/09 21:00:29 ad Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.54 2007/06/16 10:25:03 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.55 2007/07/09 21:00:29 ad Exp $"); #include "midi.h" #include "sequencer.h" @@ -231,8 +231,8 @@ midi_attach(struct midi_softc *sc, struct device *parent) struct midi_info mi; int s; - callout_init(&sc->xmt_asense_co); - callout_init(&sc->rcv_asense_co); + callout_init(&sc->xmt_asense_co, 0); + callout_init(&sc->rcv_asense_co, 0); callout_setfunc(&sc->xmt_asense_co, midi_xmt_asense, sc); callout_setfunc(&sc->rcv_asense_co, midi_rcv_asense, sc); simple_lock_init(&sc->out_lock); diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 48c18bdf650..a45962720d4 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $NetBSD: mii.c,v 1.40 2005/12/11 12:22:42 christos Exp $ */ +/* $NetBSD: mii.c,v 1.41 2007/07/09 21:00:51 ad Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.40 2005/12/11 12:22:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.41 2007/07/09 21:00:51 ad Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -149,7 +149,7 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask, /* * Link it up in the parent's MII data. */ - callout_init(&child->mii_nway_ch); + callout_init(&child->mii_nway_ch, 0); LIST_INSERT_HEAD(&mii->mii_phys, child, mii_list); child->mii_offset = offset; mii->mii_instance++; diff --git a/sys/dev/mvme/lpt_mvme.c b/sys/dev/mvme/lpt_mvme.c index f63daef8ec7..5084d1e5d9d 100644 --- a/sys/dev/mvme/lpt_mvme.c +++ b/sys/dev/mvme/lpt_mvme.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt_mvme.c,v 1.8 2007/03/04 06:02:15 christos Exp $ */ +/* $NetBSD: lpt_mvme.c,v 1.9 2007/07/09 21:00:51 ad Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -91,7 +91,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lpt_mvme.c,v 1.8 2007/03/04 06:02:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lpt_mvme.c,v 1.9 2007/07/09 21:00:51 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -148,7 +148,7 @@ lpt_attach_subr(sc) { sc->sc_state = 0; - callout_init(&sc->sc_wakeup_ch); + callout_init(&sc->sc_wakeup_ch, 0); } /* diff --git a/sys/dev/ofisa/pckbc_ofisa.c b/sys/dev/ofisa/pckbc_ofisa.c index 0aac5092d12..843b82db294 100644 --- a/sys/dev/ofisa/pckbc_ofisa.c +++ b/sys/dev/ofisa/pckbc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_ofisa.c,v 1.11 2006/03/29 07:09:33 thorpej Exp $ */ +/* $NetBSD: pckbc_ofisa.c,v 1.12 2007/07/09 21:00:52 ad Exp $ */ /* * Copyright (c) 1998 @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbc_ofisa.c,v 1.11 2006/03/29 07:09:33 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc_ofisa.c,v 1.12 2007/07/09 21:00:52 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -130,7 +130,7 @@ pckbc_ofisa_attach(struct device *parent, struct device *self, void *aux) t->t_ioh_c = ioh_c; t->t_addr = regs[0].addr; t->t_cmdbyte = KC8_CPU; /* Enable ports */ - callout_init(&t->t_cleanup); + callout_init(&t->t_cleanup, 0); } t->t_sc = sc; diff --git a/sys/dev/ofw/ofcons.c b/sys/dev/ofw/ofcons.c index 39910cabbde..b42da8b9dac 100644 --- a/sys/dev/ofw/ofcons.c +++ b/sys/dev/ofw/ofcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofcons.c,v 1.30 2007/03/04 06:02:15 christos Exp $ */ +/* $NetBSD: ofcons.c,v 1.31 2007/07/09 21:00:52 ad Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.30 2007/03/04 06:02:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.31 2007/07/09 21:00:52 ad Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -110,7 +110,7 @@ ofcons_attach(parent, self, aux) printf("\n"); - callout_init(&sc->sc_poll_ch); + callout_init(&sc->sc_poll_ch, 0); } static void ofcons_start(struct tty *); diff --git a/sys/dev/ofw/ofnet.c b/sys/dev/ofw/ofnet.c index 5d6dc8a4d8d..f70b47b20e4 100644 --- a/sys/dev/ofw/ofnet.c +++ b/sys/dev/ofw/ofnet.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofnet.c,v 1.39 2007/03/08 20:52:21 matt Exp $ */ +/* $NetBSD: ofnet.c,v 1.40 2007/07/09 21:00:52 ad Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.39 2007/03/08 20:52:21 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.40 2007/07/09 21:00:52 ad Exp $"); #include "ofnet.h" #include "opt_inet.h" @@ -152,7 +152,7 @@ ofnet_attach(struct device *parent, struct device *self, void *aux) panic("ofnet_attach: no mac-address"); printf(": address %s\n", ether_sprintf(myaddr)); - callout_init(&of->sc_callout); + callout_init(&of->sc_callout, 0); bcopy(of->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ); ifp->if_softc = of; diff --git a/sys/dev/onewire/onewire.c b/sys/dev/onewire/onewire.c index a3adea47f0c..5e4f5de5128 100644 --- a/sys/dev/onewire/onewire.c +++ b/sys/dev/onewire/onewire.c @@ -1,4 +1,4 @@ -/* $NetBSD: onewire.c,v 1.4 2006/11/16 01:33:08 christos Exp $ */ +/* $NetBSD: onewire.c,v 1.5 2007/07/09 21:00:52 ad Exp $ */ /* $OpenBSD: onewire.c,v 1.1 2006/03/04 16:27:03 grange Exp $ */ /* @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.4 2006/11/16 01:33:08 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.5 2007/07/09 21:00:52 ad Exp $"); /* * 1-Wire bus driver. @@ -53,7 +53,7 @@ struct onewire_softc { struct onewire_bus * sc_bus; struct lock sc_lock; - struct proc * sc_thread; + struct lwp * sc_thread; TAILQ_HEAD(, onewire_device) sc_devs; int sc_dying; @@ -73,7 +73,6 @@ int onewire_activate(struct device *, enum devact); int onewire_print(void *, const char *); void onewire_thread(void *); -void onewire_createthread(void *); void onewire_scan(struct onewire_softc *); CFATTACH_DECL(onewire, sizeof(struct onewire_softc), @@ -105,7 +104,10 @@ onewire_attach(struct device *parent, struct device *self, void *aux) printf("\n"); - kthread_create(onewire_createthread, sc); + if (kthread_create(PRI_NONE, 0, NULL, onewire_thread, sc, + &sc->sc_thread, "%s", sc->sc_dev.dv_xname) != 0) + printf("%s: can't create kernel thread\n", + sc->sc_dev.dv_xname); } int @@ -317,18 +319,6 @@ onewire_thread(void *arg) wakeup(&sc->sc_dying); kthread_exit(0); } - -void -onewire_createthread(void *arg) -{ - struct onewire_softc *sc = arg; - - if (kthread_create1(onewire_thread, sc, &sc->sc_thread, - "%s", sc->sc_dev.dv_xname) != 0) - printf("%s: can't create kernel thread\n", - sc->sc_dev.dv_xname); -} - void onewire_scan(struct onewire_softc *sc) { diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c index d4e177174eb..4eb372890da 100644 --- a/sys/dev/pci/amdpm.c +++ b/sys/dev/pci/amdpm.c @@ -1,4 +1,4 @@ -/* $NetBSD: amdpm.c,v 1.25 2007/02/05 23:38:15 jmcneill Exp $ */ +/* $NetBSD: amdpm.c,v 1.26 2007/07/09 21:00:52 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.25 2007/02/05 23:38:15 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.26 2007/07/09 21:00:52 ad Exp $"); #include "opt_amdpm.h" @@ -189,7 +189,7 @@ amdpm_attach(struct device *parent, struct device *self, void *aux) aprint_normal("%s: " "random number generator enabled (apprx. %dms)\n", sc->sc_dev.dv_xname, i); - callout_init(&sc->sc_rnd_ch); + callout_init(&sc->sc_rnd_ch, 0); rnd_attach_source(&sc->sc_rnd_source, sc->sc_dev.dv_xname, RND_TYPE_RNG, /* diff --git a/sys/dev/pci/amr.c b/sys/dev/pci/amr.c index 89c02268a1c..4e521748928 100644 --- a/sys/dev/pci/amr.c +++ b/sys/dev/pci/amr.c @@ -1,4 +1,4 @@ -/* $NetBSD: amr.c,v 1.44 2007/03/04 06:02:16 christos Exp $ */ +/* $NetBSD: amr.c,v 1.45 2007/07/09 21:00:52 ad Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.44 2007/03/04 06:02:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.45 2007/07/09 21:00:52 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -110,7 +110,6 @@ static int amr_print(void *, const char *); static void amr_shutdown(void *); static void amr_teardown(struct amr_softc *); static void amr_thread(void *); -static void amr_thread_create(void *); static int amr_quartz_get_work(struct amr_softc *, struct amr_mailbox_resp *); @@ -491,8 +490,15 @@ amr_attach(struct device *parent, struct device *self, void *aux) SIMPLEQ_INIT(&amr->amr_ccb_queue); /* XXX This doesn't work for newer boards yet. */ - if ((apt->apt_flags & AT_QUARTZ) == 0) - kthread_create(amr_thread_create, amr); + if ((apt->apt_flags & AT_QUARTZ) == 0) { + rv = kthread_create(PRI_NONE, 0, NULL, amr_thread, amr, + &amr->amr_thread, "%s", amr->amr_dv.dv_xname); + if (rv != 0) + aprint_error("%s: unable to create thread (%d)", + amr->amr_dv.dv_xname, rv); + else + amr->amr_flags |= AMRF_THREAD; + } } /* @@ -813,32 +819,6 @@ amr_intr(void *cookie) } /* - * Create the watchdog thread. - */ -static void -amr_thread_create(void *cookie) -{ - struct amr_softc *amr; - int rv; - - amr = cookie; - - if ((amr->amr_flags & AMRF_THREAD_EXIT) != 0) { - amr->amr_flags ^= AMRF_THREAD_EXIT; - wakeup(&amr->amr_flags); - return; - } - - rv = kthread_create1(amr_thread, amr, &amr->amr_thread, "%s", - amr->amr_dv.dv_xname); - if (rv != 0) - aprint_error("%s: unable to create thread (%d)", - amr->amr_dv.dv_xname, rv); - else - amr->amr_flags |= AMRF_THREAD; -} - -/* * Watchdog thread. */ static void diff --git a/sys/dev/pci/amrvar.h b/sys/dev/pci/amrvar.h index 16b576ea6b5..2693a4df62d 100644 --- a/sys/dev/pci/amrvar.h +++ b/sys/dev/pci/amrvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: amrvar.h,v 1.6 2006/07/23 12:01:26 bouyer Exp $ */ +/* $NetBSD: amrvar.h,v 1.7 2007/07/09 21:00:52 ad Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ struct amr_softc { bus_dma_tag_t amr_dmat; pci_chipset_tag_t amr_pc; void *amr_ih; - struct proc *amr_thread; + struct lwp *amr_thread; int amr_flags; struct amr_mailbox *amr_mbox; diff --git a/sys/dev/pci/bktr/bktr_core.c b/sys/dev/pci/bktr/bktr_core.c index 8e056a3531c..909bdf50d88 100644 --- a/sys/dev/pci/bktr/bktr_core.c +++ b/sys/dev/pci/bktr/bktr_core.c @@ -1,6 +1,6 @@ /* $SourceForge: bktr_core.c,v 1.6 2003/03/11 23:11:22 thomasklausner Exp $ */ -/* $NetBSD: bktr_core.c,v 1.42 2007/03/04 06:02:27 christos Exp $ */ +/* $NetBSD: bktr_core.c,v 1.43 2007/07/09 21:01:19 ad Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp$ */ /* @@ -98,7 +98,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bktr_core.c,v 1.42 2007/03/04 06:02:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bktr_core.c,v 1.43 2007/07/09 21:01:19 ad Exp $"); #include "opt_bktr.h" /* Include any kernel config options */ @@ -823,9 +823,7 @@ common_bktr_intr(void *arg) } /* If someone has a select() on /dev/vbi, inform them */ - if (SEL_WAITING(&bktr->vbi_select)) { - selwakeup(&bktr->vbi_select); - } + selwakeup(&bktr->vbi_select); } /* diff --git a/sys/dev/pci/cz.c b/sys/dev/pci/cz.c index bd3bf72f42e..4e4d858552a 100644 --- a/sys/dev/pci/cz.c +++ b/sys/dev/pci/cz.c @@ -1,4 +1,4 @@ -/* $NetBSD: cz.c,v 1.44 2007/05/08 17:27:37 garbled Exp $ */ +/* $NetBSD: cz.c,v 1.45 2007/07/09 21:00:52 ad Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.44 2007/05/08 17:27:37 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.45 2007/07/09 21:00:52 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -120,7 +120,7 @@ struct cztty_softc { struct cz_softc *sc_parent; struct tty *sc_tty; - struct callout sc_diag_ch; + callout_t sc_diag_ch; int sc_channel; /* Also used to flag unattached chan */ #define CZTTY_CHANNEL_DEAD -1 @@ -154,7 +154,7 @@ struct cz_softc { struct plx9060_config cz_plx; /* PLX 9060 config info */ bus_space_tag_t cz_win_st; /* window space tag */ bus_space_handle_t cz_win_sh; /* window space handle */ - struct callout cz_callout; /* callout for polling-mode */ + callout_t cz_callout; /* callout for polling-mode */ void *cz_ih; /* interrupt handle */ @@ -364,7 +364,7 @@ cz_attach(struct device *parent, polling_mode: if (cz->cz_ih == NULL) { - callout_init(&cz->cz_callout); + callout_init(&cz->cz_callout, 0); if (cz_timeout_ticks == 0) cz_timeout_ticks = max(1, hz * CZ_POLL_MS / 1000); aprint_normal("%s: polling mode, %d ms interval (%d tick%s)\n", @@ -419,7 +419,7 @@ cz_attach(struct device *parent, continue; } - callout_init(&sc->sc_diag_ch); + callout_init(&sc->sc_diag_ch, 0); tp = ttymalloc(); tp->t_dev = makedev(cdevsw_lookup_major(&cz_cdevsw), diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 11d0d2554a9..a203170dcc1 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $NetBSD: hifn7751.c,v 1.34 2007/03/04 06:02:18 christos Exp $ */ +/* $NetBSD: hifn7751.c,v 1.35 2007/07/09 21:00:52 ad Exp $ */ /* $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */ /* $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $ */ @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.34 2007/03/04 06:02:18 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.35 2007/07/09 21:00:52 ad Exp $"); #include "rnd.h" @@ -444,7 +444,7 @@ hifn_attach(struct device *parent, struct device *self, void *aux) timeout_set(&sc->sc_tickto, hifn_tick, sc); timeout_add(&sc->sc_tickto, hz); #else - callout_init(&sc->sc_tickto); + callout_init(&sc->sc_tickto, 0); callout_reset(&sc->sc_tickto, hz, hifn_tick, sc); #endif return; @@ -542,7 +542,7 @@ hifn_init_pubrng(struct hifn_softc *sc) #ifdef __OpenBSD__ timeout_set(&sc->sc_rngto, hifn_rng, sc); #else /* !__OpenBSD__ */ - callout_init(&sc->sc_rngto); + callout_init(&sc->sc_rngto, 0); #endif /* !__OpenBSD__ */ } diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index da300eff0f4..37fe85bc22a 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bce.c,v 1.15 2007/03/21 04:56:39 dan Exp $ */ +/* $NetBSD: if_bce.c,v 1.16 2007/07/09 21:00:53 ad Exp $ */ /* * Copyright (c) 2003 Clifford Wright. All rights reserved. @@ -139,7 +139,7 @@ struct bce_softc { u_int32_t bce_txin; /* last tx descriptor seen */ int bce_txsfree; /* no. tx slots available */ int bce_txsnext; /* next available tx slot */ - struct callout bce_timeout; + callout_t bce_timeout; #if NRND > 0 rndsource_element_t rnd_source; #endif @@ -511,7 +511,7 @@ bce_attach(struct device *parent, struct device *self, void *aux) rnd_attach_source(&sc->rnd_source, sc->bce_dev.dv_xname, RND_TYPE_NET, 0); #endif - callout_init(&sc->bce_timeout); + callout_init(&sc->bce_timeout, 0); } /* handle media, and ethernet requests */ diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 5dc19a0497f..31895a8c320 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.131 2007/06/09 21:42:33 mlelstv Exp $ */ +/* $NetBSD: if_bge.c,v 1.132 2007/07/09 21:00:53 ad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.131 2007/06/09 21:42:33 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.132 2007/07/09 21:00:53 ad Exp $"); #include "bpfilter.h" #include "vlan.h" @@ -2700,7 +2700,7 @@ bge_attach(device_t parent, device_t self, void *aux) NULL, sc->bge_dev.dv_xname, "xoffentered"); #endif /* BGE_EVENT_COUNTERS */ DPRINTFN(5, ("callout_init\n")); - callout_init(&sc->bge_timeout); + callout_init(&sc->bge_timeout, 0); sc->bge_powerhook = powerhook_establish(sc->bge_dev.dv_xname, bge_powerhook, sc); diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index fd53ef7ee17..6e9740e7850 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bnx.c,v 1.6 2007/04/10 12:18:26 bouyer Exp $ */ +/* $NetBSD: if_bnx.c,v 1.7 2007/07/09 21:00:53 ad Exp $ */ /* $OpenBSD: if_bnx.c,v 1.43 2007/01/30 03:21:10 krw Exp $ */ /*- @@ -35,7 +35,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.6 2007/04/10 12:18:26 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.7 2007/07/09 21:00:53 ad Exp $"); /* * The following controllers are supported by this driver: @@ -709,7 +709,7 @@ bnx_attach(struct device *parent, struct device *self, void *aux) if_attach(ifp); ether_ifattach(ifp,sc->eaddr); - callout_init(&sc->bnx_timeout); + callout_init(&sc->bnx_timeout, 0); /* Print some important debugging info. */ DBRUN(BNX_INFO, bnx_dump_driver_state(sc)); diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 404928b22de..9d77ab6b202 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.123 2007/03/04 06:02:19 christos Exp $ */ +/* $NetBSD: if_de.c,v 1.124 2007/07/09 21:00:53 ad Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) @@ -37,7 +37,7 @@ * board which support 21040, 21041, or 21140 (mostly). */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.123 2007/03/04 06:02:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.124 2007/07/09 21:00:53 ad Exp $"); #define TULIP_HDR_DATA @@ -5790,8 +5790,8 @@ tulip_pci_attach( #endif /* __bsdi__ */ #if defined(__NetBSD__) - callout_init(&sc->tulip_to_ch); - callout_init(&sc->tulip_fto_ch); + callout_init(&sc->tulip_to_ch, 0); + callout_init(&sc->tulip_fto_ch, 0); csr_base = 0; { diff --git a/sys/dev/pci/if_kse.c b/sys/dev/pci/if_kse.c index e13b4dea673..90b95acc3a1 100644 --- a/sys/dev/pci/if_kse.c +++ b/sys/dev/pci/if_kse.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_kse.c,v 1.3 2007/03/04 06:02:20 christos Exp $ */ +/* $NetBSD: if_kse.c,v 1.4 2007/07/09 21:00:53 ad Exp $ */ /* * Copyright (c) 2006 Tohru Nishimura @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.3 2007/03/04 06:02:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.4 2007/07/09 21:00:53 ad Exp $"); #include "bpfilter.h" @@ -199,7 +199,7 @@ struct kse_softc { struct ifmedia sc_media; /* ifmedia information */ int sc_media_status; /* PHY */ int sc_media_active; /* PHY */ - struct callout sc_callout; /* tick callout */ + callout_t sc_callout; /* tick callout */ bus_dmamap_t sc_cddmamap; /* control data DMA map */ #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -457,7 +457,7 @@ kse_attach(struct device *parent, struct device *self, void *aux) sc->sc_rxsoft[i].rxs_mbuf = NULL; } - callout_init(&sc->sc_callout); + callout_init(&sc->sc_callout, 0); ifmedia_init(&sc->sc_media, 0, ifmedia_upd, ifmedia_sts); ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_10_T, 0, NULL); diff --git a/sys/dev/pci/if_lmc.c b/sys/dev/pci/if_lmc.c index c2c32f5125a..321c4f505bd 100644 --- a/sys/dev/pci/if_lmc.c +++ b/sys/dev/pci/if_lmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_lmc.c,v 1.34 2007/03/04 06:02:20 christos Exp $ */ +/* $NetBSD: if_lmc.c,v 1.35 2007/07/09 21:00:54 ad Exp $ */ /*- * Copyright (c) 2002-2006 David Boggs. <boggs@boggs.palo-alto.ca.us> @@ -167,6 +167,7 @@ # include <sys/device.h> # include <sys/reboot.h> # include <sys/kauth.h> +# include <sys/proc.h> # include <net/if.h> # include <net/if_types.h> # include <net/if_media.h> diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 06454466d9d..32b59df1dc7 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_msk.c,v 1.8 2007/03/04 06:02:21 christos Exp $ */ +/* $NetBSD: if_msk.c,v 1.9 2007/07/09 21:00:54 ad Exp $ */ /* $OpenBSD: if_msk.c,v 1.42 2007/01/17 02:43:02 krw Exp $ */ /* @@ -1114,7 +1114,7 @@ msk_attach(struct device *parent, struct device *self, void *aux) } else ifmedia_set(&sc_if->sk_mii.mii_media, IFM_ETHER|IFM_AUTO); - callout_init(&sc_if->sk_tick_ch); + callout_init(&sc_if->sk_tick_ch, 0); callout_setfunc(&sc_if->sk_tick_ch, msk_tick, sc_if); callout_schedule(&sc_if->sk_tick_ch, hz); diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 83720347f73..376f588569d 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_nfe.c,v 1.15 2007/03/04 06:02:22 christos Exp $ */ +/* $NetBSD: if_nfe.c,v 1.16 2007/07/09 21:00:54 ad Exp $ */ /* $OpenBSD: if_nfe.c,v 1.52 2006/03/02 09:04:00 jsg Exp $ */ /*- @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.15 2007/03/04 06:02:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.16 2007/07/09 21:00:54 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -346,7 +346,7 @@ nfe_attach(struct device *parent, struct device *self, void *aux) if_attach(ifp); ether_ifattach(ifp, sc->sc_enaddr); - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); callout_setfunc(&sc->sc_tick_ch, nfe_tick, sc); sc->sc_powerhook = powerhook_establish(sc->sc_dev.dv_xname, diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index 8102304bb3a..769c2e00877 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_pcn.c,v 1.38 2007/03/04 06:02:22 christos Exp $ */ +/* $NetBSD: if_pcn.c,v 1.39 2007/07/09 21:00:55 ad Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.38 2007/03/04 06:02:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.39 2007/07/09 21:00:55 ad Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -260,7 +260,7 @@ struct pcn_softc { struct mii_data sc_mii; /* MII/media information */ - struct callout sc_tick_ch; /* tick callout */ + callout_t sc_tick_ch; /* tick callout */ bus_dmamap_t sc_cddmamap; /* control data DMA map */ #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -593,7 +593,7 @@ pcn_attach(struct device *parent, struct device *self, void *aux) prop_object_t obj; bool is_vmware; - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); printf(": AMD PCnet-PCI Ethernet\n"); diff --git a/sys/dev/pci/if_sip.c b/sys/dev/pci/if_sip.c index 36a1d2ec0b6..843f28a204b 100644 --- a/sys/dev/pci/if_sip.c +++ b/sys/dev/pci/if_sip.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sip.c,v 1.112 2007/03/04 15:05:24 yamt Exp $ */ +/* $NetBSD: if_sip.c,v 1.113 2007/07/09 21:00:55 ad Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -80,7 +80,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.112 2007/03/04 15:05:24 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.113 2007/07/09 21:00:55 ad Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -238,7 +238,7 @@ struct sip_softc { struct mii_data sc_mii; /* MII/media information */ - struct callout sc_tick_ch; /* tick callout */ + callout_t sc_tick_ch; /* tick callout */ bus_dmamap_t sc_cddmamap; /* control data DMA map */ #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -670,7 +670,7 @@ SIP_DECL(attach)(struct device *parent, struct device *self, void *aux) u_int32_t reg; #endif /* DP83820 */ - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); sip = SIP_DECL(lookup)(pa); if (sip == NULL) { diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index f73e7a6c3c4..d64988de691 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sk.c,v 1.40 2007/07/06 18:52:52 briggs Exp $ */ +/* $NetBSD: if_sk.c,v 1.41 2007/07/09 21:00:55 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -1454,7 +1454,7 @@ sk_attach(struct device *parent, struct device *self, void *aux) } else ifmedia_set(&sc_if->sk_mii.mii_media, IFM_ETHER|IFM_AUTO); - callout_init(&sc_if->sk_tick_ch); + callout_init(&sc_if->sk_tick_ch, 0); callout_reset(&sc_if->sk_tick_ch,hz,sk_tick,sc_if); DPRINTFN(2, ("sk_attach: 1\n")); diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c index b39377da45a..097402a7160 100644 --- a/sys/dev/pci/if_ste.c +++ b/sys/dev/pci/if_ste.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ste.c,v 1.27 2007/03/04 06:02:22 christos Exp $ */ +/* $NetBSD: if_ste.c,v 1.28 2007/07/09 21:00:55 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.27 2007/03/04 06:02:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.28 2007/07/09 21:00:55 ad Exp $"); #include "bpfilter.h" @@ -140,7 +140,7 @@ struct ste_softc { struct mii_data sc_mii; /* MII/media information */ - struct callout sc_tick_ch; /* tick callout */ + callout_t sc_tick_ch; /* tick callout */ bus_dmamap_t sc_cddmamap; /* control data DMA map */ #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -318,7 +318,7 @@ ste_attach(struct device *parent, struct device *self, void *aux) uint8_t enaddr[ETHER_ADDR_LEN]; uint16_t myea[ETHER_ADDR_LEN / 2]; - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); sp = ste_lookup(pa); if (sp == NULL) { diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index 30800454575..e139bf30cc2 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_stge.c,v 1.36 2007/03/04 06:02:23 christos Exp $ */ +/* $NetBSD: if_stge.c,v 1.37 2007/07/09 21:00:55 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.36 2007/03/04 06:02:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.37 2007/07/09 21:00:55 ad Exp $"); #include "bpfilter.h" @@ -151,7 +151,7 @@ struct stge_softc { struct mii_data sc_mii; /* MII/media information */ - struct callout sc_tick_ch; /* tick callout */ + callout_t sc_tick_ch; /* tick callout */ bus_dmamap_t sc_cddmamap; /* control data DMA map */ #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -401,7 +401,7 @@ stge_attach(struct device *parent, struct device *self, void *aux) const struct stge_product *sp; uint8_t enaddr[ETHER_ADDR_LEN]; - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); sp = stge_lookup(pa); if (sp == NULL) { diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c index 4d993715a9b..117f60d403e 100644 --- a/sys/dev/pci/if_tl.c +++ b/sys/dev/pci/if_tl.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tl.c,v 1.82 2007/03/04 06:02:23 christos Exp $ */ +/* $NetBSD: if_tl.c,v 1.83 2007/07/09 21:00:55 ad Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.82 2007/03/04 06:02:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.83 2007/07/09 21:00:55 ad Exp $"); #undef TLDEBUG #define TL_PRIV_STATS @@ -310,8 +310,8 @@ tl_pci_attach(struct device *parent, struct device *self, void *aux) printf("\n"); - callout_init(&sc->tl_tick_ch); - callout_init(&sc->tl_restart_ch); + callout_init(&sc->tl_tick_ch, 0); + callout_init(&sc->tl_restart_ch, 0); tp = tl_lookup_product(pa->pa_id); if (tp == NULL) diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index aecc084e425..22aff5e57d2 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_txp.c,v 1.19 2007/03/04 06:02:23 christos Exp $ */ +/* $NetBSD: if_txp.c,v 1.20 2007/07/09 21:00:55 ad Exp $ */ /* * Copyright (c) 2001 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.19 2007/03/04 06:02:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.20 2007/07/09 21:00:55 ad Exp $"); #include "bpfilter.h" #include "opt_inet.h" @@ -338,7 +338,7 @@ txp_attach(struct device *parent, struct device *self, void *aux) txp_capabilities(sc); - callout_init(&sc->sc_tick); + callout_init(&sc->sc_tick, 0); callout_setfunc(&sc->sc_tick, txp_tick, sc); /* diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index 835ab3e67e3..31c61e78b8c 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vge.c,v 1.35 2007/06/12 14:32:36 tsutsui Exp $ */ +/* $NetBSD: if_vge.c,v 1.36 2007/07/09 21:00:56 ad Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.35 2007/06/12 14:32:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.36 2007/07/09 21:00:56 ad Exp $"); /* * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver. @@ -207,7 +207,7 @@ struct vge_softc { int sc_if_flags; int sc_link; int sc_camidx; - struct callout sc_timeout; + callout_t sc_timeout; bus_dmamap_t sc_cddmamap; #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -1069,7 +1069,7 @@ vge_attach(struct device *parent, struct device *self, void *aux) if_attach(ifp); ether_ifattach(ifp, eaddr); - callout_init(&sc->sc_timeout); + callout_init(&sc->sc_timeout, 0); callout_setfunc(&sc->sc_timeout, vge_tick, sc); /* diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index a1cdf954fb3..0c6716a7c30 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vr.c,v 1.86 2007/06/15 21:08:21 jmcneill Exp $ */ +/* $NetBSD: if_vr.c,v 1.87 2007/07/09 21:00:56 ad Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.86 2007/06/15 21:08:21 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.87 2007/07/09 21:00:56 ad Exp $"); #include "rnd.h" @@ -226,7 +226,7 @@ struct vr_softc { uint8_t vr_revid; /* Rhine chip revision */ - struct callout vr_tick_ch; /* tick callout */ + callout_t vr_tick_ch; /* tick callout */ bus_dmamap_t vr_cddmamap; /* control data DMA map */ #define vr_cddma vr_cddmamap->dm_segs[0].ds_addr @@ -1505,7 +1505,7 @@ vr_attach(struct device *parent, struct device *self, void *aux) sc->vr_pc = pa->pa_pc; sc->vr_tag = pa->pa_tag; - callout_init(&sc->vr_tick_ch); + callout_init(&sc->vr_tick_ch, 0); vrt = vr_lookup(pa); if (vrt == NULL) { diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c index 3c1fed1069d..689b31bef8a 100644 --- a/sys/dev/pci/if_wm.c +++ b/sys/dev/pci/if_wm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.141 2007/05/29 07:17:23 simonb Exp $ */ +/* $NetBSD: if_wm.c,v 1.142 2007/07/09 21:00:56 ad Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.141 2007/05/29 07:17:23 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.142 2007/07/09 21:00:56 ad Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -285,7 +285,7 @@ struct wm_softc { struct mii_data sc_mii; /* MII/media information */ - struct callout sc_tick_ch; /* tick callout */ + callout_t sc_tick_ch; /* tick callout */ bus_dmamap_t sc_cddmamap; /* control data DMA map */ #define sc_cddma sc_cddmamap->dm_segs[0].ds_addr @@ -352,7 +352,7 @@ struct wm_softc { int sc_txfifo_head; /* current head of FIFO */ uint32_t sc_txfifo_addr; /* internal address of start of FIFO */ int sc_txfifo_stall; /* Tx FIFO is stalled */ - struct callout sc_txfifo_ch; /* Tx FIFO stall work-around timer */ + callout_t sc_txfifo_ch; /* Tx FIFO stall work-around timer */ bus_addr_t sc_rdt_reg; /* offset of RDT register */ @@ -919,7 +919,7 @@ wm_attach(struct device *parent, struct device *self, void *aux) pcireg_t preg, memtype; uint32_t reg; - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); wmp = wm_lookup(pa); if (wmp == NULL) { @@ -1063,7 +1063,7 @@ wm_attach(struct device *parent, struct device *self, void *aux) aprint_verbose("%s: Communication Streaming Architecture\n", sc->sc_dev.dv_xname); if (sc->sc_type == WM_T_82547) { - callout_init(&sc->sc_txfifo_ch); + callout_init(&sc->sc_txfifo_ch, 0); callout_setfunc(&sc->sc_txfifo_ch, wm_82547_txfifo_stall, sc); aprint_verbose("%s: using 82547 Tx FIFO stall " diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 8f4bcf7a83a..ce3499d4476 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wpi.c,v 1.13 2007/07/09 20:29:06 degroote Exp $ */ +/* $NetBSD: if_wpi.c,v 1.14 2007/07/09 21:00:56 ad Exp $ */ /*- * Copyright (c) 2006, 2007 @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.13 2007/07/09 20:29:06 degroote Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.14 2007/07/09 21:00:56 ad Exp $"); /* * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters. @@ -202,7 +202,7 @@ wpi_attach(struct device *parent __unused, struct device *self, void *aux) sc->sc_pct = pa->pa_pc; sc->sc_pcitag = pa->pa_tag; - callout_init(&sc->calib_to); + callout_init(&sc->calib_to, 0); pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo); revision = PCI_REVISION(pa->pa_class); diff --git a/sys/dev/pci/ifpci.c b/sys/dev/pci/ifpci.c index 26fd76457e0..a6f695e7b85 100644 --- a/sys/dev/pci/ifpci.c +++ b/sys/dev/pci/ifpci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifpci.c,v 1.22 2007/03/04 06:02:24 christos Exp $ */ +/* $NetBSD: ifpci.c,v 1.23 2007/07/09 21:00:56 ad Exp $ */ /* * Copyright (c) 1999 Gary Jennejohn. All rights reserved. * @@ -36,14 +36,14 @@ * Fritz!Card PCI driver * ------------------------------------------------ * - * $Id: ifpci.c,v 1.22 2007/03/04 06:02:24 christos Exp $ + * $Id: ifpci.c,v 1.23 2007/07/09 21:00:56 ad Exp $ * * last edit-date: [Fri Jan 5 11:38:58 2001] * *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ifpci.c,v 1.22 2007/03/04 06:02:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ifpci.c,v 1.23 2007/07/09 21:00:56 ad Exp $"); #include <sys/param.h> @@ -286,8 +286,8 @@ ifpci_attach(struct device *parent, struct device *self, void *aux) printf(": Fritz!PCI card\n"); /* initialize sc */ - callout_init(&sc->sc_T3_callout); - callout_init(&sc->sc_T4_callout); + callout_init(&sc->sc_T3_callout, 0); + callout_init(&sc->sc_T4_callout, 0); /* setup io mappings */ sc->sc_cardtyp = CARD_TYPEP_AVMA1PCI; diff --git a/sys/dev/pci/ifpci2.c b/sys/dev/pci/ifpci2.c index c3751eb8374..eb8d3207de3 100644 --- a/sys/dev/pci/ifpci2.c +++ b/sys/dev/pci/ifpci2.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifpci2.c,v 1.10 2007/03/04 06:02:24 christos Exp $ */ +/* $NetBSD: ifpci2.c,v 1.11 2007/07/09 21:00:57 ad Exp $ */ /* * Copyright (c) 1999 Gary Jennejohn. All rights reserved. * @@ -36,14 +36,14 @@ * Fritz!Card PCI driver * ------------------------------------------------ * - * $Id: ifpci2.c,v 1.10 2007/03/04 06:02:24 christos Exp $ + * $Id: ifpci2.c,v 1.11 2007/07/09 21:00:57 ad Exp $ * * last edit-date: [Fri Jan 5 11:38:58 2001] * *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ifpci2.c,v 1.10 2007/03/04 06:02:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ifpci2.c,v 1.11 2007/07/09 21:00:57 ad Exp $"); #include <sys/param.h> @@ -256,8 +256,8 @@ ifpci2_attach(struct device *parent, struct device *self, void *aux) printf(": Fritz!PCI V2 card\n"); /* initialize sc */ - callout_init(&sc->sc_T3_callout); - callout_init(&sc->sc_T4_callout); + callout_init(&sc->sc_T3_callout, 0); + callout_init(&sc->sc_T4_callout, 0); /* setup io mappings */ sc->sc_num_mappings = 1; diff --git a/sys/dev/pci/iop_pci.c b/sys/dev/pci/iop_pci.c index dbee9ecdeea..b546edf9a54 100644 --- a/sys/dev/pci/iop_pci.c +++ b/sys/dev/pci/iop_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: iop_pci.c,v 1.19 2007/06/16 23:26:04 ad Exp $ */ +/* $NetBSD: iop_pci.c,v 1.20 2007/07/09 21:00:57 ad Exp $ */ /*- * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iop_pci.c,v 1.19 2007/06/16 23:26:04 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iop_pci.c,v 1.20 2007/07/09 21:00:57 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -188,7 +188,7 @@ iop_pci_attach(struct device *parent, struct device *self, void *aux) pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg | PCI_COMMAND_MASTER_ENABLE); - /* Map and establish the interrupt. XXX IPL_BIO. */ + /* Map and establish the interrupt.. */ if (pci_intr_map(pa, &ih)) { printf("can't map interrupt\n"); return; diff --git a/sys/dev/pci/isic_pci.c b/sys/dev/pci/isic_pci.c index ab096d48311..d9e2fe66a8d 100644 --- a/sys/dev/pci/isic_pci.c +++ b/sys/dev/pci/isic_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: isic_pci.c,v 1.27 2006/11/16 01:33:09 christos Exp $ */ +/* $NetBSD: isic_pci.c,v 1.28 2007/07/09 21:00:57 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.27 2006/11/16 01:33:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.28 2007/07/09 21:00:57 ad Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -148,8 +148,8 @@ isic_pci_attach(struct device *parent, struct device *self, void *aux) printf(": %s\n", prod->name); - callout_init(&sc->sc_T3_callout); - callout_init(&sc->sc_T4_callout); + callout_init(&sc->sc_T3_callout, 0); + callout_init(&sc->sc_T4_callout, 0); /* card initilization and sc setup */ if (!prod->attach(psc, pa)) diff --git a/sys/dev/pci/isic_pci_elsa_qs1p.c b/sys/dev/pci/isic_pci_elsa_qs1p.c index 69eb7e51d99..87393e145b8 100644 --- a/sys/dev/pci/isic_pci_elsa_qs1p.c +++ b/sys/dev/pci/isic_pci_elsa_qs1p.c @@ -1,4 +1,4 @@ -/* $NetBSD: isic_pci_elsa_qs1p.c,v 1.15 2005/12/11 12:22:50 christos Exp $ */ +/* $NetBSD: isic_pci_elsa_qs1p.c,v 1.16 2007/07/09 21:00:57 ad Exp $ */ /* * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved. @@ -32,7 +32,7 @@ *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_pci_elsa_qs1p.c,v 1.15 2005/12/11 12:22:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_pci_elsa_qs1p.c,v 1.16 2007/07/09 21:00:57 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -267,7 +267,7 @@ isic_attach_Eqs1pp(psc, pa) IPAC_WRITE(IPAC_AOE, /* aux 5..2 are inputs, 7, 6 outputs */ (IPAC_AOE_OE5 | IPAC_AOE_OE4 | IPAC_AOE_OE3 | IPAC_AOE_OE2)); IPAC_WRITE(IPAC_ATX, ELSA_NO_LED); /* set all output lines high */ - callout_init(&((struct pci_isic_softc *)sc)->ledcallout); + callout_init(&((struct pci_isic_softc *)sc)->ledcallout, 0); /* disable any interrupts */ IPAC_WRITE(IPAC_MASK, 0xff); diff --git a/sys/dev/pci/mly.c b/sys/dev/pci/mly.c index a7682a0dd71..de3d55bad1e 100644 --- a/sys/dev/pci/mly.c +++ b/sys/dev/pci/mly.c @@ -1,4 +1,4 @@ -/* $NetBSD: mly.c,v 1.34 2007/03/04 06:02:24 christos Exp $ */ +/* $NetBSD: mly.c,v 1.35 2007/07/09 21:00:57 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.34 2007/03/04 06:02:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.35 2007/07/09 21:00:57 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -138,7 +138,6 @@ static void mly_release_ccbs(struct mly_softc *); static int mly_scan_btl(struct mly_softc *, int, int); static void mly_scan_channel(struct mly_softc *, int); static void mly_thread(void *); -static void mly_thread_create(void *); static int mly_ccb_alloc(struct mly_softc *, struct mly_ccb **); static void mly_ccb_complete(struct mly_softc *, struct mly_ccb *); @@ -550,9 +549,12 @@ mly_attach(struct device *parent, struct device *self, void *aux) /* * Finally, create our monitoring thread. */ - kthread_create(mly_thread_create, mly); - mly->mly_state |= MLY_STATE_INITOK; + rv = kthread_create(PRI_NONE, 0, NULL, mly_thread, mly, + &mly->mly_thread, "%s", mly->mly_dv.dv_xname); + if (rv != 0) + printf("%s: unable to create thread (%d)\n", + mly->mly_dv.dv_xname, rv); return; bad: @@ -1252,25 +1254,6 @@ mly_process_event(struct mly_softc *mly, struct mly_event *me) } /* - * Create the monitoring thread. Called after the standard kernel threads - * have been created. - */ -static void -mly_thread_create(void *cookie) -{ - struct mly_softc *mly; - int rv; - - mly = cookie; - - rv = kthread_create1(mly_thread, mly, &mly->mly_thread, "%s", - mly->mly_dv.dv_xname); - if (rv != 0) - printf("%s: unable to create thread (%d)\n", - mly->mly_dv.dv_xname, rv); -} - -/* * Perform periodic activities. */ static void diff --git a/sys/dev/pci/mlyvar.h b/sys/dev/pci/mlyvar.h index 7e688af2139..de5f4fc3ccc 100644 --- a/sys/dev/pci/mlyvar.h +++ b/sys/dev/pci/mlyvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: mlyvar.h,v 1.3 2006/02/16 20:17:19 perry Exp $ */ +/* $NetBSD: mlyvar.h,v 1.4 2007/07/09 21:00:57 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -214,7 +214,7 @@ struct mly_softc { u_int mly_event_change; u_int mly_event_counter; u_int mly_event_waiting; - struct proc *mly_thread; + struct lwp *mly_thread; /* SCSI mid-layer connection. */ struct scsipi_adapter mly_adapt; diff --git a/sys/dev/pci/oboe.c b/sys/dev/pci/oboe.c index 478a403fa27..66d39587be3 100644 --- a/sys/dev/pci/oboe.c +++ b/sys/dev/pci/oboe.c @@ -1,4 +1,4 @@ -/* $NetBSD: oboe.c,v 1.25 2007/03/04 06:02:25 christos Exp $ */ +/* $NetBSD: oboe.c,v 1.26 2007/07/09 21:00:57 ad Exp $ */ /* XXXXFVDL THIS DRIVER IS BROKEN FOR NON-i386 -- vtophys() usage */ @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.25 2007/03/04 06:02:25 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.26 2007/07/09 21:00:57 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.25 2007/03/04 06:02:25 christos Exp $"); #include <sys/tty.h> #include <sys/vnode.h> #include <sys/poll.h> +#include <sys/proc.h> #include <dev/ir/ir.h> #include <dev/ir/irdaio.h> diff --git a/sys/dev/pci/radeonfb.c b/sys/dev/pci/radeonfb.c index 869615b0c4e..c37505c73ba 100644 --- a/sys/dev/pci/radeonfb.c +++ b/sys/dev/pci/radeonfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: radeonfb.c,v 1.14 2007/03/21 20:54:30 macallan Exp $ */ +/* $NetBSD: radeonfb.c,v 1.15 2007/07/09 21:00:57 ad Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.14 2007/03/21 20:54:30 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.15 2007/07/09 21:00:57 ad Exp $"); #define RADEONFB_DEFAULT_DEPTH 32 @@ -873,7 +873,7 @@ radeonfb_attach(struct device *parent, struct device *dev, void *aux) radeonfb_blank(dp, 0); /* Initialise delayed lvds operations for backlight. */ - callout_init(&dp->rd_bl_lvds_co); + callout_init(&dp->rd_bl_lvds_co, 0); callout_setfunc(&dp->rd_bl_lvds_co, radeonfb_lvds_callout, dp); } diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index 8c49aa5d1c0..62e50a1a8d5 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $NetBSD: ubsec.c,v 1.12 2007/03/04 06:02:26 christos Exp $ */ +/* $NetBSD: ubsec.c,v 1.13 2007/07/09 21:00:58 ad Exp $ */ /* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */ /* $OpenBSD: ubsec.c,v 1.127 2003/06/04 14:04:58 jason Exp $ */ @@ -445,7 +445,7 @@ ubsec_attach(struct device *parent, struct device *self, void *aux) timeout_set(&sc->sc_rngto, ubsec_rng, sc); timeout_add(&sc->sc_rngto, sc->sc_rnghz); #else - callout_init(&sc->sc_rngto); + callout_init(&sc->sc_rngto, 0); callout_reset(&sc->sc_rngto, sc->sc_rnghz, ubsec_rng, sc); #endif skip_rng: diff --git a/sys/dev/pckbport/pms.c b/sys/dev/pckbport/pms.c index cca7c134548..5a836bc537a 100644 --- a/sys/dev/pckbport/pms.c +++ b/sys/dev/pckbport/pms.c @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.17 2007/03/04 06:02:27 christos Exp $ */ +/* $NetBSD: pms.c,v 1.18 2007/07/09 21:01:19 ad Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -28,7 +28,7 @@ #include "opt_pms.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.17 2007/03/04 06:02:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.18 2007/07/09 21:01:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -82,7 +82,6 @@ static int pms_protocol(pckbport_tag_t, pckbport_slot_t); static void do_enable(struct pms_softc *); static void do_disable(struct pms_softc *); static void pms_reset_thread(void*); -static void pms_spawn_reset_thread(void*); int pms_enable(void *); int pms_ioctl(void *, u_long, void *, int, struct lwp *); void pms_disable(void *); @@ -226,7 +225,8 @@ pmsattach(struct device *parent, struct device *self, void *aux) printf("pmsattach: disable error\n"); pckbport_slot_enable(sc->sc_kbctag, sc->sc_kbcslot, 0); - kthread_create(pms_spawn_reset_thread, sc); + kthread_create(PRI_NONE, 0, NULL, pms_reset_thread, sc, + &sc->sc_event_thread, sc->sc_dev.dv_xname); #ifndef PMS_DISABLE_POWERHOOK sc->sc_powerhook = powerhook_establish(self->dv_xname, pms_power, sc); @@ -409,15 +409,6 @@ pms_ioctl(void *v, u_long cmd, void *data, int flag, } static void -pms_spawn_reset_thread(void *arg) -{ - struct pms_softc *sc = arg; - - kthread_create1(pms_reset_thread, sc, &sc->sc_event_thread, - sc->sc_dev.dv_xname); -} - -static void pms_reset_thread(void *arg) { struct pms_softc *sc = arg; diff --git a/sys/dev/pckbport/pmsvar.h b/sys/dev/pckbport/pmsvar.h index 90a6093721c..8353bc5ccb7 100644 --- a/sys/dev/pckbport/pmsvar.h +++ b/sys/dev/pckbport/pmsvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmsvar.h,v 1.4 2005/12/11 12:23:22 christos Exp $ */ +/* $NetBSD: pmsvar.h,v 1.5 2007/07/09 21:01:19 ad Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -60,7 +60,7 @@ struct pms_softc { /* driver status information */ struct timeval last, current; struct device *sc_wsmousedev; - struct proc *sc_event_thread; + struct lwp *sc_event_thread; #ifdef PMS_SYNAPTICS_TOUCHPAD union { diff --git a/sys/dev/pcmcia/esp_pcmcia.c b/sys/dev/pcmcia/esp_pcmcia.c index 8e6eadbfd18..3f16a841abe 100644 --- a/sys/dev/pcmcia/esp_pcmcia.c +++ b/sys/dev/pcmcia/esp_pcmcia.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp_pcmcia.c,v 1.31 2007/03/04 06:02:27 christos Exp $ */ +/* $NetBSD: esp_pcmcia.c,v 1.32 2007/07/09 21:01:19 ad Exp $ */ /*- * Copyright (c) 2000, 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: esp_pcmcia.c,v 1.31 2007/03/04 06:02:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esp_pcmcia.c,v 1.32 2007/07/09 21:01:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -201,7 +201,7 @@ esp_pcmcia_init(esc) sc->sc_glue = &esp_pcmcia_glue; #ifdef ESP_PCMCIA_POLL - callout_init(&esc->sc_poll_ch); + callout_init(&esc->sc_poll_ch, 0); #endif sc->sc_rev = NCR_VARIANT_ESP406; diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c index 1e8b78e18b1..8e33ae9ffe1 100644 --- a/sys/dev/pcmcia/if_ray.c +++ b/sys/dev/pcmcia/if_ray.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ray.c,v 1.64 2007/03/04 06:02:27 christos Exp $ */ +/* $NetBSD: if_ray.c,v 1.65 2007/07/09 21:01:20 ad Exp $ */ /* * Copyright (c) 2000 Christian E. Hopps @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.64 2007/03/04 06:02:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.65 2007/07/09 21:01:20 ad Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -528,9 +528,9 @@ ray_attach(struct device *parent, struct device *self, void *aux) sc->sc_memt = cfe->memspace[0].handle.memt; sc->sc_memh = cfe->memspace[0].handle.memh; - callout_init(&sc->sc_reset_resetloop_ch); - callout_init(&sc->sc_disable_ch); - callout_init(&sc->sc_start_join_timo_ch); + callout_init(&sc->sc_reset_resetloop_ch, 0); + callout_init(&sc->sc_disable_ch, 0); + callout_init(&sc->sc_start_join_timo_ch, 0); error = ray_enable(sc); if (error) @@ -790,8 +790,8 @@ ray_init(sc) /* clear the interrupt if present */ REG_WRITE(sc, RAY_HCSIR, 0); - callout_init(&sc->sc_check_ccs_ch); - callout_init(&sc->sc_check_scheduled_ch); + callout_init(&sc->sc_check_ccs_ch, 0); + callout_init(&sc->sc_check_scheduled_ch, 0); /* we are now up and running -- and are busy until download is cplt */ sc->sc_if.if_flags |= IFF_RUNNING | IFF_OACTIVE; diff --git a/sys/dev/pcmcia/isic_pcmcia.c b/sys/dev/pcmcia/isic_pcmcia.c index d6295c15020..120d01dca87 100644 --- a/sys/dev/pcmcia/isic_pcmcia.c +++ b/sys/dev/pcmcia/isic_pcmcia.c @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.31 2006/11/16 01:33:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.32 2007/07/09 21:01:20 ad Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -380,8 +380,8 @@ isic_pcmcia_isdn_attach(struct isic_softc *sc, const char *cardname) sc->sc_freeflag2 = 0; #if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000 - callout_init(&sc->sc_T3_callout); - callout_init(&sc->sc_T4_callout); + callout_init(&sc->sc_T3_callout, 0); + callout_init(&sc->sc_T4_callout, 0); #endif /* announce chip versions */ diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index af7fa06767c..95fa6d9e050 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.96 2007/06/26 15:22:24 cube Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.97 2007/07/09 21:01:20 ad Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,13 +33,12 @@ ************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.96 2007/06/26 15:22:24 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.97 2007/07/09 21:01:20 ad Exp $"); +#include <sys/param.h> #include <sys/time.h> #include <sys/buf.h> #include <sys/errno.h> - -#include <sys/param.h> #include <sys/systm.h> #include <sys/proc.h> #include <sys/ioctl.h> diff --git a/sys/dev/raidframe/rf_threadstuff.h b/sys/dev/raidframe/rf_threadstuff.h index 1df767bba3b..1f0f887a3ed 100644 --- a/sys/dev/raidframe/rf_threadstuff.h +++ b/sys/dev/raidframe/rf_threadstuff.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_threadstuff.h,v 1.21 2005/12/11 12:23:37 christos Exp $ */ +/* $NetBSD: rf_threadstuff.h,v 1.22 2007/07/09 21:01:20 ad Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -87,12 +87,12 @@ typedef void *RF_ThreadArg_t; #define RF_SIGNAL_COND(_c_) wakeup_one(&(_c_)) #define RF_BROADCAST_COND(_c_) wakeup(&(_c_)) #define RF_CREATE_THREAD(_handle_, _func_, _arg_, _name_) \ - kthread_create1((void (*)(void *))(_func_), (void *)(_arg_), \ - (struct proc **)&(_handle_), _name_) + kthread_create(PRI_NONE, 0, NULL, (void (*)(void *))(_func_), \ + (void *)(_arg_), (struct lwp **)&(_handle_), _name_) #define RF_CREATE_ENGINE_THREAD(_handle_, _func_, _arg_, _fmt_, _fmt_arg_) \ - kthread_create1((void (*)(void *))(_func_), (void *)(_arg_), \ - (struct proc **)&(_handle_), _fmt_, _fmt_arg_) + kthread_create(PRI_NONE, 0, NULL, (void (*)(void *))(_func_), \ + (void *)(_arg_), (struct lwp **)&(_handle_), _fmt_, _fmt_arg_) #define rf_mutex_init(m) simple_lock_init(m) diff --git a/sys/dev/rcons/rcons_kern.c b/sys/dev/rcons/rcons_kern.c index 5c0476ad158..e0cf034b6a9 100644 --- a/sys/dev/rcons/rcons_kern.c +++ b/sys/dev/rcons/rcons_kern.c @@ -1,4 +1,4 @@ -/* $NetBSD: rcons_kern.c,v 1.18 2007/03/04 06:02:39 christos Exp $ */ +/* $NetBSD: rcons_kern.c,v 1.19 2007/07/09 21:01:20 ad Exp $ */ /* * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rcons_kern.c,v 1.18 2007/03/04 06:02:39 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rcons_kern.c,v 1.19 2007/07/09 21:01:20 ad Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -177,7 +177,7 @@ rcons_init(rc, clear) { mydevicep = rc; - callout_init(&rc->rc_belltmr_ch); + callout_init(&rc->rc_belltmr_ch, 0); /* Initialize operations set, clear screen and turn cursor on */ rcons_init_ops(rc); diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 0722ef0b4d9..f98f845f088 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.c,v 1.62 2007/03/12 18:18:30 ad Exp $ */ +/* $NetBSD: rnd.c,v 1.63 2007/07/09 21:00:29 ad Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.62 2007/03/12 18:18:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.63 2007/07/09 21:00:29 ad Exp $"); #include <sys/param.h> #include <sys/ioctl.h> @@ -154,7 +154,7 @@ static rndsource_t rnd_source_no_collect = { NULL }; -struct callout rnd_callout = CALLOUT_INITIALIZER; +struct callout rnd_callout; void rndattach(int); @@ -311,6 +311,8 @@ rnd_init(void) if (rnd_ready) return; + callout_init(&rnd_callout, 0); + /* * take a counter early, hoping that there's some variance in * the following operations diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index 337d3aeb654..cebc0e3f33a 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $NetBSD: be.c,v 1.52 2007/03/04 07:54:11 christos Exp $ */ +/* $NetBSD: be.c,v 1.53 2007/07/09 21:01:20 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.52 2007/03/04 07:54:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.53 2007/07/09 21:01:20 ad Exp $"); #include "opt_ddb.h" #include "opt_inet.h" @@ -369,7 +369,7 @@ beattach(parent, self, aux) ifmedia_init(&mii->mii_media, 0, be_ifmedia_upd, be_ifmedia_sts); - callout_init(&sc->sc_tick_ch); + callout_init(&sc->sc_tick_ch, 0); /* * Initialize transceiver and determine which PHY connection to use. diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 96569663a87..d64d4d06d93 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $NetBSD: magma.c,v 1.40 2007/03/04 22:12:44 mrg Exp $ */ +/* $NetBSD: magma.c,v 1.41 2007/07/09 21:01:21 ad Exp $ */ /* * magma.c * @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.40 2007/03/04 22:12:44 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.41 2007/07/09 21:01:21 ad Exp $"); #if 0 #define MAGMA_DEBUG @@ -1482,8 +1482,8 @@ mbpp_attach(parent, dev, args) for( port = 0 ; port < sc->ms_board->mb_npar ; port++ ) { mp = &ms->ms_port[port]; - callout_init(&mp->mp_timeout_ch); - callout_init(&mp->mp_start_ch); + callout_init(&mp->mp_timeout_ch, 0); + callout_init(&mp->mp_start_ch, 0); if( sc->ms_ncd1190 ) mp->mp_cd1190 = &sc->ms_cd1190[port]; diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c index e0bbb013ad9..0e4bab4a749 100644 --- a/sys/dev/sbus/stp4020.c +++ b/sys/dev/sbus/stp4020.c @@ -1,4 +1,4 @@ -/* $NetBSD: stp4020.c,v 1.49 2006/12/11 11:42:48 jdc Exp $ */ +/* $NetBSD: stp4020.c,v 1.50 2007/07/09 21:01:21 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: stp4020.c,v 1.49 2006/12/11 11:42:48 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: stp4020.c,v 1.50 2007/07/09 21:01:21 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -127,7 +127,7 @@ struct stp4020_softc { struct sbusdev sc_sd; /* SBus device */ pcmcia_chipset_tag_t sc_pct; /* Chipset methods */ - struct proc *event_thread; /* event handling thread */ + struct lwp *event_thread; /* event handling thread */ SIMPLEQ_HEAD(, stp4020_event) events; /* Pending events for thread */ struct stp4020_socket sc_socks[STP4020_NSOCK]; @@ -156,7 +156,6 @@ static void stp4020_wr_winctl(struct stp4020_socket *, int, int, int); void stp4020_delay(struct stp4020_softc *sc, unsigned int); void stp4020_attach_socket(struct stp4020_socket *, int); -void stp4020_create_event_thread(void *); void stp4020_event_thread(void *); void stp4020_queue_event(struct stp4020_softc *, int, int); @@ -470,12 +469,7 @@ stp4020attach(parent, self, aux) sc->sc_pct = (pcmcia_chipset_tag_t)&stp4020_functions; - /* - * Arrange that a kernel thread be created to handle - * insert/removal events. - */ SIMPLEQ_INIT(&sc->events); - kthread_create(stp4020_create_event_thread, sc); for (i = 0; i < STP4020_NSOCK; i++) { struct stp4020_socket *h = &sc->sc_socks[i]; @@ -487,6 +481,15 @@ stp4020attach(parent, self, aux) #endif stp4020_attach_socket(h, sa->sa_frequency); } + + /* + * Arrange that a kernel thread be created to handle + * insert/removal events. + */ + if (kthread_create(PRI_NONE, 0, NULL, stp4020_event_thread, sc, + &sc->event_thread, "%s", self->dv_xname)) { + panic("%s: unable to create event thread", self->dv_xname); + } } void @@ -555,23 +558,6 @@ stp4020_attach_socket(h, speed) h->flags |= STP4020_SOCKET_BUSY; } - -/* - * Deferred thread creation callback. - */ -void -stp4020_create_event_thread(arg) - void *arg; -{ - struct stp4020_softc *sc = arg; - const char *name = sc->sc_dev.dv_xname; - - if (kthread_create1(stp4020_event_thread, sc, &sc->event_thread, - "%s", name)) { - panic("%s: unable to create event thread", name); - } -} - /* * The actual event handling thread. */ diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c index e5b1dfb5558..a17e8528163 100644 --- a/sys/dev/scsipi/cd.c +++ b/sys/dev/scsipi/cd.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.264 2007/06/30 22:16:38 dsl Exp $ */ +/* $NetBSD: cd.c,v 1.265 2007/07/09 21:01:21 ad Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004, 2005 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.264 2007/06/30 22:16:38 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.265 2007/07/09 21:01:21 ad Exp $"); #include "rnd.h" @@ -250,7 +250,7 @@ cdattach(struct device *parent, struct device *self, void *aux) bufq_alloc(&cd->buf_queue, "disksort", BUFQ_SORT_RAWBLOCK); - callout_init(&cd->sc_callout); + callout_init(&cd->sc_callout, 0); /* * Store information needed to contact our base driver diff --git a/sys/dev/scsipi/if_se.c b/sys/dev/scsipi/if_se.c index f758d7a68a6..3b00fc9935c 100644 --- a/sys/dev/scsipi/if_se.c +++ b/sys/dev/scsipi/if_se.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_se.c,v 1.65 2007/03/04 15:17:20 yamt Exp $ */ +/* $NetBSD: if_se.c,v 1.66 2007/07/09 21:01:21 ad Exp $ */ /* * Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au> @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.65 2007/03/04 15:17:20 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.66 2007/07/09 21:01:21 ad Exp $"); #include "opt_inet.h" #include "opt_atalk.h" @@ -311,8 +311,8 @@ seattach(parent, self, aux) printf("\n"); SC_DEBUG(periph, SCSIPI_DB2, ("seattach: ")); - callout_init(&sc->sc_ifstart_ch); - callout_init(&sc->sc_recv_ch); + callout_init(&sc->sc_ifstart_ch, 0); + callout_init(&sc->sc_recv_ch, 0); /* diff --git a/sys/dev/scsipi/scsipi_base.c b/sys/dev/scsipi/scsipi_base.c index fcbb4cbdae9..12d3b895dc3 100644 --- a/sys/dev/scsipi/scsipi_base.c +++ b/sys/dev/scsipi/scsipi_base.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsipi_base.c,v 1.144 2007/03/12 18:18:31 ad Exp $ */ +/* $NetBSD: scsipi_base.c,v 1.145 2007/07/09 21:01:21 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.144 2007/03/12 18:18:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.145 2007/07/09 21:01:21 ad Exp $"); #include "opt_scsi.h" @@ -119,6 +119,7 @@ scsipi_init(void) int scsipi_channel_init(struct scsipi_channel *chan) { + struct scsipi_adapter *adapt = chan->chan_adapter; int i; /* Initialize shared data. */ @@ -134,7 +135,14 @@ scsipi_channel_init(struct scsipi_channel *chan) /* * Create the asynchronous completion thread. */ - kthread_create(scsipi_create_completion_thread, chan); + if (kthread_create(PRI_NONE, 0, NULL, scsipi_completion_thread, chan, + &chan->chan_thread, "%s", chan->chan_name)) { + printf("%s: unable to create completion thread for " + "channel %d\n", adapt->adapt_dev->dv_xname, + chan->chan_channel); + panic("scsipi_channel_init"); + } + return (0); } @@ -469,7 +477,7 @@ scsipi_get_xs(struct scsipi_periph *periph, int flags) if (xs != NULL) { memset(xs, 0, sizeof(*xs)); - callout_init(&xs->xs_callout); + callout_init(&xs->xs_callout, 0); xs->xs_periph = periph; xs->xs_control = flags; xs->xs_status = 0; @@ -1874,7 +1882,7 @@ scsipi_execute_xs(struct scsipi_xfer *xs) * process must NOT be swapped out, as the device will * be accessing the stack. */ - PHOLD(curlwp); + uvm_lwp_hold(curlwp); } xs->xs_status &= ~XS_STS_DONE; @@ -2021,7 +2029,7 @@ scsipi_execute_xs(struct scsipi_xfer *xs) */ free_xs: if (xs->xs_control & XS_CTL_DATA_ONSTACK) - PRELE(curlwp); + uvm_lwp_rele(curlwp); s = splbio(); scsipi_put_xs(xs); @@ -2121,27 +2129,6 @@ scsipi_completion_thread(void *arg) kthread_exit(0); } - -/* - * scsipi_create_completion_thread: - * - * Callback to actually create the completion thread. - */ -void -scsipi_create_completion_thread(void *arg) -{ - struct scsipi_channel *chan = arg; - struct scsipi_adapter *adapt = chan->chan_adapter; - - if (kthread_create1(scsipi_completion_thread, chan, - &chan->chan_thread, "%s", chan->chan_name)) { - printf("%s: unable to create completion thread for " - "channel %d\n", adapt->adapt_dev->dv_xname, - chan->chan_channel); - panic("scsipi_create_completion_thread"); - } -} - /* * scsipi_thread_call_callback: * diff --git a/sys/dev/scsipi/scsipiconf.c b/sys/dev/scsipi/scsipiconf.c index 1a62518146a..a3217cc4181 100644 --- a/sys/dev/scsipi/scsipiconf.c +++ b/sys/dev/scsipi/scsipiconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsipiconf.c,v 1.34 2005/12/11 12:23:50 christos Exp $ */ +/* $NetBSD: scsipiconf.c,v 1.35 2007/07/09 21:01:22 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scsipiconf.c,v 1.34 2005/12/11 12:23:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsipiconf.c,v 1.35 2007/07/09 21:01:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -110,7 +110,7 @@ scsipi_alloc_periph(int malloc_flag) periph->periph_freetags[i] = 0xffffffff; TAILQ_INIT(&periph->periph_xferq); - callout_init(&periph->periph_callout); + callout_init(&periph->periph_callout, 0); return periph; } diff --git a/sys/dev/scsipi/scsipiconf.h b/sys/dev/scsipi/scsipiconf.h index 4a70c85d9e6..b44b8533eb8 100644 --- a/sys/dev/scsipi/scsipiconf.h +++ b/sys/dev/scsipi/scsipiconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: scsipiconf.h,v 1.109 2007/03/04 06:02:43 christos Exp $ */ +/* $NetBSD: scsipiconf.h,v 1.110 2007/07/09 21:01:22 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2004 The NetBSD Foundation, Inc. @@ -283,7 +283,7 @@ struct scsipi_channel { int chan_defquirks; /* default device's quirks */ - struct proc *chan_thread; /* completion thread */ + struct lwp *chan_thread; /* completion thread */ int chan_tflags; /* flags for the completion thread */ int chan_qfreeze; /* freeze count for queue */ @@ -388,7 +388,7 @@ struct scsipi_periph { /* Pending scsipi_xfers on this peripherial. */ struct scsipi_xfer_queue periph_xferq; - struct callout periph_callout; + callout_t periph_callout; /* xfer which has a pending CHECK_CONDITION */ struct scsipi_xfer *periph_xscheck; @@ -498,9 +498,9 @@ typedef enum { struct scsipi_xfer { TAILQ_ENTRY(scsipi_xfer) channel_q; /* entry on channel queue */ TAILQ_ENTRY(scsipi_xfer) device_q; /* device's pending xfers */ - struct callout xs_callout; /* callout for adapter use */ + callout_t xs_callout; /* callout for adapter use */ int xs_control; /* control flags */ - volatile int xs_status; /* status flags */ + volatile int xs_status; /* status flags */ struct scsipi_periph *xs_periph;/* peripherial doing the xfer */ int xs_retries; /* the number of times to retry */ int xs_requeuecnt; /* number of requeues */ diff --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c index 4874f834b04..03b13ae13ff 100644 --- a/sys/dev/scsipi/sd.c +++ b/sys/dev/scsipi/sd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.261 2007/03/04 06:02:43 christos Exp $ */ +/* $NetBSD: sd.c,v 1.262 2007/07/09 21:01:22 ad Exp $ */ /*- * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.261 2007/03/04 06:02:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.262 2007/07/09 21:01:22 ad Exp $"); #include "opt_scsi.h" #include "rnd.h" @@ -240,7 +240,7 @@ sdattach(struct device *parent, struct device *self, void *aux) bufq_alloc(&sd->buf_queue, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK); - callout_init(&sd->sc_callout); + callout_init(&sd->sc_callout, 0); /* * Store information needed to contact our base driver diff --git a/sys/dev/scsipi/sdvar.h b/sys/dev/scsipi/sdvar.h index 059fb647f20..8d9b14ce7ed 100644 --- a/sys/dev/scsipi/sdvar.h +++ b/sys/dev/scsipi/sdvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: sdvar.h,v 1.28 2005/12/11 12:23:51 christos Exp $ */ +/* $NetBSD: sdvar.h,v 1.29 2007/07/09 21:01:22 ad Exp $ */ /*- * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -94,7 +94,7 @@ struct sd_softc { } params; struct bufq_state *buf_queue; - struct callout sc_callout; + callout_t sc_callout; u_int8_t type; char name[16]; /* product name, for default disklabel */ diff --git a/sys/dev/scsipi/ss.c b/sys/dev/scsipi/ss.c index 95d6b37665c..f8c173aaf33 100644 --- a/sys/dev/scsipi/ss.c +++ b/sys/dev/scsipi/ss.c @@ -1,4 +1,4 @@ -/* $NetBSD: ss.c,v 1.70 2007/03/04 06:02:44 christos Exp $ */ +/* $NetBSD: ss.c,v 1.71 2007/07/09 21:01:22 ad Exp $ */ /* * Copyright (c) 1995 Kenneth Stailey. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ss.c,v 1.70 2007/03/04 06:02:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ss.c,v 1.71 2007/07/09 21:01:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -166,7 +166,7 @@ ssattach(struct device *parent, struct device *self, void *aux) */ bufq_alloc(&ss->buf_queue, "fcfs", 0); - callout_init(&ss->sc_callout); + callout_init(&ss->sc_callout, 0); /* * look for non-standard scanners with help of the quirk table diff --git a/sys/dev/scsipi/st.c b/sys/dev/scsipi/st.c index a5ff220bc0f..35d0ed9f3e2 100644 --- a/sys/dev/scsipi/st.c +++ b/sys/dev/scsipi/st.c @@ -1,4 +1,4 @@ -/* $NetBSD: st.c,v 1.196 2007/03/04 06:02:44 christos Exp $ */ +/* $NetBSD: st.c,v 1.197 2007/07/09 21:01:22 ad Exp $ */ /*- * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.196 2007/03/04 06:02:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.197 2007/07/09 21:01:22 ad Exp $"); #include "opt_scsi.h" @@ -382,7 +382,7 @@ stattach(struct device *parent, struct st_softc *st, void *aux) */ bufq_alloc(&st->buf_queue, "fcfs", 0); - callout_init(&st->sc_callout); + callout_init(&st->sc_callout, 0); /* * Check if the drive is a known criminal and take diff --git a/sys/dev/sequencer.c b/sys/dev/sequencer.c index 2405abb75a1..70e782f8fc0 100644 --- a/sys/dev/sequencer.c +++ b/sys/dev/sequencer.c @@ -1,4 +1,4 @@ -/* $NetBSD: sequencer.c,v 1.40 2007/03/04 06:01:43 christos Exp $ */ +/* $NetBSD: sequencer.c,v 1.41 2007/07/09 21:00:29 ad Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.40 2007/03/04 06:01:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.41 2007/07/09 21:00:29 ad Exp $"); #include "sequencer.h" @@ -147,7 +147,7 @@ sequencerattach(int n) for (n = 0; n < NSEQUENCER; n++) { sc = &seqdevs[n]; - callout_init(&sc->sc_callout); + callout_init(&sc->sc_callout, 0); sc->sih = softintr_establish(IPL_SOFTSERIAL, seq_softintr, sc); } } @@ -1169,19 +1169,23 @@ static struct midi_dev * midiseq_open(int unit, int flags) { extern struct cfdriver midi_cd; - extern const struct cdevsw midi_cdevsw; int error; struct midi_dev *md; struct midi_softc *sc; struct midi_info mi; + int major; + dev_t dev; + + major = devsw_name2blk("midi", NULL, 0); + dev = makedev(major, unit); - midi_getinfo(makedev(0, unit), &mi); + midi_getinfo(dev, &mi); if ( !(mi.props & MIDI_PROP_CAN_INPUT) ) flags &= ~FREAD; if ( 0 == ( flags & ( FREAD | FWRITE ) ) ) return 0; DPRINTFN(2, ("midiseq_open: %d %d\n", unit, flags)); - error = (*midi_cdevsw.d_open)(makedev(0, unit), flags, 0, 0); + error = cdev_open(dev, flags, 0, 0); if (error) return (0); sc = midi_cd.cd_devs[unit]; @@ -1202,10 +1206,14 @@ midiseq_open(int unit, int flags) static void midiseq_close(struct midi_dev *md) { - extern const struct cdevsw midi_cdevsw; + int major; + dev_t dev; + + major = devsw_name2blk("midi", NULL, 0); + dev = makedev(major, md->unit); DPRINTFN(2, ("midiseq_close: %d\n", md->unit)); - (*midi_cdevsw.d_close)(makedev(0, md->unit), 0, 0, 0); + cdev_close(dev, 0, 0, 0); free(md, M_DEVBUF); } diff --git a/sys/dev/spi/spiflash.c b/sys/dev/spi/spiflash.c index 4c36b50224e..cb893ebaa0e 100644 --- a/sys/dev/spi/spiflash.c +++ b/sys/dev/spi/spiflash.c @@ -1,4 +1,4 @@ -/* $NetBSD: spiflash.c,v 1.3 2007/03/04 06:02:44 christos Exp $ */ +/* $NetBSD: spiflash.c,v 1.4 2007/07/09 21:01:23 ad Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.3 2007/03/04 06:02:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spiflash.c,v 1.4 2007/07/09 21:01:23 ad Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -119,7 +119,6 @@ STATIC void spiflash_process_done(spiflash_handle_t, int); STATIC void spiflash_process_read(spiflash_handle_t); STATIC void spiflash_process_write(spiflash_handle_t); STATIC void spiflash_thread(void *); -STATIC void spiflash_thread_create(void *); STATIC int spiflash_nsectors(spiflash_handle_t, struct buf *); STATIC int spiflash_nsectors(spiflash_handle_t, struct buf *); STATIC int spiflash_sector(spiflash_handle_t, struct buf *); @@ -149,7 +148,7 @@ const struct bdevsw spiflash_bdevsw = { .d_ioctl = spiflash_ioctl, .d_dump = nodump, .d_psize = nosize, - .d_type = D_DISK, + .d_flag = D_DISK, }; const struct cdevsw spiflash_cdevsw = { @@ -163,7 +162,7 @@ const struct cdevsw spiflash_cdevsw = { .d_poll = nopoll, .d_mmap = nommap, .d_kqfilter = nokqfilter, - .d_type = D_DISK, + .d_flag = D_DISK, }; static struct dkdriver spiflash_dkdriver = { spiflash_strategy, NULL }; @@ -232,13 +231,14 @@ spiflash_attach(struct device *parent, struct device *self, void *aux) bufq_alloc(&sc->sc_workq, "fcfs", BUFQ_SORT_RAWBLOCK); bufq_alloc(&sc->sc_doneq, "fcfs", BUFQ_SORT_RAWBLOCK); - /* arrange to allocate the kthread */ - kthread_create(spiflash_thread_create, sc); - sc->sc_dk.dk_driver = &spiflash_dkdriver; sc->sc_dk.dk_name = sc->sc_dev.dv_xname; disk_attach(&sc->sc_dk); + + /* arrange to allocate the kthread */ + kthread_create(PRI_NONE, 0, NULL, spiflash_thread, arg, + &sc->sc_thread, "spiflash"); } int @@ -563,16 +563,6 @@ spiflash_thread(void *arg) spiflash_process_write(sc); } } - -void -spiflash_thread_create(void *arg) -{ - spiflash_handle_t sc = arg; - - kthread_create1(spiflash_thread, arg, &sc->sc_thread, - "spiflash_thread"); -} - /* * SPI flash common implementation. */ diff --git a/sys/dev/sun/kbd.c b/sys/dev/sun/kbd.c index 0515c12709e..d9efba0701f 100644 --- a/sys/dev/sun/kbd.c +++ b/sys/dev/sun/kbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kbd.c,v 1.58 2007/03/04 06:02:45 christos Exp $ */ +/* $NetBSD: kbd.c,v 1.59 2007/07/09 21:01:23 ad Exp $ */ /* * Copyright (c) 1992, 1993 @@ -47,7 +47,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.58 2007/03/04 06:02:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.59 2007/07/09 21:01:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -543,7 +543,7 @@ kbd_cc_open(struct cons_channel *cc) /* XXX: verify that callout is not active? */ k->k_repeat_start = hz/2; k->k_repeat_step = hz/20; - callout_init(&k->k_repeat_ch); + callout_init(&k->k_repeat_ch, 0); return (ret); } @@ -1035,7 +1035,7 @@ kbd_enable(struct device *dev) /* Attach the wskbd */ k->k_wskbd = config_found(&k->k_dev, &a, wskbddevprint); - callout_init(&k->k_wsbell); + callout_init(&k->k_wsbell, 0); wssunkbd_enable(k,1); diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c index e8945350c1d..ecab40aa310 100644 --- a/sys/dev/sun/sunkbd.c +++ b/sys/dev/sun/sunkbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunkbd.c,v 1.24 2006/03/30 16:12:10 thorpej Exp $ */ +/* $NetBSD: sunkbd.c,v 1.25 2007/07/09 21:01:23 ad Exp $ */ /* * Copyright (c) 1992, 1993 @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.24 2006/03/30 16:12:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.25 2007/07/09 21:01:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -220,15 +220,10 @@ sunkbdiopen(dev, flags) struct tty *tp = (struct tty *)k->k_priv; struct lwp *l = curlwp ? curlwp : &lwp0; struct termios t; - const struct cdevsw *cdev; int error; - cdev = cdevsw_lookup(tp->t_dev); - if (cdev == NULL) - return (ENXIO); - /* Open the lower device */ - if ((error = (*cdev->d_open)(tp->t_dev, O_NONBLOCK|flags, + if ((error = cdev_open(tp->t_dev, O_NONBLOCK|flags, 0/* ignored? */, l)) != 0) return (error); diff --git a/sys/dev/sun/sunms.c b/sys/dev/sun/sunms.c index 3f9b3a04532..2dab460ef19 100644 --- a/sys/dev/sun/sunms.c +++ b/sys/dev/sun/sunms.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunms.c,v 1.26 2007/03/04 06:02:45 christos Exp $ */ +/* $NetBSD: sunms.c,v 1.27 2007/07/09 21:01:23 ad Exp $ */ /* * Copyright (c) 1992, 1993 @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.26 2007/03/04 06:02:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.27 2007/07/09 21:01:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -200,15 +200,10 @@ sunmsiopen(dev, flags) struct tty *tp = (struct tty *)ms->ms_cs; struct lwp *l = curlwp ? curlwp : &lwp0; struct termios t; - const struct cdevsw *cdev; int error; - cdev = cdevsw_lookup(tp->t_dev); - if (cdev == NULL) - return (ENXIO); - /* Open the lower device */ - if ((error = (*cdev->d_open)(tp->t_dev, O_NONBLOCK|flags, + if ((error = cdev_open(tp->t_dev, O_NONBLOCK|flags, 0/* ignored? */, l)) != 0) return (error); diff --git a/sys/dev/sysmon/swwdog.c b/sys/dev/sysmon/swwdog.c index d1722e370ea..c12991e2de5 100644 --- a/sys/dev/sysmon/swwdog.c +++ b/sys/dev/sysmon/swwdog.c @@ -1,4 +1,4 @@ -/* $NetBSD: swwdog.c,v 1.6 2007/01/29 01:52:45 hubertf Exp $ */ +/* $NetBSD: swwdog.c,v 1.7 2007/07/09 21:01:23 ad Exp $ */ /* * Copyright (c) 2004, 2005 Steven M. Bellovin @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.6 2007/01/29 01:52:45 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.7 2007/07/09 21:01:23 ad Exp $"); /* * @@ -87,7 +87,7 @@ swwdogattach(int count __unused) sc->sc_smw.smw_setmode = swwdog_setmode; sc->sc_smw.smw_tickle = swwdog_tickle; sc->sc_smw.smw_period = SWDOG_DEFAULT; - callout_init(&sc->sc_c); + callout_init(&sc->sc_c, 0); callout_setfunc(&sc->sc_c, swwdog_panic, sc); if (sysmon_wdog_register(&sc->sc_smw) == 0) diff --git a/sys/dev/sysmon/sysmon_envsys_events.c b/sys/dev/sysmon/sysmon_envsys_events.c index 0543c93ea5e..42f19db4cea 100644 --- a/sys/dev/sysmon/sysmon_envsys_events.c +++ b/sys/dev/sysmon/sysmon_envsys_events.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsys_events.c,v 1.5 2007/07/04 17:48:16 xtraeme Exp $ */ +/* $NetBSD: sysmon_envsys_events.c,v 1.6 2007/07/09 21:01:23 ad Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.5 2007/07/04 17:48:16 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.6 2007/07/09 21:01:23 ad Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -425,7 +425,7 @@ sme_events_init(void) if (error) goto out; - callout_init(&seeco); + callout_init(&seeco, 0); callout_setfunc(&seeco, sme_events_check, NULL); callout_schedule(&seeco, SME_EVTIMO); sme_events_initialized = true; diff --git a/sys/dev/sysmon/sysmon_taskq.c b/sys/dev/sysmon/sysmon_taskq.c index 49d1c989037..47db7b037c7 100644 --- a/sys/dev/sysmon/sysmon_taskq.c +++ b/sys/dev/sysmon/sysmon_taskq.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_taskq.c,v 1.8 2007/06/27 13:04:15 xtraeme Exp $ */ +/* $NetBSD: sysmon_taskq.c,v 1.9 2007/07/09 21:01:24 ad Exp $ */ /* * Copyright (c) 2001, 2003 Wasabi Systems, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_taskq.c,v 1.8 2007/06/27 13:04:15 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_taskq.c,v 1.9 2007/07/09 21:01:24 ad Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -78,9 +78,8 @@ do { \ static int sysmon_task_queue_cleanup_sem; -static struct proc *sysmon_task_queue_proc; +static struct lwp *sysmon_task_queue_lwp; -static void sysmon_task_queue_create_thread(void *); static void sysmon_task_queue_thread(void *); static struct simplelock sysmon_task_queue_initialized_slock = @@ -95,6 +94,7 @@ static int sysmon_task_queue_initialized; void sysmon_task_queue_init(void) { + int error; simple_lock(&sysmon_task_queue_initialized_slock); if (sysmon_task_queue_initialized) { @@ -105,7 +105,13 @@ sysmon_task_queue_init(void) sysmon_task_queue_initialized = 1; simple_unlock(&sysmon_task_queue_initialized_slock); - kthread_create(sysmon_task_queue_create_thread, NULL); + error = kthread_create(PRI_NONE, 0, NULL, sysmon_task_queue_thread, + NULL, &sysmon_task_queue_lwp, "sysmon"); + if (error) { + printf("Unable to create sysmon task queue thread, " + "error = %d\n", error); + panic("sysmon_task_queue_init"); + } } /* @@ -132,25 +138,6 @@ sysmon_task_queue_fini(void) } /* - * sysmon_task_queue_create_thread: - * - * Create the sysmon task queue execution thread. - */ -static void -sysmon_task_queue_create_thread(void *arg) -{ - int error; - - error = kthread_create1(sysmon_task_queue_thread, NULL, - &sysmon_task_queue_proc, "sysmon"); - if (error) { - printf("Unable to create sysmon task queue thread, " - "error = %d\n", error); - panic("sysmon_task_queue_create_thread"); - } -} - -/* * sysmon_task_queue_thread: * * The sysmon task queue execution thread. We execute callbacks that @@ -204,7 +191,7 @@ sysmon_task_queue_sched(u_int pri, void (*func)(void *), void *arg) struct sysmon_task *st, *lst; int s; - if (sysmon_task_queue_proc == NULL) + if (sysmon_task_queue_lwp == NULL) aprint_debug("WARNING: Callback scheduled before sysmon " "task queue thread present\n"); diff --git a/sys/dev/sysmon/sysmon_wdog.c b/sys/dev/sysmon/sysmon_wdog.c index 47faea1e3b6..15bb0190199 100644 --- a/sys/dev/sysmon/sysmon_wdog.c +++ b/sys/dev/sysmon/sysmon_wdog.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_wdog.c,v 1.18 2007/03/04 06:02:45 christos Exp $ */ +/* $NetBSD: sysmon_wdog.c,v 1.19 2007/07/09 21:01:24 ad Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.18 2007/03/04 06:02:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.19 2007/07/09 21:01:24 ad Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -62,7 +62,7 @@ struct simplelock sysmon_wdog_list_slock = SIMPLELOCK_INITIALIZER; struct simplelock sysmon_wdog_slock = SIMPLELOCK_INITIALIZER; struct sysmon_wdog *sysmon_armed_wdog; -struct callout sysmon_wdog_callout = CALLOUT_INITIALIZER; +callout_t sysmon_wdog_callout; void *sysmon_wdog_sdhook; #define SYSMON_WDOG_LOCK(s) \ @@ -100,6 +100,7 @@ sysmonopen_wdog(dev_t dev, int flag, int mode, if (sysmon_wdog_sdhook == NULL) printf("WARNING: unable to register watchdog " "shutdown hook\n"); + callout_init(&sysmon_wdog_callout, 0); } simple_unlock(&sysmon_wdog_list_slock); diff --git a/sys/dev/tc/stic.c b/sys/dev/tc/stic.c index 28f1d4402ea..d24317509cc 100644 --- a/sys/dev/tc/stic.c +++ b/sys/dev/tc/stic.c @@ -1,4 +1,4 @@ -/* $NetBSD: stic.c,v 1.39 2007/03/04 15:55:29 yamt Exp $ */ +/* $NetBSD: stic.c,v 1.40 2007/07/09 21:01:24 ad Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.39 2007/03/04 15:55:29 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.40 2007/07/09 21:01:24 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -444,7 +444,7 @@ stic_attach(struct device *self, struct stic_info *si, int console) } else si->si_unit = -1; - callout_init(&si->si_switch_callout); + callout_init(&si->si_switch_callout, 0); /* * Allocate backing for the console. We could trawl back through diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 2888d981222..bea2b2a23e1 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: usb.c,v 1.96 2007/03/04 06:02:50 christos Exp $ */ +/* $NetBSD: usb.c,v 1.97 2007/07/09 21:01:24 ad Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.96 2007/03/04 06:02:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.97 2007/07/09 21:01:24 ad Exp $"); #include "opt_compat_netbsd.h" @@ -102,14 +102,14 @@ struct usb_softc { usbd_bus_handle sc_bus; /* USB controller */ struct usbd_port sc_port; /* dummy port for root hub */ - struct proc *sc_event_thread; + struct lwp *sc_event_thread; char sc_dying; }; struct usb_taskq { TAILQ_HEAD(, usb_task) tasks; - struct proc *task_thread_proc; + struct lwp *task_thread_lwp; const char *name; int taskcreated; /* task thread exists. */ }; @@ -263,8 +263,8 @@ usb_create_event_thread(void *arg) struct usb_taskq *taskq; int i; - if (usb_kthread_create1(usb_event_thread, sc, &sc->sc_event_thread, - "%s", sc->sc_dev.dv_xname)) { + if (usb_kthread_create1(PRI_NONE, 0, NULL, usb_event_thread, sc, + &sc->sc_event_thread, "%s", sc->sc_dev.dv_xname)) { printf("%s: unable to create event thread for\n", sc->sc_dev.dv_xname); panic("usb_create_event_thread"); @@ -278,8 +278,8 @@ usb_create_event_thread(void *arg) TAILQ_INIT(&taskq->tasks); taskq->taskcreated = 1; taskq->name = taskq_names[i]; - if (usb_kthread_create1(usb_task_thread, taskq, - &taskq->task_thread_proc, taskq->name)) { + if (usb_kthread_create1(PRI_NONE, 0, NULL, usb_task_thread, + taskq, &taskq->task_thread_lwp, taskq->name)) { printf("unable to create task thread: %s\n", taskq->name); panic("usb_create_event_thread task"); } diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 9e130913efa..4700bd2a93a 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -1,5 +1,5 @@ /* $OpenBSD: usb_port.h,v 1.18 2000/09/06 22:42:10 rahnds Exp $ */ -/* $NetBSD: usb_port.h,v 1.75 2007/03/13 13:51:56 drochner Exp $ */ +/* $NetBSD: usb_port.h,v 1.76 2007/07/09 21:01:25 ad Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */ /* @@ -122,14 +122,15 @@ typedef struct device *device_ptr_t; } usb_dma_t typedef struct callout usb_callout_t; -#define usb_callout_init(h) callout_init(&(h)) +#define usb_callout_init(h) callout_init(&(h), 0) +#define usb_callout_destroy(h) callout_destroy((&h)) #define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d)) #define usb_uncallout(h, f, d) callout_stop(&(h)) #define usb_lockmgr lockmgr -#define usb_kthread_create1 kthread_create1 -#define usb_kthread_create kthread_create +#define usb_kthread_create1 kthread_create +#define usb_kthread_create(f, a) ((f)(a)) typedef struct malloc_type *usb_malloc_type; diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h index b3493b91109..d1871f57126 100644 --- a/sys/dev/usb/usbdivar.h +++ b/sys/dev/usb/usbdivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: usbdivar.h,v 1.80 2007/02/26 13:23:59 drochner Exp $ */ +/* $NetBSD: usbdivar.h,v 1.81 2007/07/09 21:01:25 ad Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */ /* @@ -126,14 +126,7 @@ struct usbd_bus { #define USBREV_2_0 4 #define USBREV_STR { "unknown", "pre 1.0", "1.0", "1.1", "2.0" } -#ifdef USB_USE_SOFTINTR -#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS void *soft; /* soft interrupt cookie */ -#else - struct callout softi; -#endif -#endif - #if defined(__NetBSD__) || defined(__OpenBSD__) bus_dma_tag_t dmatag; /* DMA tag */ #endif diff --git a/sys/dev/usb/ustir.c b/sys/dev/usb/ustir.c index 954cc46ca17..9e4cd70a8da 100644 --- a/sys/dev/usb/ustir.c +++ b/sys/dev/usb/ustir.c @@ -1,4 +1,4 @@ -/* $NetBSD: ustir.c,v 1.19 2007/03/13 13:51:57 drochner Exp $ */ +/* $NetBSD: ustir.c,v 1.20 2007/07/09 21:01:25 ad Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.19 2007/03/13 13:51:57 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.20 2007/07/09 21:01:25 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -176,7 +176,7 @@ struct ustir_softc { u_int sc_rd_expectdataticks; u_char sc_rd_err; struct framestate sc_framestate; - struct proc *sc_thread; + struct lwp *sc_thread; struct selinfo sc_rd_sel; u_int8_t *sc_wr_buf; @@ -923,13 +923,16 @@ ustir_open(void *h, int flag, int mode, deframe_init(&sc->sc_framestate, &framedef_sir, sc->sc_ur_buf, IRDA_MAX_FRAME_SIZE); - error = kthread_create1(ustir_thread, sc, &sc->sc_thread, "%s", - sc->sc_dev.dv_xname); - if (error) - goto bad5; /* Increment reference for thread */ sc->sc_refcnt++; + error = kthread_create(PRI_NONE, 0, NULL, ustir_thread, sc, + &sc->sc_thread, "%s", sc->sc_dev.dv_xname); + if (error) { + sc->sc_refcnt--; + goto bad5; + } + return 0; bad5: diff --git a/sys/dev/verified_exec.c b/sys/dev/verified_exec.c index f3d371702df..337f6db7327 100644 --- a/sys/dev/verified_exec.c +++ b/sys/dev/verified_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: verified_exec.c,v 1.60 2007/05/15 19:47:45 elad Exp $ */ +/* $NetBSD: verified_exec.c,v 1.61 2007/07/09 21:00:29 ad Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat <elad@NetBSD.org> @@ -30,9 +30,9 @@ #include <sys/cdefs.h> #if defined(__NetBSD__) -__KERNEL_RCSID(0, "$NetBSD: verified_exec.c,v 1.60 2007/05/15 19:47:45 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: verified_exec.c,v 1.61 2007/07/09 21:00:29 ad Exp $"); #else -__RCSID("$Id: verified_exec.c,v 1.60 2007/05/15 19:47:45 elad Exp $\n$NetBSD: verified_exec.c,v 1.60 2007/05/15 19:47:45 elad Exp $"); +__RCSID("$Id: verified_exec.c,v 1.61 2007/07/09 21:00:29 ad Exp $\n$NetBSD: verified_exec.c,v 1.61 2007/07/09 21:00:29 ad Exp $"); #endif #include <sys/param.h> @@ -44,6 +44,7 @@ __RCSID("$Id: verified_exec.c,v 1.60 2007/05/15 19:47:45 elad Exp $\n$NetBSD: ve #include <sys/verified_exec.h> #include <sys/kauth.h> #include <sys/syslog.h> +#include <sys/proc.h> #ifdef __FreeBSD__ #include <sys/kernel.h> diff --git a/sys/dev/vme/xd.c b/sys/dev/vme/xd.c index 20d117d3d57..396fa1d9e4d 100644 --- a/sys/dev/vme/xd.c +++ b/sys/dev/vme/xd.c @@ -1,4 +1,4 @@ -/* $NetBSD: xd.c,v 1.67 2007/03/04 22:12:44 mrg Exp $ */ +/* $NetBSD: xd.c,v 1.68 2007/07/09 21:01:25 ad Exp $ */ /* * @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.67 2007/03/04 22:12:44 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.68 2007/07/09 21:01:25 ad Exp $"); #undef XDC_DEBUG /* full debug */ #define XDC_DIAG /* extra sanity checks */ @@ -636,7 +636,7 @@ xdcattach(parent, self, aux) /* init queue of waiting bufs */ bufq_alloc(&xdc->sc_wq, "fcfs", 0); - callout_init(&xdc->sc_tick_ch); + callout_init(&xdc->sc_tick_ch, 0); /* * section 7 of the manual tells us how to init the controller: diff --git a/sys/dev/vme/xy.c b/sys/dev/vme/xy.c index 606aeb09aea..357ec7f5152 100644 --- a/sys/dev/vme/xy.c +++ b/sys/dev/vme/xy.c @@ -1,4 +1,4 @@ -/* $NetBSD: xy.c,v 1.70 2007/03/04 22:12:44 mrg Exp $ */ +/* $NetBSD: xy.c,v 1.71 2007/07/09 21:01:26 ad Exp $ */ /* * @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.70 2007/03/04 22:12:44 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.71 2007/07/09 21:01:26 ad Exp $"); #undef XYC_DEBUG /* full debug */ #undef XYC_DIAG /* extra sanity checks */ @@ -576,7 +576,7 @@ xycattach(parent, self, aux) evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, xyc->sc_dev.dv_xname, "intr"); - callout_init(&xyc->sc_tick_ch); + callout_init(&xyc->sc_tick_ch, 0); /* now we must look for disks using autoconfig */ xa.fullmode = XY_SUB_POLL; diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index f2126b7a119..dc6371306e9 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: vnd.c,v 1.167 2007/04/07 15:07:26 hannken Exp $ */ +/* $NetBSD: vnd.c,v 1.168 2007/07/09 21:00:29 ad Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -137,7 +137,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.167 2007/04/07 15:07:26 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.168 2007/07/09 21:00:29 ad Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -1177,8 +1177,8 @@ vndioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) vnd->sc_flags |= VNF_INITED; /* create the kernel thread, wait for it to be up */ - error = kthread_create1(vndthread, vnd, &vnd->sc_kthread, - vnd->sc_dev.dv_xname); + error = kthread_create(PRI_NONE, 0, NULL, vndthread, vnd, + &vnd->sc_kthread, vnd->sc_dev.dv_xname); if (error) goto close_and_exit; while ((vnd->sc_flags & VNF_KTHREAD) == 0) { diff --git a/sys/dev/vndvar.h b/sys/dev/vndvar.h index a61c3041cf3..7b869c13d43 100644 --- a/sys/dev/vndvar.h +++ b/sys/dev/vndvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: vndvar.h,v 1.20 2006/05/14 21:42:26 elad Exp $ */ +/* $NetBSD: vndvar.h,v 1.21 2007/07/09 21:00:30 ad Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -160,7 +160,7 @@ struct vnd_softc { struct vndgeom sc_geom; /* virtual geometry */ struct pool sc_vxpool; /* vndxfer pool */ struct pool sc_vbpool; /* vndbuf pool */ - struct proc *sc_kthread; /* kernel thread */ + struct lwp *sc_kthread; /* kernel thread */ u_int32_t sc_comp_blksz; /* precompressed block size */ u_int32_t sc_comp_numoffs;/* count of compressed block offsets */ u_int64_t *sc_comp_offsets;/* file idx's to compressed blocks */ diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c index 31aa44fe7af..781d520b323 100644 --- a/sys/dev/wscons/wsdisplay_compat_usl.c +++ b/sys/dev/wscons/wsdisplay_compat_usl.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_compat_usl.c,v 1.40 2007/03/04 06:02:51 christos Exp $ */ +/* $NetBSD: wsdisplay_compat_usl.c,v 1.41 2007/07/09 21:01:26 ad Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.40 2007/03/04 06:02:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.41 2007/07/09 21:01:26 ad Exp $"); #include "opt_compat_freebsd.h" #include "opt_compat_netbsd.h" @@ -61,8 +61,8 @@ struct usl_syncdata { int s_frsig; /* unused */ void (*s_callback)(void *, int, int); void *s_cbarg; - struct callout s_attach_ch; - struct callout s_detach_ch; + callout_t s_attach_ch; + callout_t s_detach_ch; }; static int usl_sync_init(struct wsscreen *, struct usl_syncdata **, @@ -109,8 +109,8 @@ usl_sync_init(struct wsscreen *scr, struct usl_syncdata **sdp, sd->s_acqsig = acqsig; sd->s_relsig = relsig; sd->s_frsig = frsig; - callout_init(&sd->s_attach_ch); - callout_init(&sd->s_detach_ch); + callout_init(&sd->s_attach_ch, 0); + callout_init(&sd->s_detach_ch, 0); res = wsscreen_attach_sync(scr, &usl_syncops, sd); if (res) { free(sd, M_DEVBUF); diff --git a/sys/dev/wscons/wsdisplay_vcons.c b/sys/dev/wscons/wsdisplay_vcons.c index 1fbc584598f..5c1ff236826 100644 --- a/sys/dev/wscons/wsdisplay_vcons.c +++ b/sys/dev/wscons/wsdisplay_vcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.10 2007/03/04 06:02:51 christos Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.11 2007/07/09 21:01:26 ad Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.10 2007/03/04 06:02:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.11 2007/07/09 21:01:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -122,7 +122,7 @@ vcons_init(struct vcons_data *vd, void *cookie, struct wsscreen_descr *def, vd->active = NULL; vd->wanted = NULL; vd->currenttype = def; - callout_init(&vd->switch_callout); + callout_init(&vd->switch_callout, 0); /* * a lock to serialize access to the framebuffer. diff --git a/sys/dev/wscons/wsdisplay_vconsvar.h b/sys/dev/wscons/wsdisplay_vconsvar.h index 8832baa215e..faaa88619c6 100644 --- a/sys/dev/wscons/wsdisplay_vconsvar.h +++ b/sys/dev/wscons/wsdisplay_vconsvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vconsvar.h,v 1.6 2007/03/04 06:02:51 christos Exp $ */ +/* $NetBSD: wsdisplay_vconsvar.h,v 1.7 2007/07/09 21:01:26 ad Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -100,7 +100,7 @@ struct vcons_data { /* virtual screen management stuff */ void (*switch_cb)(void *, int, int); void *switch_cb_arg; - struct callout switch_callout; + callout_t switch_callout; uint32_t switch_pending; LIST_HEAD(, vcons_screen) screens; struct vcons_screen *active, *wanted; diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index ce9ba09de08..826a5145e0a 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wskbd.c,v 1.103 2007/04/04 14:50:21 mishka Exp $ */ +/* $NetBSD: wskbd.c,v 1.104 2007/07/09 21:01:26 ad Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.103 2007/04/04 14:50:21 mishka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.104 2007/07/09 21:01:26 ad Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -166,7 +166,7 @@ struct wskbd_softc { #endif int sc_repeating; /* we've called timeout() */ - struct callout sc_repeat_ch; + callout_t sc_repeat_ch; u_int sc_repeat_type; int sc_repeat_value; @@ -414,7 +414,7 @@ wskbd_attach(struct device *parent, struct device *self, void *aux) wskbd_update_layout(sc->id, ap->keymap->layout); } - callout_init(&sc->sc_repeat_ch); + callout_init(&sc->sc_repeat_ch, 0); sc->id->t_sc = sc; diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c index 51991a834f4..fd7e54d6b99 100644 --- a/sys/dev/wscons/wsmouse.c +++ b/sys/dev/wscons/wsmouse.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsmouse.c,v 1.51 2007/03/04 06:02:52 christos Exp $ */ +/* $NetBSD: wsmouse.c,v 1.52 2007/07/09 21:01:26 ad Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -111,7 +111,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.51 2007/03/04 06:02:52 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.52 2007/07/09 21:01:26 ad Exp $"); #include "wsmouse.h" #include "wsdisplay.h" @@ -173,7 +173,7 @@ struct wsmouse_softc { struct wsmouse_repeat sc_repeat; int sc_repeat_button; - struct callout sc_repeat_callout; + callout_t sc_repeat_callout; unsigned int sc_repeat_delay; }; @@ -255,7 +255,7 @@ wsmouse_attach(struct device *parent, struct device *self, void *aux) memset(&sc->sc_repeat, 0, sizeof(sc->sc_repeat)); sc->sc_repeat_button = -1; sc->sc_repeat_delay = 0; - callout_init(&sc->sc_repeat_callout); + callout_init(&sc->sc_repeat_callout, 0); #if NWSMUX > 0 sc->sc_base.me_ops = &wsmouse_srcops; |
