commit 8fbc264d2bc2add66aefe4f4a7966c4364da1211 Author: Matthew Dillon <dil...@apollo.backplane.com> Date: Tue Jun 9 09:08:16 2020 -0700
kernel - Refactor sysclock_t from 32 to 64 bits * Refactor the core cpu timer API, changing sysclock_t from 32 to 64 bits. Provide a full 64-bit count from all sources. * Implement muldivu64() using gcc's 128-bit integer type. This functions takes three 64-bit valus, performs (a * b) / d using a 128-bit intermediate calculation, and returns a 64-bit result. Change all timer scaling functions to use this function which effectively gives systimers the capability of handling any timeout that fits 64 bits for the timer's resolution. * Remove TSC frequency scaling, it is no longer needed. The TSC timer is now used at its full resolution. * Use atomic_fcmpset_long() instead of a clock spinlock when updating the msb bits for hardware timer sources less than 64 bits wide. * Properly recalculate existing systimers when the clock source is changed. Existing systimers were not being recalculated, leading to the system failing to boot when time sources had radically different clock frequencies. Summary of changes: sys/conf/kern.pre.mk | 4 +- sys/cpu/x86_64/misc/cputimer_tsc.c | 24 ++--- sys/dev/acpica/acpi_hpet.c | 46 +++++++++- sys/dev/acpica/acpi_timer.c | 142 +++++++++++++---------------- sys/dev/virtual/hyperv/vmbus/vmbus.c | 2 +- sys/kern/kern_clock.c | 22 +++-- sys/kern/kern_cputimer.c | 19 ++-- sys/kern/kern_nrandom.c | 2 +- sys/kern/kern_systimer.c | 78 +++++++++++++--- sys/kern/kern_time.c | 9 +- sys/kern/usched_bsd4.c | 3 +- sys/platform/pc64/apic/lapic.c | 51 ++++++----- sys/platform/pc64/isa/clock.c | 63 +++++++------ sys/platform/vkernel64/platform/systimer.c | 8 +- sys/sys/proc.h | 3 +- sys/sys/systimer.h | 34 +++---- sys/sys/systm.h | 17 ++++ 17 files changed, 306 insertions(+), 221 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8fbc264d2bc2add66aefe4f4a7966c4364da1211 -- DragonFly BSD source repository