From 689663d4654fd3a98a78c66ed99f7ed51164c771 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 16 Jan 2026 14:16:42 -0700 Subject: [PATCH] Initialize CLOCK_UPTIME for itmer events Since we move to implement Linux's CLOCK_MONOTONIC with CLOCK_UPTIME, we broke the some timer support for Linux. Fix this by initializing CLOCK_UPTIME as a posix clock so we can use in that context. PR: 292496 MFC After: 5 days Fixes: 108de784513d Sponsored by: Netflix Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54746 --- sys/kern/kern_time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 5b7485c25cd..0c16045ca61 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1183,6 +1183,7 @@ itimer_start(void *dummy __unused) NULL, NULL, itimer_init, itimer_fini, UMA_ALIGN_PTR, 0); register_posix_clock(CLOCK_REALTIME, &rt_clock); register_posix_clock(CLOCK_MONOTONIC, &rt_clock); + register_posix_clock(CLOCK_UPTIME, &rt_clock); register_posix_clock(CLOCK_TAI, &rt_clock); p31b_setcfg(CTL_P1003_1B_TIMERS, 200112L); p31b_setcfg(CTL_P1003_1B_DELAYTIMER_MAX, INT_MAX);