diff options
-rw-r--r-- | sys/dev/firewire/fwohci.c | 6 | ||||
-rw-r--r-- | sys/dev/firewire/sbp.c | 2 | ||||
-rw-r--r-- | sys/dev/hptmv/entry.c | 6 | ||||
-rw-r--r-- | sys/dev/hptmv/ioctl.c | 18 | ||||
-rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 8 | ||||
-rw-r--r-- | sys/dev/ipmi/ipmi_ssif.c | 8 | ||||
-rw-r--r-- | sys/dev/pccard/pccard_cis.c | 2 | ||||
-rw-r--r-- | sys/dev/random/randomdev_soft.c | 2 | ||||
-rw-r--r-- | sys/dev/scd/scd.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/usb_subr.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/uvscom.c | 2 | ||||
-rw-r--r-- | sys/fs/smbfs/smbfs_smb.c | 2 | ||||
-rw-r--r-- | sys/geom/geom_dev.c | 6 | ||||
-rw-r--r-- | sys/geom/geom_io.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_xenix.c | 3 | ||||
-rw-r--r-- | sys/kern/sched_4bsd.c | 3 | ||||
-rw-r--r-- | sys/netncp/ncp_sock.c | 3 | ||||
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 2 | ||||
-rw-r--r-- | sys/vm/swap_pager.c | 3 |
19 files changed, 38 insertions, 44 deletions
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index bdf75e8..c3915cf 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -1280,14 +1280,13 @@ static int fwohci_itx_disable(struct firewire_comm *fc, int dmach) { struct fwohci_softc *sc = (struct fwohci_softc *)fc; - int sleepch; OWRITE(sc, OHCI_ITCTLCLR(dmach), OHCI_CNTL_DMA_RUN | OHCI_CNTL_CYCMATCH_S); OWRITE(sc, OHCI_IT_MASKCLR, 1 << dmach); OWRITE(sc, OHCI_IT_STATCLR, 1 << dmach); /* XXX we cannot free buffers until the DMA really stops */ - tsleep((void *)&sleepch, FWPRI, "fwitxd", hz); + pause("fwitxd", hz); fwohci_db_free(&sc->it[dmach]); sc->it[dmach].xferq.flag &= ~FWXFERQ_RUNNING; return 0; @@ -1297,13 +1296,12 @@ static int fwohci_irx_disable(struct firewire_comm *fc, int dmach) { struct fwohci_softc *sc = (struct fwohci_softc *)fc; - int sleepch; OWRITE(sc, OHCI_IRCTLCLR(dmach), OHCI_CNTL_DMA_RUN); OWRITE(sc, OHCI_IR_MASKCLR, 1 << dmach); OWRITE(sc, OHCI_IR_STATCLR, 1 << dmach); /* XXX we cannot free buffers until the DMA really stops */ - tsleep((void *)&sleepch, FWPRI, "fwirxd", hz); + pause("fwirxd", hz); fwohci_db_free(&sc->ir[dmach]); sc->ir[dmach].xferq.flag &= ~FWXFERQ_RUNNING; return 0; diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 07bf416..2f6dbf3 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -2114,7 +2114,7 @@ END_DEBUG sbp_logout_all(sbp); /* XXX wait for logout completion */ - tsleep(&i, FWPRI, "sbpdtc", hz/2); + pause("sbpdtc", hz/2); for (i = 0 ; i < SBP_NUM_TARGETS ; i ++) sbp_free_target(&sbp->targets[i]); diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index 0831743..bab49a8 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -2357,7 +2357,7 @@ static void hpt_worker_thread(void) #if (__FreeBSD_version < 500000) YIELD_THREAD; #else - tsleep((caddr_t)hpt_worker_thread, PPAUSE, "sched", 1); + pause("sched", 1); #endif if (SIGISMEMBER(curproc->p_siglist, SIGSTOP)) { /* abort rebuilding process. */ @@ -2391,7 +2391,7 @@ static void hpt_worker_thread(void) /* #ifdef DEBUG if (SIGISMEMBER(curproc->p_siglist, SIGSTOP)) - tsleep((caddr_t)hpt_worker_thread, PPAUSE, "hptrdy", 2*hz); + pause("hptrdy", 2*hz); #endif */ #if (__FreeBSD_version >= 500043) @@ -2399,7 +2399,7 @@ static void hpt_worker_thread(void) #else kproc_suspend_loop(curproc); #endif - tsleep((caddr_t)hpt_worker_thread, PPAUSE, "hptrdy", 2*hz); /* wait for something to do */ + pause("hptrdy", 2*hz); /* wait for something to do */ } } diff --git a/sys/dev/hptmv/ioctl.c b/sys/dev/hptmv/ioctl.c index 5c3796a..e23d521 100644 --- a/sys/dev/hptmv/ioctl.c +++ b/sys/dev/hptmv/ioctl.c @@ -206,7 +206,7 @@ lock_driver_idle(IAL_ADAPTER_T *pAdapter) #if (__FreeBSD_version < 500000) YIELD_THREAD; #else - tsleep(lock_driver_idle, PPAUSE, "switch", 1); + pause("switch", 1); #endif oldspl = lock_driver(); } @@ -421,7 +421,7 @@ int Kernel_DeviceIoControl(_VBUS_ARG unlock_driver(oldspl); while (!pArray->u.array.rf_rebuilding) { - tsleep((caddr_t)Kernel_DeviceIoControl, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*3) break; timeout ++; @@ -486,7 +486,7 @@ hpt_set_array_state(DEVICEID idArray, DWORD state) while (!pVDevice->u.array.rf_rebuilding) { - tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*20) break; timeout ++; @@ -511,7 +511,7 @@ hpt_set_array_state(DEVICEID idArray, DWORD state) while (pVDevice->u.array.rf_abort_rebuild) { - tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*20) break; timeout ++; @@ -535,7 +535,7 @@ hpt_set_array_state(DEVICEID idArray, DWORD state) while (!pVDevice->u.array.rf_verifying) { - tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*20) break; timeout ++; @@ -554,7 +554,7 @@ hpt_set_array_state(DEVICEID idArray, DWORD state) while (pVDevice->u.array.rf_abort_rebuild) { - tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*80) break; timeout ++; @@ -575,7 +575,7 @@ hpt_set_array_state(DEVICEID idArray, DWORD state) while (!pVDevice->u.array.rf_initializing) { - tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*80) break; timeout ++; @@ -594,7 +594,7 @@ hpt_set_array_state(DEVICEID idArray, DWORD state) while (pVDevice->u.array.rf_abort_rebuild) { - tsleep((caddr_t)hpt_set_array_state, PPAUSE, "pause", 1); + pause("pause", 1); if ( timeout >= hz*80) break; timeout ++; @@ -949,7 +949,7 @@ fail: #if (__FreeBSD_version < 500000) YIELD_THREAD; #else - tsleep(hpt_rebuild_data_block, PPAUSE, "switch", 1); + pause("switch", 1); #endif oldspl = lock_driver(); } diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index c61314c..626e1ee 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -571,8 +571,8 @@ pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS) * We prevent further scheduling of the PMC by marking it as in * state 'DELETED'. If the runcount of the PMC is non-zero then * this PMC is currently running on a CPU somewhere. The thread - * doing the PMCRELEASE operation waits by repeatedly doing an - * tsleep() till the runcount comes to zero. + * doing the PMCRELEASE operation waits by repeatedly doing a + * pause() till the runcount comes to zero. * */ @@ -638,7 +638,7 @@ pmc_select_cpu(int cpu) /* * Force a context switch. * - * We do this by tsleep'ing for 1 tick -- invoking mi_switch() is not + * We do this by pause'ing for 1 tick -- invoking mi_switch() is not * guaranteed to force a context switch. */ @@ -646,7 +646,7 @@ static void pmc_force_context_switch(void) { - (void) tsleep((void *) pmc_force_context_switch, 0, "pmcctx", 1); + pause("pmcctx", 1); } /* diff --git a/sys/dev/ipmi/ipmi_ssif.c b/sys/dev/ipmi/ipmi_ssif.c index 2f90b6e..78ad643 100644 --- a/sys/dev/ipmi/ipmi_ssif.c +++ b/sys/dev/ipmi/ipmi_ssif.c @@ -175,7 +175,7 @@ ssif_polled_request(struct ipmi_softc *sc, struct ipmi_request *req) smbus_release_bus(smbus, dev); /* Give the BMC 100ms to chew on the request. */ - tsleep(&error, 0, "ssifwt", hz / 10); + pause("ssifwt", hz / 10); /* Try to read the first packet. */ read_start: @@ -190,7 +190,7 @@ read_start: device_printf(dev, "SSIF: READ_START retry\n"); #endif /* Give the BMC another 10ms. */ - tsleep(&error, 0, "ssifwt", hz / 100); + pause("ssifwt", hz / 100); goto read_start; } if (error) { @@ -328,7 +328,7 @@ ssif_loop(void *arg) break; /* Wait 60 ms between retries. */ - tsleep(&ok, 0, "retry", 60 * hz / 1000); + pause("retry", 60 * hz / 1000); #ifdef SSIF_RETRY_DEBUG device_printf(sc->ipmi_dev, "SSIF: Retrying request (%d)\n", i + 1); @@ -343,7 +343,7 @@ ssif_loop(void *arg) IPMI_UNLOCK(sc); /* Enforce 10ms between requests. */ - tsleep(&ok, 0, "delay", hz / 100); + pause("delay", hz / 100); IPMI_LOCK(sc); } diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index b912a20..00a4a34 100644 --- a/sys/dev/pccard/pccard_cis.c +++ b/sys/dev/pccard/pccard_cis.c @@ -103,7 +103,7 @@ pccard_read_cis(struct pccard_softc *sc) * XXX seem to indicate that a delay is required. The old * XXX delay was 1s. This delay is .1s. */ - tsleep(&state, 0, "pccard", hz / 10); + pause("pccard", hz / 10); if (pccard_scan_cis(device_get_parent(sc->dev), sc->dev, pccard_parse_cis_tuple, &state) == -1) state.card->error++; diff --git a/sys/dev/random/randomdev_soft.c b/sys/dev/random/randomdev_soft.c index 159d6ce..5a7a6ea 100644 --- a/sys/dev/random/randomdev_soft.c +++ b/sys/dev/random/randomdev_soft.c @@ -284,7 +284,7 @@ random_kthread(void *arg __unused) /* Found nothing, so don't belabour the issue */ if (!active) - tsleep(&harvestfifo, 0, "-", hz / 10); + pause("-", hz / 10); } diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c index 136c900..0175db6 100644 --- a/sys/dev/scd/scd.c +++ b/sys/dev/scd/scd.c @@ -1293,7 +1293,7 @@ waitfor_status_bits(struct scd_softc *sc, int bits_set, int bits_clear) { break; } - tsleep(waitfor_status_bits, PZERO - 1, "waitfor", hz/10); + pause("waitfor", hz/10); } } if ((c & bits_set) == bits_set && diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 685c562..4c5d5ca 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -307,7 +307,7 @@ usb_delay_ms(usbd_bus_handle bus, u_int ms) if (bus->use_polling || cold) delay((ms+1) * 1000); else - tsleep(&ms, PRIBIO, "usbdly", (ms*hz+999)/1000 + 1); + pause("usbdly", (ms*hz+999)/1000 + 1); } /* Delay given a device handle. */ diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index 05a7614..989f1a8 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -818,7 +818,7 @@ uvscom_open(void *addr, int portno) /* unit is not ready */ for (i = UVSCOM_UNIT_WAIT; i > 0; --i) { - tsleep(&err, TTIPRI, "uvsop", hz); /* XXX */ + pause("uvsop", hz); /* XXX */ if (ISSET(sc->sc_usr, UVSCOM_USTAT_MASK)) break; } diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c index 540b60b..7ee93f6 100644 --- a/sys/fs/smbfs/smbfs_smb.c +++ b/sys/fs/smbfs/smbfs_smb.c @@ -1199,7 +1199,7 @@ smbfs_smb_trans2find2(struct smbfs_fctx *ctx) * I've didn't notice any problem, but put code * for it. */ - tsleep(&flags, PVFS, "fix95", tvtohz(&tv)); + pause("fix95", tvtohz(&tv)); } #endif } diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index c87dcdc..a9752648 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -228,7 +228,7 @@ g_dev_close(struct cdev *dev, int flags, int fmt, struct thread *td) break; if (cp->nstart == cp->nend) break; - tsleep(&i, PRIBIO, "gdevwclose", hz / 10); + pause("gdevwclose", hz / 10); i += hz / 10; } if (cp->acr == 0 && cp->acw == 0 && cp->nstart != cp->nend) { @@ -366,7 +366,7 @@ g_dev_strategy(struct bio *bp) bp2 = g_clone_bio(bp); if (bp2 != NULL) break; - tsleep(&bp, PRIBIO, "gdstrat", hz / 10); + pause("gdstrat", hz / 10); } KASSERT(bp2 != NULL, ("XXX: ENOMEM in a bad place")); bp2->bio_done = g_dev_done; @@ -416,7 +416,7 @@ g_dev_orphan(struct g_consumer *cp) /* Wait for the cows to come home */ while (cp->nstart != cp->nend) - tsleep(&dev, PRIBIO, "gdevorphan", hz / 10); + pause("gdevorphan", hz / 10); if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) g_access(cp, -cp->acr, -cp->acw, -cp->ace); diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index a074534..beb74fe 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -492,7 +492,7 @@ g_io_schedule_down(struct thread *tp __unused) g_bioq_unlock(&g_bio_run_down); if (pace > 0) { CTR1(KTR_GEOM, "g_down pacing self (pace %d)", pace); - tsleep(&error, PRIBIO, "g_down", hz/10); + pause("g_down", hz/10); pace--; } error = g_io_check(bp); diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c index 8ff5997..7759668 100644 --- a/sys/i386/ibcs2/ibcs2_xenix.c +++ b/sys/i386/ibcs2/ibcs2_xenix.c @@ -140,8 +140,7 @@ xenix_nap(struct thread *td, struct xenix_nap_args *uap) DPRINTF(("IBCS2: 'xenix nap %d ms'\n", uap->millisec)); period = (long)uap->millisec / (1000/hz); if (period) - while (tsleep(&period, PPAUSE, "nap", period) - != EWOULDBLOCK) ; + pause("nap", period); return 0; } diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 8cbbbbb..66952ec 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -473,11 +473,10 @@ XXX this is broken static void schedcpu_thread(void) { - int nowake; for (;;) { schedcpu(); - tsleep(&nowake, 0, "-", hz); + pause("-", hz); } } diff --git a/sys/netncp/ncp_sock.c b/sys/netncp/ncp_sock.c index 1e4fd9a..c470181 100644 --- a/sys/netncp/ncp_sock.c +++ b/sys/netncp/ncp_sock.c @@ -162,7 +162,6 @@ ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp) struct ncp_conn *conn = rqp->nr_conn; struct mbuf *m; int error, flags=0; - int sendwait; for (;;) { m = m_copym(top, 0, M_COPYALL, M_TRYWAIT); @@ -172,7 +171,7 @@ ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp) break; if (rqp->rexmit == 0) break; rqp->rexmit--; - tsleep(&sendwait, PWAIT, "ncprsn", conn->li.timeout * hz); + pause("ncprsn", conn->li.timeout * hz); error = ncp_chkintr(conn, td); if (error == EINTR) break; } diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index 3a31353..45e9d15 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -759,7 +759,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) } /* XXX: Is this needed ? */ - tsleep(&error, PZERO + 8, "bootpw", 10); + pause("bootpw", hz/10); /* Set netmask to 255.0.0.0 */ diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 4167c6b..a273429 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1626,7 +1626,6 @@ restart: } mtx_unlock(&swhash_mtx); if (sp->sw_used) { - int dummy; /* * Objects may be locked or paging to the device being * removed, so we will miss their pages and need to @@ -1638,7 +1637,7 @@ restart: panic("swapoff: failed to locate %d swap blocks", sp->sw_used); } - tsleep(&dummy, PVM, "swpoff", hz / 20); + pause("swpoff", hz / 20); goto full_rescan; } } |