-/* $OpenBSD: kern_clock.c,v 1.118 2023/09/14 20:58:51 cheloha Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.119 2023/09/14 22:27:09 cheloha Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
/* Don't force early wrap around, triggers bug in inteldrm */
volatile unsigned long jiffies;
+uint32_t hardclock_period; /* [I] hardclock period (ns) */
uint32_t statclock_avg; /* [I] average statclock period (ns) */
uint32_t statclock_min; /* [I] minimum statclock period (ns) */
uint32_t statclock_mask; /* [I] set of allowed offsets */
*/
cpu_initclocks();
+ KASSERT(hz > 0 && hz <= 1000000000);
+ hardclock_period = 1000000000 / hz;
+ roundrobin_period = hardclock_period * 10;
+
KASSERT(stathz >= 1 && stathz <= 1000000000);
/*
-/* $OpenBSD: kern_clockintr.c,v 1.51 2023/09/14 22:07:11 cheloha Exp $ */
+/* $OpenBSD: kern_clockintr.c,v 1.52 2023/09/14 22:27:09 cheloha Exp $ */
/*
* Copyright (c) 2003 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
* I Immutable after initialization.
*/
uint32_t clockintr_flags; /* [I] global state + behavior flags */
-uint32_t hardclock_period; /* [I] hardclock period (ns) */
void clockintr_hardclock(struct clockintr *, void *, void *);
void clockintr_schedule(struct clockintr *, uint64_t);
KASSERT(clockintr_flags == 0);
KASSERT(!ISSET(flags, ~CL_FLAG_MASK));
- KASSERT(hz > 0 && hz <= 1000000000);
- hardclock_period = 1000000000 / hz;
- roundrobin_period = hardclock_period * 10;
-
SET(clockintr_flags, flags | CL_INIT);
}