diff options
author | jhb <jhb@FreeBSD.org> | 2002-04-04 21:03:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-04-04 21:03:38 +0000 |
commit | db9aa81e239bb1c46b3b7ba560474cd954b78bf3 (patch) | |
tree | f7344c6a10fdc020dd02fe2ee1f244cb56f92bb6 /sys/dev | |
parent | 5b964d2945fa9a17daef9bc1e6dbbcb4f7154379 (diff) | |
download | FreeBSD-src-db9aa81e239bb1c46b3b7ba560474cd954b78bf3.zip FreeBSD-src-db9aa81e239bb1c46b3b7ba560474cd954b78bf3.tar.gz |
Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.
Tested on: i386, alpha, sparc64
Diffstat (limited to 'sys/dev')
42 files changed, 76 insertions, 61 deletions
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h index a4af5da..7e8e473 100644 --- a/sys/dev/aac/aacvar.h +++ b/sys/dev/aac/aacvar.h @@ -254,7 +254,7 @@ TAILQ_HEAD(aac_container_tq, aac_container); #include <sys/lock.h> #include <sys/mutex.h> typedef struct mtx aac_lock_t; -#define AAC_LOCK_INIT(l, s) mtx_init(l, s, MTX_DEF) +#define AAC_LOCK_INIT(l, s) mtx_init(l, s, NULL, MTX_DEF) #define AAC_LOCK_ACQUIRE(l) mtx_lock(l) #define AAC_LOCK_RELEASE(l) mtx_unlock(l) #else diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index e3aebc2..82bcdd0 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -144,7 +144,7 @@ acpi_task_thread_init(void) err = 0; STAILQ_INIT(&acpi_task_queue); - mtx_init(&acpi_task_mtx, "ACPI task", MTX_DEF); + mtx_init(&acpi_task_mtx, "ACPI task", NULL, MTX_DEF); for (i = 0; i < ACPI_MAX_THREADS; i++) { err = kthread_create(acpi_task_thread, NULL, &acpi_kthread_proc, diff --git a/sys/dev/acpica/Osd/OsdSynch.c b/sys/dev/acpica/Osd/OsdSynch.c index b21362a..2cd0daf 100644 --- a/sys/dev/acpica/Osd/OsdSynch.c +++ b/sys/dev/acpica/Osd/OsdSynch.c @@ -85,7 +85,7 @@ AcpiOsCreateSemaphore(UINT32 MaxUnits, UINT32 InitialUnits, ACPI_HANDLE *OutHand return_ACPI_STATUS(AE_NO_MEMORY); bzero(as, sizeof(*as)); - mtx_init(&as->as_mtx, "ACPI semaphore", MTX_DEF); + mtx_init(&as->as_mtx, "ACPI semaphore", NULL, MTX_DEF); as->as_units = InitialUnits; as->as_maxunits = MaxUnits; as->as_pendings = as->as_resetting = as->as_timeouts = 0; diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 475b6a1..4d03e00 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -234,7 +234,7 @@ acpi_identify(driver_t *driver, device_t parent) return_VOID; /* initialise the ACPI mutex */ - mtx_init(&acpi_mutex, "ACPI global lock", MTX_DEF); + mtx_init(&acpi_mutex, "ACPI global lock", NULL, MTX_DEF); /* * Start up the ACPI CA subsystem. diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 826d069..069a82b 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -377,8 +377,8 @@ an_attach(sc, unit, flags) { struct ifnet *ifp = &sc->arpcom.ac_if; - mtx_init(&sc->an_mtx, device_get_nameunit(sc->an_dev), MTX_DEF | - MTX_RECURSE); + mtx_init(&sc->an_mtx, device_get_nameunit(sc->an_dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); AN_LOCK(sc); sc->an_gone = 0; diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c index 3f7a922..7af27c2 100644 --- a/sys/dev/ar/if_ar.c +++ b/sys/dev/ar/if_ar.c @@ -336,8 +336,9 @@ ar_attach(device_t device) callout_handle_init(&sc->handle); sc->xmitq.ifq_maxlen = IFQ_MAXLEN; sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; - mtx_init(&sc->xmitq.ifq_mtx, "ar_xmitq", MTX_DEF); - mtx_init(&sc->xmitq_hipri.ifq_mtx, "ar_xmitq_hipri", MTX_DEF); + mtx_init(&sc->xmitq.ifq_mtx, "ar_xmitq", NULL, MTX_DEF); + mtx_init(&sc->xmitq_hipri.ifq_mtx, "ar_xmitq_hipri", NULL, + MTX_DEF); sc->running = 0; #endif /* NETGRAPH */ } diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index fa8cd2e..540e8a6 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1781,7 +1781,8 @@ static int dc_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct dc_softc)); - mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); DC_LOCK(sc); /* diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 7fc36ba..fbbed2c 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -360,7 +360,8 @@ fxp_attach(device_t dev) sc->dev = dev; callout_handle_init(&sc->stat_ch); sysctl_ctx_init(&sc->sysctl_ctx); - mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); s = splimp(); diff --git a/sys/dev/fxp/if_fxpvar.h b/sys/dev/fxp/if_fxpvar.h index b2ae9b2..d18ca39 100644 --- a/sys/dev/fxp/if_fxpvar.h +++ b/sys/dev/fxp/if_fxpvar.h @@ -91,7 +91,7 @@ #if __FreeBSD_version < 500000 #define FXP_LOCK(_sc) #define FXP_UNLOCK(_sc) -#define mtx_init(a, b, c) +#define mtx_init(a, b, c, d) #define mtx_destroy(a) struct mtx { int dummy; }; #else diff --git a/sys/dev/gx/if_gx.c b/sys/dev/gx/if_gx.c index 0e44a73..0ac3b71 100644 --- a/sys/dev/gx/if_gx.c +++ b/sys/dev/gx/if_gx.c @@ -245,7 +245,8 @@ gx_attach(device_t dev) gx->gx_vflags = gx_dev->version_flags; gx->gx_ipg = gx_dev->version_ipg; - mtx_init(&gx->gx_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&gx->gx_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); GX_LOCK(gx); diff --git a/sys/dev/gx/if_gxvar.h b/sys/dev/gx/if_gxvar.h index 6c5f9ab..a6f7364 100644 --- a/sys/dev/gx/if_gxvar.h +++ b/sys/dev/gx/if_gxvar.h @@ -32,7 +32,7 @@ #if __FreeBSD_version < 500000 #define GX_LOCK(gx) #define GX_UNLOCK(gx) -#define mtx_init(a, b, c) +#define mtx_init(a, b, c, d) #define mtx_destroy(a) struct mtx { int filler; }; #else diff --git a/sys/dev/ichsmb/ichsmb.c b/sys/dev/ichsmb/ichsmb.c index c310546..6c8f8f5 100644 --- a/sys/dev/ichsmb/ichsmb.c +++ b/sys/dev/ichsmb/ichsmb.c @@ -129,7 +129,7 @@ ichsmb_attach(device_t dev) } /* Create mutex */ - mtx_init(&sc->mutex, device_get_nameunit(dev), MTX_DEF); + mtx_init(&sc->mutex, device_get_nameunit(dev), "ichsmb", MTX_DEF); return (0); } diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index e53b0eb..65aa923 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -683,7 +683,7 @@ isp_pci_attach(device_t dev) "debug", &isp_debug); /* Make sure the lock is set up. */ - mtx_init(&isp->isp_osinfo.lock, "isp", MTX_DEF); + mtx_init(&isp->isp_osinfo.lock, "isp", NULL, MTX_DEF); locksetup++; #ifdef ISP_SMPLOCK diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c index 2e13f16..e9af2f6 100644 --- a/sys/dev/lmc/if_lmc.c +++ b/sys/dev/lmc/if_lmc.c @@ -1148,8 +1148,8 @@ lmc_attach(lmc_softc_t * const sc) callout_handle_init(&sc->lmc_handle); sc->lmc_xmitq.ifq_maxlen = IFQ_MAXLEN; sc->lmc_xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; - mtx_init(&sc->lmc_xmitq.ifq_mtx, "lmc_xmitq", MTX_DEF); - mtx_init(&sc->lmc_xmitq_hipri.ifq_mtx, "lmc_xmitq_hipri", MTX_DEF); + mtx_init(&sc->lmc_xmitq.ifq_mtx, "lmc_xmitq", NULL, MTX_DEF); + mtx_init(&sc->lmc_xmitq_hipri.ifq_mtx, "lmc_xmitq_hipri", NULL, MTX_DEF); sc->lmc_running = 0; /* diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 7c7667c..32b1752 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -797,7 +797,8 @@ static int nge_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct nge_softc)); - mtx_init(&sc->nge_mtx, device_get_nameunit(dev), MTX_DEF|MTX_RECURSE); + mtx_init(&sc->nge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); /* * Handle power management nonsense. diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 8b50aa9..077aa9f 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -527,7 +527,7 @@ pccbb_attach(device_t brdev) int rid; uint32_t sockbase; - mtx_init(&sc->mtx, device_get_nameunit(brdev), MTX_DEF); + mtx_init(&sc->mtx, device_get_nameunit(brdev), "pccbb", MTX_DEF); sc->chipset = pccbb_chipset(pci_get_devid(brdev), NULL); sc->dev = brdev; sc->cbdev = NULL; diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index 5a9a4a1..6510e74 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -426,7 +426,8 @@ pdq_ifattach(pdq_softc_t *sc) { struct ifnet *ifp = &sc->sc_if; - mtx_init(&sc->mtx, device_get_nameunit(sc->dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); ifp->if_softc = sc; ifp->if_init = (if_init_f_t *)pdq_ifinit; diff --git a/sys/dev/random/yarrow.c b/sys/dev/random/yarrow.c index 8ab16b2..dd79c34 100644 --- a/sys/dev/random/yarrow.c +++ b/sys/dev/random/yarrow.c @@ -139,7 +139,7 @@ random_init(void) random_state.counter[i] = 0; /* Set up a lock for the reseed process */ - mtx_init(&random_reseed_mtx, "random reseed", MTX_DEF); + mtx_init(&random_reseed_mtx, "random reseed", NULL, MTX_DEF); } void diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index 771e69e..6322a3b 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -671,7 +671,8 @@ static int sf_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct sf_softc)); - mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); SF_LOCK(sc); /* * Handle power management nonsense. diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 0c434cb..60be206 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -513,7 +513,8 @@ sioprobe(dev, xrid, rclk, noprobe) while (sio_inited != 2) if (atomic_cmpset_int(&sio_inited, 0, 1)) { - mtx_init(&sio_lock, sio_driver_name, (comconsole != -1) ? + mtx_init(&sio_lock, sio_driver_name, NULL, + (comconsole != -1) ? MTX_SPIN | MTX_QUIET : MTX_SPIN); atomic_store_rel_int(&sio_inited, 2); } diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 6c39da2..3a6cb4f 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1183,7 +1183,8 @@ static int sk_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct sk_softc)); - mtx_init(&sc->sk_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->sk_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); SK_LOCK(sc); /* diff --git a/sys/dev/sound/isa/emu8000.c b/sys/dev/sound/isa/emu8000.c index 73ac39f..2442e2b 100644 --- a/sys/dev/sound/isa/emu8000.c +++ b/sys/dev/sound/isa/emu8000.c @@ -720,7 +720,7 @@ emu_attach(device_t dev) /* Fill the softc for this unit. */ bcopy(&emu_synthinfo, &scp->synthinfo, sizeof(emu_synthinfo)); - mtx_init(&scp->mtx, "emumid", MTX_DEF); + mtx_init(&scp->mtx, "emumid", NULL, MTX_DEF); scp->devinfo = devinfo = create_mididev_info_unit(MDT_SYNTH, &emu_op_desc, &midisynth_op_desc); /* Fill the midi info. */ diff --git a/sys/dev/sound/isa/gusmidi.c b/sys/dev/sound/isa/gusmidi.c index 37c99cc..e5788d1 100644 --- a/sys/dev/sound/isa/gusmidi.c +++ b/sys/dev/sound/isa/gusmidi.c @@ -194,7 +194,7 @@ gusmidi_init(device_t dev) /* Fill the softc. */ scp->dev = dev; - mtx_init(&scp->mtx, "gusmid", MTX_DEF); + mtx_init(&scp->mtx, "gusmid", NULL, MTX_DEF); scp->devinfo = devinfo = create_mididev_info_unit(MDT_MIDI, &gusmidi_op_desc, &midisynth_op_desc); /* Fill the midi info. */ diff --git a/sys/dev/sound/isa/mpu.c b/sys/dev/sound/isa/mpu.c index f66466f..4f1f034 100644 --- a/sys/dev/sound/isa/mpu.c +++ b/sys/dev/sound/isa/mpu.c @@ -358,7 +358,7 @@ mpu_attach(device_t dev) MIDI_DEBUG(printf("mpu: attaching.\n")); - mtx_init(&scp->mtx, "mpumid", MTX_DEF); + mtx_init(&scp->mtx, "mpumid", NULL, MTX_DEF); /* Allocate the resources, switch to uart mode. */ if (mpu_allocres(scp, dev) || mpu_uartmode(scp)) { diff --git a/sys/dev/sound/isa/opl.c b/sys/dev/sound/isa/opl.c index 6ee4e96..21eb453 100644 --- a/sys/dev/sound/isa/opl.c +++ b/sys/dev/sound/isa/opl.c @@ -717,7 +717,7 @@ opl_attach(device_t dev) /* Fill the softc. */ bcopy(&opl_synthinfo, &scp->synthinfo, sizeof(opl_synthinfo)); snprintf(scp->synthinfo.name, 64, "Yamaha OPL%d FM", scp->model); - mtx_init(&scp->mtx, "oplmid", MTX_DEF); + mtx_init(&scp->mtx, "oplmid", NULL, MTX_DEF); bcopy(pv_map, scp->pv_map, sizeof(pv_map)); if (scp->model < MODEL_OPL3) { /* OPL2. */ scp->synthinfo.nr_voices = 9; diff --git a/sys/dev/sound/isa/uartsio.c b/sys/dev/sound/isa/uartsio.c index 6554247..4170aeb 100644 --- a/sys/dev/sound/isa/uartsio.c +++ b/sys/dev/sound/isa/uartsio.c @@ -243,7 +243,7 @@ uartsio_attach(device_t dev) /* Fill the softc. */ scp->dev = dev; - mtx_init(&scp->mtx, "siomid", MTX_DEF); + mtx_init(&scp->mtx, "siomid", NULL, MTX_DEF); scp->devinfo = devinfo = create_mididev_info_unit(MDT_MIDI, &uartsio_op_desc, &midisynth_op_desc); /* Fill the midi info. */ diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 8b6e2a7..07d2660 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -200,7 +200,7 @@ get_mididev_info_unit(int unit) /* XXX */ if (!midiinfo_mtx_init) { midiinfo_mtx_init = 1; - mtx_init(&midiinfo_mtx, "midinf", MTX_DEF); + mtx_init(&midiinfo_mtx, "midinf", NULL, MTX_DEF); TAILQ_INIT(&midi_info); } @@ -226,7 +226,7 @@ get_mididev_midi_unit(int unit) /* XXX */ if (!midiinfo_mtx_init) { midiinfo_mtx_init = 1; - mtx_init(&midiinfo_mtx, "midinf", MTX_DEF); + mtx_init(&midiinfo_mtx, "midinf", NULL, MTX_DEF); TAILQ_INIT(&midi_info); } @@ -252,7 +252,7 @@ get_mididev_synth_unit(int unit) /* XXX */ if (!midiinfo_mtx_init) { midiinfo_mtx_init = 1; - mtx_init(&midiinfo_mtx, "midinf", MTX_DEF); + mtx_init(&midiinfo_mtx, "midinf", NULL, MTX_DEF); TAILQ_INIT(&midi_info); } @@ -277,7 +277,7 @@ create_mididev_info_unit(int type, mididev_info *mdinf, synthdev_info *syninf) /* XXX */ if (!midiinfo_mtx_init) { midiinfo_mtx_init = 1; - mtx_init(&midiinfo_mtx, "midinf", MTX_DEF); + mtx_init(&midiinfo_mtx, "midinf", NULL, MTX_DEF); TAILQ_INIT(&midi_info); } @@ -290,9 +290,9 @@ create_mididev_info_unit(int type, mididev_info *mdinf, synthdev_info *syninf) midibuf_init(&mdnew->midi_dbuf_in); midibuf_init(&mdnew->midi_dbuf_out); midibuf_init(&mdnew->midi_dbuf_passthru); - mtx_init(&mdnew->flagqueue_mtx, "midflq", MTX_DEF); - mtx_init(&mdnew->synth.vc_mtx, "synsvc", MTX_DEF); - mtx_init(&mdnew->synth.status_mtx, "synsst", MTX_DEF); + mtx_init(&mdnew->flagqueue_mtx, "midflq", NULL, MTX_DEF); + mtx_init(&mdnew->synth.vc_mtx, "synsvc", NULL, MTX_DEF); + mtx_init(&mdnew->synth.status_mtx, "synsst", NULL, MTX_DEF); mtx_lock(&midiinfo_mtx); diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index fa9f285..5115cc9 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -303,7 +303,7 @@ seq_init(void) { SEQ_DEBUG(printf("seq: initing.\n")); - mtx_init(&seqinfo_mtx, "seqinf", MTX_DEF); + mtx_init(&seqinfo_mtx, "seqinf", NULL, MTX_DEF); TAILQ_INIT(&seq_info); seq_initunit(0); @@ -2371,7 +2371,7 @@ create_seqdev_info_unit(int unit, seqdev_info *seq) sdnew->unit = unit; midibuf_init(&sdnew->midi_dbuf_in); midibuf_init(&sdnew->midi_dbuf_out); - mtx_init(&sdnew->flagqueue_mtx, "seqflq", MTX_DEF); + mtx_init(&sdnew->flagqueue_mtx, "seqflq", NULL, MTX_DEF); cv_init(&sdnew->insync_cv, "seqins"); mtx_lock(&seqinfo_mtx); diff --git a/sys/dev/sound/midi/timer.c b/sys/dev/sound/midi/timer.c index 969153e..ba4bce0 100644 --- a/sys/dev/sound/midi/timer.c +++ b/sys/dev/sound/midi/timer.c @@ -141,7 +141,7 @@ create_timerdev_info_unit(timerdev_info *tmdinf) /* XXX */ if (!timerinfo_mtx_init) { timerinfo_mtx_init = 1; - mtx_init(&timerinfo_mtx, "tmrinf", MTX_DEF); + mtx_init(&timerinfo_mtx, "tmrinf", NULL, MTX_DEF); TAILQ_INIT(&timer_info); } @@ -150,7 +150,7 @@ create_timerdev_info_unit(timerdev_info *tmdinf) if (tmdnew == NULL) return NULL; bcopy(tmdinf, tmdnew, sizeof(timerdev_info)); - mtx_init(&tmdnew->mtx, "tmrmtx", MTX_DEF); + mtx_init(&tmdnew->mtx, "tmrmtx", NULL, MTX_DEF); mtx_lock(&timerinfo_mtx); @@ -195,7 +195,7 @@ get_timerdev_info_unit(int unit) /* XXX */ if (!timerinfo_mtx_init) { timerinfo_mtx_init = 1; - mtx_init(&timerinfo_mtx, "tmrinf", MTX_DEF); + mtx_init(&timerinfo_mtx, "tmrinf", NULL, MTX_DEF); TAILQ_INIT(&timer_info); } @@ -224,7 +224,7 @@ get_timerdev_info(void) /* XXX */ if (!timerinfo_mtx_init) { timerinfo_mtx_init = 1; - mtx_init(&timerinfo_mtx, "tmrinf", MTX_DEF); + mtx_init(&timerinfo_mtx, "tmrinf", NULL, MTX_DEF); TAILQ_INIT(&timer_info); } diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c index a0dd70c..be36048 100644 --- a/sys/dev/sound/pci/csamidi.c +++ b/sys/dev/sound/pci/csamidi.c @@ -192,7 +192,7 @@ csamidi_attach(device_t dev) /* Fill the softc. */ scp->dev = dev; - mtx_init(&scp->mtx, "csamid", MTX_DEF); + mtx_init(&scp->mtx, "csamid", NULL, MTX_DEF); scp->devinfo = devinfo = create_mididev_info_unit(MDT_MIDI, &csamidi_op_desc, &midisynth_op_desc); /* Fill the midi info. */ diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index ae94737..5ff2080 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -343,7 +343,7 @@ sndstat_prepare(struct sbuf *s) static int sndstat_init(void) { - mtx_init(&sndstat_lock, "sndstat", 0); + mtx_init(&sndstat_lock, "sndstat", NULL, 0); sndstat_dev = make_dev(&sndstat_cdevsw, SND_DEV_STATUS, UID_ROOT, GID_WHEEL, 0444, "sndstat"); return (sndstat_dev != 0)? 0 : ENXIO; diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c index 1d9958e..7d30e67 100644 --- a/sys/dev/sr/if_sr.c +++ b/sys/dev/sr/if_sr.c @@ -449,8 +449,9 @@ sr_attach(device_t device) callout_handle_init(&sc->handle); sc->xmitq.ifq_maxlen = IFQ_MAXLEN; sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; - mtx_init(&sc->xmitq.ifq_mtx, "sr_xmitq", MTX_DEF); - mtx_init(&sc->xmitq_hipri.ifq_mtx, "sr_xmitq_hipri", MTX_DEF); + mtx_init(&sc->xmitq.ifq_mtx, "sr_xmitq", NULL, MTX_DEF); + mtx_init(&sc->xmitq_hipri.ifq_mtx, "sr_xmitq_hipri", NULL, + MTX_DEF); sc->running = 0; #endif /* NETGRAPH */ } diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 7926105..17f5a00 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1454,7 +1454,8 @@ static int ti_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct ti_softc)); - mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); TI_LOCK(sc); sc->arpcom.ac_if.if_capabilities = IFCAP_HWCSUM; sc->arpcom.ac_if.if_capenable = sc->arpcom.ac_if.if_capabilities; diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index d1535ae..1ac9a67 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -218,7 +218,8 @@ txp_attach(dev) sc->sc_dev = dev; sc->sc_cold = 1; - mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF|MTX_RECURSE); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); /* * Handle power management nonsense. diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index cffc54b..0694091 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -706,8 +706,8 @@ USB_ATTACH(aue) } } - mtx_init(&sc->aue_mtx, device_get_nameunit(self), MTX_DEF | - MTX_RECURSE); + mtx_init(&sc->aue_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); AUE_LOCK(sc); /* Reset the adapter. */ diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 3a47790..6fc8010 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -491,8 +491,8 @@ USB_ATTACH(cue) } } - mtx_init(&sc->cue_mtx, device_get_nameunit(self), MTX_DEF | - MTX_RECURSE); + mtx_init(&sc->cue_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); CUE_LOCK(sc); #ifdef notdef diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index f7e1134..745581a 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -441,8 +441,8 @@ USB_ATTACH(kue) } } - mtx_init(&sc->kue_mtx, device_get_nameunit(self), MTX_DEF | - MTX_RECURSE); + mtx_init(&sc->kue_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); KUE_LOCK(sc); /* Load the firmware into the NIC. */ diff --git a/sys/dev/usb/udbp.c b/sys/dev/usb/udbp.c index 15ca63e..1c903894 100644 --- a/sys/dev/usb/udbp.c +++ b/sys/dev/usb/udbp.c @@ -368,9 +368,10 @@ USB_ATTACH(udbp) NG_NODE_SET_PRIVATE(sc->node, sc); sc->xmitq.ifq_maxlen = IFQ_MAXLEN; sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; - mtx_init(&sc->xmitq.ifq_mtx, "usb_xmitq", MTX_DEF); + mtx_init(&sc->xmitq.ifq_mtx, "usb_xmitq", NULL, + MTX_DEF); mtx_init(&sc->xmitq_hipri.ifq_mtx, - "usb_xmitq_hipri", MTX_DEF); + "usb_xmitq_hipri", NULL, MTX_DEF); } } sc->flags = NETGRAPH_INITIALISED; diff --git a/sys/dev/usb/usb_ethersubr.c b/sys/dev/usb/usb_ethersubr.c index 395ea6f..100d93a 100644 --- a/sys/dev/usb/usb_ethersubr.c +++ b/sys/dev/usb/usb_ethersubr.c @@ -122,8 +122,8 @@ void usb_register_netisr() if (mtx_inited) return; register_netisr(NETISR_USB, usbintr); - mtx_init(&usbq_tx.ifq_mtx, "usbq_tx_mtx", MTX_DEF); - mtx_init(&usbq_rx.ifq_mtx, "usbq_rx_mtx", MTX_DEF); + mtx_init(&usbq_tx.ifq_mtx, "usbq_tx_mtx", NULL, MTX_DEF); + mtx_init(&usbq_rx.ifq_mtx, "usbq_rx_mtx", NULL, MTX_DEF); mtx_inited++; return; } diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c index e1d7d0e..c3b9fd5 100644 --- a/sys/dev/vinum/vinumconfig.c +++ b/sys/dev/vinum/vinumconfig.c @@ -1415,7 +1415,7 @@ config_plex(int update) Malloc(PLEX_LOCKS * sizeof(struct rangelock)); CHECKALLOC(plex->lock, "vinum: Can't allocate lock table\n"); bzero((char *) plex->lock, PLEX_LOCKS * sizeof(struct rangelock)); - mtx_init(&plex->lockmtx, plex->name, MTX_DEF); + mtx_init(&plex->lockmtx, plex->name, "plex", MTX_DEF); } /* Note the last plex we configured */ current_plex = plexno; diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 33a6897..5c15aae 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -642,7 +642,8 @@ static int vr_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct vr_softc *)); - mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); VR_LOCK(sc); /* diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 8fc815f..7038335 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -196,7 +196,8 @@ wi_generic_attach(device_t dev) return (error); } - mtx_init(&sc->wi_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); + mtx_init(&sc->wi_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF | MTX_RECURSE); WI_LOCK(sc); /* Reset the NIC. */ |