diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2023-10-17 00:04:03 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2023-10-17 00:04:03 +0000 |
commit | 19c1736b607cf07af1e272ef5638ff0d90b4faff (patch) | |
tree | c0f0b795dde45cc2bb305a24d105022be32273c4 /sys/kern/kern_time.c | |
parent | 6c8331d5f0558eccf3afb11aa60351e41724bc93 (diff) |
clockintr: move callback-specific API behaviors to "clockrequest" namespace
The API's behavior when invoked from a callback function is impossible
to document. Move the special behavior into a distinct namespace,
"clockrequest".
- Add a 'struct clockrequest'. Basically a stripped-down 'struct clockintr'
for exclusive use during clockintr_dispatch().
- In clockintr_queue, replace the "cq_shadow" clockintr with a "cq_request"
clockrequest. They serve the same purpose.
- CLST_SHADOW_PENDING -> CR_RESCHEDULE; different namespace, same meaning.
- CLST_IGNORE_SHADOW -> CLST_IGNORE_REQUEST; same meaning.
- Move shadow branch in clockintr_advance() to clockrequest_advance().
- clockintr_request_random() becomes clockrequest_advance_random().
- Delete dead shadow branches in clockintr_cancel(), clockintr_schedule().
- Callback functions now get a clockrequest pointer instead of a special
clockintr pointer: update all prototypes, callers.
No functional change intended.
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r-- | sys/kern/kern_time.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 1687ee61d14..052c6316fd4 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.166 2023/09/10 03:08:05 cheloha Exp $ */ +/* $OpenBSD: kern_time.c,v 1.167 2023/10/17 00:04:02 cheloha Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -755,7 +755,7 @@ itimerdecr(struct itimerspec *itp, const struct timespec *decrement) } void -itimer_update(struct clockintr *cl, void *cf, void *arg) +itimer_update(struct clockrequest *cr, void *cf, void *arg) { struct timespec elapsed; uint64_t nsecs; @@ -770,7 +770,7 @@ itimer_update(struct clockintr *cl, void *cf, void *arg) if (!ISSET(pr->ps_flags, PS_ITIMER)) return; - nsecs = clockintr_advance(cl, hardclock_period) * hardclock_period; + nsecs = clockrequest_advance(cr, hardclock_period) * hardclock_period; NSEC_TO_TIMESPEC(nsecs, &elapsed); mtx_enter(&itimer_mtx); |