[email protected] (Mouse) writes:

>How heavily is hztoms used?  (I would expect mstohz to be used far more
>heavily.)

sys/dev/acpi/acpi_cpu_cstate.c:   sc->sc_cstate_sleep = 
hztoms(acpitimer_delta(end, start)) * 1000;
sys/dev/spkr_audio.c:     audiobell(sc->sc_audiodev, xhz, hztoms(ticks), 
sc->sc_spkr.sc_vol, 0);
sys/dev/i2c/tsllux.c:     if (ms < hztoms(1)) {
sys/dev/ic/mvsata.c:      timeout = mstohz(timeout + hztoms(1) - 1);
sys/dev/ic/mvsata.c:              ata_delay(chp, hztoms(1), "mvsata_edma2", 
wflags);
sys/dev/pci/ixgbe/ixgbe_netbsd.c: else if ((us / 1000) >= hztoms(1)) {
sys/dev/sdmmc/if_bwfm_sdio.c:     sdmmc_pause(hztoms(1)*1000, NULL);
sys/dev/usb/if_axe.c:     usbd_delay_ms(sc->axe_un.un_udev, hztoms(y));         
  \
sys/dev/usb/if_axe.c:             usbd_delay_ms(un->un_udev, hztoms(hz / 32));
sys/dev/usb/if_axe.c:             usbd_delay_ms(un->un_udev, hztoms(hz / 32));
sys/dev/usb/if_axe.c:     usbd_delay_ms(un->un_udev, hztoms(hz / 32));
sys/dev/usb/if_axe.c:     usbd_delay_ms(un->un_udev, hztoms(hz / 32));
sys/external/bsd/drm2/include/linux/jiffies.h:    return hztoms(j);
sys/external/bsd/drm2/include/linux/sched.h:                      unsigned ms = 
hztoms(MIN((unsigned long)timeout,
sys/kern/sched_4bsd.c:    int rttsms = hztoms(sched_rrticks);
sys/kern/sched_m2.c:      int rttsms = hztoms(sched_rrticks);
sys/kern/sched_m2.c:      newsize = hztoms(min_ts);
sys/kern/sched_m2.c:      newsize = hztoms(max_ts);


>> 0 can sometimes mean "never block" and sometimes can mean "block
>> forever".

>What does hztoms's return value get used for?  Is it actually used to
>compute delay values?  It sounds dodgy to me to do so, for this among
>other reasons.

Mostly to compute a delay.

Either direction mstohz or hztoms should better always round up to
guarantee a minimal delay.

Reply via email to