diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2023-09-06 02:09:59 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2023-09-06 02:09:59 +0000 |
commit | fd18ed0d4eb3e59ed340b6bbde46b8af1a707a66 (patch) | |
tree | 09fb8ea67d951b15ad061dc4d498fcd202f26f7c /sys/kern | |
parent | a058b6ff5a29c5d6694c24610e512e74da3f7e51 (diff) |
clockintr: clockintr_establish: change first argument to a cpu_info pointer
All CPUs control a single clockintr_queue. clockintr_establish()
callers don't need to know about the underlying clockintr_queue.
Accepting a cpu_info pointer as argument simplifies the API.
From mpi@.
ok mpi@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_clockintr.c | 9 | ||||
-rw-r--r-- | sys/kern/kern_sched.c | 8 | ||||
-rw-r--r-- | sys/kern/subr_prof.c | 5 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sys/kern/kern_clockintr.c b/sys/kern/kern_clockintr.c index b4e5901226d..40a0c5a0412 100644 --- a/sys/kern/kern_clockintr.c +++ b/sys/kern/kern_clockintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clockintr.c,v 1.36 2023/09/05 22:41:14 cheloha Exp $ */ +/* $OpenBSD: kern_clockintr.c,v 1.37 2023/09/06 02:09:58 cheloha Exp $ */ /* * Copyright (c) 2003 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org> @@ -112,12 +112,12 @@ clockintr_cpu_init(const struct intrclock *ic) /* TODO: Remove these from struct clockintr_queue. */ if (cq->cq_hardclock == NULL) { - cq->cq_hardclock = clockintr_establish(cq, clockintr_hardclock); + cq->cq_hardclock = clockintr_establish(ci, clockintr_hardclock); if (cq->cq_hardclock == NULL) panic("%s: failed to establish hardclock", __func__); } if (cq->cq_statclock == NULL) { - cq->cq_statclock = clockintr_establish(cq, clockintr_statclock); + cq->cq_statclock = clockintr_establish(ci, clockintr_statclock); if (cq->cq_statclock == NULL) panic("%s: failed to establish statclock", __func__); } @@ -403,10 +403,11 @@ clockintr_cancel_locked(struct clockintr *cl) } struct clockintr * -clockintr_establish(struct clockintr_queue *cq, +clockintr_establish(struct cpu_info *ci, void (*func)(struct clockintr *, void *)) { struct clockintr *cl; + struct clockintr_queue *cq = &ci->ci_queue; cl = malloc(sizeof *cl, M_DEVBUF, M_NOWAIT | M_ZERO); if (cl == NULL) diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 0d2deb5f47e..92b0da6ffa4 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.88 2023/08/31 19:29:51 cheloha Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.89 2023/09/06 02:09:58 cheloha Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org> * @@ -88,13 +88,13 @@ sched_init_cpu(struct cpu_info *ci) spc->spc_idleproc = NULL; - spc->spc_itimer = clockintr_establish(&ci->ci_queue, itimer_update); + spc->spc_itimer = clockintr_establish(ci, itimer_update); if (spc->spc_itimer == NULL) panic("%s: clockintr_establish itimer_update", __func__); - spc->spc_profclock = clockintr_establish(&ci->ci_queue, profclock); + spc->spc_profclock = clockintr_establish(ci, profclock); if (spc->spc_profclock == NULL) panic("%s: clockintr_establish profclock", __func__); - spc->spc_roundrobin = clockintr_establish(&ci->ci_queue, roundrobin); + spc->spc_roundrobin = clockintr_establish(ci, roundrobin); if (spc->spc_roundrobin == NULL) panic("%s: clockintr_establish roundrobin", __func__); diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c index 850e0fb3b09..10a9d9e2cac 100644 --- a/sys/kern/subr_prof.c +++ b/sys/kern/subr_prof.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_prof.c,v 1.36 2023/07/25 18:16:19 cheloha Exp $ */ +/* $OpenBSD: subr_prof.c,v 1.37 2023/09/06 02:09:58 cheloha Exp $ */ /* $NetBSD: subr_prof.c,v 1.12 1996/04/22 01:38:50 christos Exp $ */ /*- @@ -101,8 +101,7 @@ prof_init(void) /* Allocate and initialize one profiling buffer per CPU. */ CPU_INFO_FOREACH(cii, ci) { - ci->ci_gmonclock = clockintr_establish(&ci->ci_queue, - gmonclock); + ci->ci_gmonclock = clockintr_establish(ci, gmonclock); if (ci->ci_gmonclock == NULL) { printf("%s: clockintr_establish gmonclock\n", __func__); return; |