CVSROOT: /cvs Module name: src Changes by: d...@cvs.openbsd.org 2025/06/02 18:20:31
Modified files: sys/dev/dt : dt_dev.c sys/dev/pci : if_myx.c sys/kern : kern_exit.c kern_rwlock.c kern_sched.c kern_synch.c kern_timeout.c subr_log.c sys_futex.c sys/sys : systm.h Log message: make the sleep time argument in sleep_finish nanoseconds instead of ticks this allows sleep_finish to call timeout_add_nsec to schedule when sleeping should end. pretty much everything userland asks the kernel to do around time and sleeping is in high resolution formats like msec or timevals and timespecs, which get converted to nsecs. before they were then converted to ticks for use with the timeout api. passing nanoseconds the whole way through means we can centralise the conversion of nanoseconds to ticks in the timeout code. consequently this changes the sleep functions so that instead of tsleep_nsec, msleep_nsec, and rwsleep_nsec wrapping tsleep, msleep, and rwsleep, the arrangement is reversed so tsleep, msleep, and rwsleep are now wrappers around tsleep_nsec, msleep_nsec, and rwsleep_nsec. converting ticks to nanoseconds is a simple multiplication and doesn't lose precision like it does going the other way. tested by a bunch of people ok claudio@