-/* $OpenBSD: kern_clockintr.c,v 1.12 2023/04/20 00:24:11 cheloha Exp $ */
+/* $OpenBSD: kern_clockintr.c,v 1.13 2023/04/20 14:51:28 cheloha Exp $ */
/*
* Copyright (c) 2003 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
clockintr_setstatclockrate(stathz);
KASSERT(schedhz >= 0 && schedhz <= 1000000000);
- if (schedhz != 0) {
+ if (schedhz != 0)
schedclock_period = 1000000000 / schedhz;
- SET(clockintr_flags, CL_SCHEDCLOCK);
- }
SET(clockintr_flags, flags | CL_INIT);
}
offset = statclock_avg / ncpus * multiplier;
clockintr_schedule(cq->cq_statclock, offset);
clockintr_advance(cq->cq_statclock, statclock_avg);
- if (ISSET(clockintr_flags, CL_SCHEDCLOCK)) {
+ if (schedhz != 0) {
offset = schedclock_period / ncpus * multiplier;
clockintr_schedule(cq->cq_schedclock, offset);
clockintr_advance(cq->cq_schedclock, schedclock_period);
-/* $OpenBSD: clockintr.h,v 1.6 2023/04/19 14:30:35 cheloha Exp $ */
+/* $OpenBSD: clockintr.h,v 1.7 2023/04/20 14:51:28 cheloha Exp $ */
/*
* Copyright (c) 2020-2022 Scott Cheloha <cheloha@openbsd.org>
*
/* Global state flags. */
#define CL_INIT 0x00000001 /* global init done */
#define CL_STATCLOCK 0x00000002 /* statclock variables set */
-#define CL_SCHEDCLOCK 0x00000004 /* run separate schedclock */
-#define CL_STATE_MASK 0x00000007
+#define CL_STATE_MASK 0x00000003
/* Global behavior flags. */
#define CL_RNDSTAT 0x80000000 /* randomized statclock */