-/* $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>
/* 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__);
}
}
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)
-/* $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>
*
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__);
-/* $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 $ */
/*-
/* 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;
-/* $OpenBSD: clockintr.h,v 1.10 2023/08/21 17:22:04 cheloha Exp $ */
+/* $OpenBSD: clockintr.h,v 1.11 2023/09/06 02:09:58 cheloha Exp $ */
/*
* Copyright (c) 2020-2022 Scott Cheloha <cheloha@openbsd.org>
*
uint64_t clockintr_advance(struct clockintr *, uint64_t);
void clockintr_cancel(struct clockintr *);
-struct clockintr *clockintr_establish(struct clockintr_queue *,
+struct clockintr *clockintr_establish(struct cpu_info *,
void (*)(struct clockintr *, void *));
void clockintr_stagger(struct clockintr *, uint64_t, u_int, u_int);
void clockqueue_init(struct clockintr_queue *);