From c737cf90c555ea2a43d15654d58c047b881e67da Mon Sep 17 00:00:00 2001 From: cheloha Date: Sun, 25 Feb 2024 19:15:50 +0000 Subject: [PATCH] clockintr: rename "struct clockintr_queue" to "struct clockqueue" The code has outgrown the original name for this struct. Both the external and internal APIs have used the "clockqueue" namespace for some time when operating on it, and that name is eyeball-consistent with "clockintr" and "clockrequest", so "clockqueue" it is. --- sys/arch/alpha/include/cpu.h | 4 +-- sys/arch/amd64/include/cpu.h | 4 +-- sys/arch/arm/include/cpu.h | 4 +-- sys/arch/arm64/include/cpu.h | 4 +-- sys/arch/hppa/include/cpu.h | 4 +-- sys/arch/i386/include/cpu.h | 4 +-- sys/arch/m88k/include/cpu.h | 4 +-- sys/arch/mips64/include/cpu.h | 4 +-- sys/arch/powerpc/include/cpu.h | 4 +-- sys/arch/powerpc64/include/cpu.h | 4 +-- sys/arch/riscv64/include/cpu.h | 4 +-- sys/arch/sh/include/cpu.h | 4 +-- sys/arch/sparc64/include/cpu.h | 4 +-- sys/kern/kern_clockintr.c | 56 ++++++++++++++++---------------- sys/sys/clockintr.h | 12 +++---- 15 files changed, 60 insertions(+), 60 deletions(-) diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h index e03cd31325b..2d182a869e2 100644 --- a/sys/arch/alpha/include/cpu.h +++ b/sys/arch/alpha/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.71 2024/01/24 19:23:38 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.72 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.45 2000/08/21 02:03:12 thorpej Exp $ */ /*- @@ -214,7 +214,7 @@ struct cpu_info { struct gmonparam *ci_gmon; struct clockintr ci_gmonclock; #endif - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; }; diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index dd0537cb164..3eea95d5614 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.162 2024/02/12 01:18:17 guenther Exp $ */ +/* $OpenBSD: cpu.h,v 1.163 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -228,7 +228,7 @@ struct cpu_info { paddr_t ci_vmcs_pa; struct rwlock ci_vmcs_lock; - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; }; #define CPUF_BSP 0x0001 /* CPU is the original BSP */ diff --git a/sys/arch/arm/include/cpu.h b/sys/arch/arm/include/cpu.h index aa02a42fc2d..1b973d3f569 100644 --- a/sys/arch/arm/include/cpu.h +++ b/sys/arch/arm/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.65 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.66 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */ /* @@ -200,7 +200,7 @@ struct cpu_info { struct gmonparam *ci_gmon; struct clockintr ci_gmonclock; #endif - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; }; diff --git a/sys/arch/arm64/include/cpu.h b/sys/arch/arm64/include/cpu.h index 937f5fa0e41..d0521a33ab3 100644 --- a/sys/arch/arm64/include/cpu.h +++ b/sys/arch/arm64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.42 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.43 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 2016 Dale Rahn * @@ -176,7 +176,7 @@ struct cpu_info { struct gmonparam *ci_gmon; struct clockintr ci_gmonclock; #endif - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; }; diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h index 092bc6e7447..47abd9cfd4f 100644 --- a/sys/arch/hppa/include/cpu.h +++ b/sys/arch/hppa/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.103 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.104 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 2000-2004 Michael Shalayeff @@ -115,7 +115,7 @@ struct cpu_info { struct gmonparam *ci_gmon; struct clockintr ci_gmonclock; #endif - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; } __attribute__((__aligned__(64))); diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 82da25e54e8..ef7db2af795 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.184 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.185 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -170,7 +170,7 @@ struct cpu_info { struct gmonparam *ci_gmon; struct clockintr ci_gmonclock; #endif - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; }; diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h index 0c0a7171998..e25e9f12ea7 100644 --- a/sys/arch/m88k/include/cpu.h +++ b/sys/arch/m88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.75 2024/02/14 12:36:35 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.76 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -179,7 +179,7 @@ struct cpu_info { struct gmonparam *ci_gmon; struct clockintr ci_gmonclock; #endif - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; }; diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index c7ea46300c1..dccd1157ab4 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.145 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.146 2024/02/25 19:15:50 cheloha Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -180,7 +180,7 @@ struct cpu_info { uint32_t ci_softpending; /* pending soft interrupts */ int ci_clock_started; volatile int ci_clock_deferred; /* clock interrupt postponed */ - struct clockintr_queue + struct clockqueue ci_queue; struct pmap *ci_curpmap; diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h index d6fd15c7027..39dbd8521fd 100644 --- a/sys/arch/powerpc/include/cpu.h +++ b/sys/arch/powerpc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.76 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.77 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */ /* @@ -73,7 +73,7 @@ struct cpu_info { #define DISISAVE_LEN 4 register_t ci_disisave[DISISAVE_LEN]; - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; volatile int ci_ddb_paused; #define CI_DDB_RUNNING 0 diff --git a/sys/arch/powerpc64/include/cpu.h b/sys/arch/powerpc64/include/cpu.h index 00f742b15af..13c67b80628 100644 --- a/sys/arch/powerpc64/include/cpu.h +++ b/sys/arch/powerpc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.35 2023/08/23 01:55:47 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.36 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -72,7 +72,7 @@ struct cpu_info { register_t ci_tempsave[CPUSAVE_LEN]; register_t ci_idle_sp_save; - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; volatile int ci_cpl; volatile int ci_dec_deferred; diff --git a/sys/arch/riscv64/include/cpu.h b/sys/arch/riscv64/include/cpu.h index be8f96cc38a..8488d5feb31 100644 --- a/sys/arch/riscv64/include/cpu.h +++ b/sys/arch/riscv64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.21 2024/01/27 12:05:40 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.22 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 2019 Mike Larkin @@ -90,7 +90,7 @@ struct cpu_info { struct pcb *ci_curpcb; struct pcb *ci_idle_pcb; - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; volatile int ci_timer_deferred; uint32_t ci_cpl; diff --git a/sys/arch/sh/include/cpu.h b/sys/arch/sh/include/cpu.h index 1d3ec9a33ea..80122977ad8 100644 --- a/sys/arch/sh/include/cpu.h +++ b/sys/arch/sh/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.36 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.37 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */ /*- @@ -73,7 +73,7 @@ struct cpu_info { int ci_want_resched; - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; char ci_panicbuf[512]; }; diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index 212e27e1436..07e5962f394 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.103 2024/01/24 19:23:39 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.104 2024/02/25 19:15:50 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -130,7 +130,7 @@ struct cpu_info { int ci_want_resched; int ci_handled_intr_level; void *ci_intrpending[16][8]; - struct clockintr_queue ci_queue; + struct clockqueue ci_queue; struct intrhand ci_tickintr; volatile int ci_ddb_paused; diff --git a/sys/kern/kern_clockintr.c b/sys/kern/kern_clockintr.c index aff6ba79ee6..d28c5da47a5 100644 --- a/sys/kern/kern_clockintr.c +++ b/sys/kern/kern_clockintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clockintr.c,v 1.69 2024/02/25 18:17:11 cheloha Exp $ */ +/* $OpenBSD: kern_clockintr.c,v 1.70 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 2003 Dale Rahn * Copyright (c) 2020 Mark Kettenis @@ -34,12 +34,12 @@ void clockintr_cancel_locked(struct clockintr *); void clockintr_hardclock(struct clockrequest *, void *, void *); void clockintr_schedule_locked(struct clockintr *, uint64_t); -void clockqueue_intrclock_install(struct clockintr_queue *, +void clockqueue_intrclock_install(struct clockqueue *, const struct intrclock *); -void clockqueue_intrclock_reprogram(struct clockintr_queue *); -uint64_t clockqueue_next(const struct clockintr_queue *); -void clockqueue_pend_delete(struct clockintr_queue *, struct clockintr *); -void clockqueue_pend_insert(struct clockintr_queue *, struct clockintr *, +void clockqueue_intrclock_reprogram(struct clockqueue *); +uint64_t clockqueue_next(const struct clockqueue *); +void clockqueue_pend_delete(struct clockqueue *, struct clockintr *); +void clockqueue_pend_insert(struct clockqueue *, struct clockintr *, uint64_t); void intrclock_rearm(struct intrclock *, uint64_t); void intrclock_trigger(struct intrclock *); @@ -55,14 +55,14 @@ clockintr_cpu_init(const struct intrclock *ic) { uint64_t multiplier = 0; struct cpu_info *ci = curcpu(); - struct clockintr_queue *cq = &ci->ci_queue; + struct clockqueue *cq = &ci->ci_queue; struct schedstate_percpu *spc = &ci->ci_schedstate; int reset_cq_intrclock = 0; if (ic != NULL) clockqueue_intrclock_install(cq, ic); - /* TODO: Remove this from struct clockintr_queue. */ + /* TODO: Remove this from struct clockqueue. */ if (CPU_IS_PRIMARY(ci) && cq->cq_hardclock.cl_expiration == 0) { clockintr_bind(&cq->cq_hardclock, ci, clockintr_hardclock, NULL); @@ -141,7 +141,7 @@ clockintr_cpu_init(const struct intrclock *ic) void clockintr_trigger(void) { - struct clockintr_queue *cq = &curcpu()->ci_queue; + struct clockqueue *cq = &curcpu()->ci_queue; KASSERT(ISSET(cq->cq_flags, CQ_INIT)); @@ -158,7 +158,7 @@ clockintr_dispatch(void *frame) uint64_t lateness, run = 0, start; struct cpu_info *ci = curcpu(); struct clockintr *cl; - struct clockintr_queue *cq = &ci->ci_queue; + struct clockqueue *cq = &ci->ci_queue; struct clockrequest *request = &cq->cq_request; void *arg; void (*func)(struct clockrequest *, void *, void *); @@ -272,7 +272,7 @@ uint64_t clockintr_advance(struct clockintr *cl, uint64_t period) { uint64_t count, expiration; - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; mtx_enter(&cq->cq_mtx); expiration = cl->cl_expiration; @@ -286,7 +286,7 @@ clockintr_advance(struct clockintr *cl, uint64_t period) uint64_t clockrequest_advance(struct clockrequest *cr, uint64_t period) { - struct clockintr_queue *cq = cr->cr_queue; + struct clockqueue *cq = cr->cr_queue; KASSERT(cr == &cq->cq_request); @@ -299,7 +299,7 @@ clockrequest_advance_random(struct clockrequest *cr, uint64_t min, uint32_t mask) { uint64_t count = 0; - struct clockintr_queue *cq = cr->cr_queue; + struct clockqueue *cq = cr->cr_queue; uint32_t off; KASSERT(cr == &cq->cq_request); @@ -317,7 +317,7 @@ clockrequest_advance_random(struct clockrequest *cr, uint64_t min, void clockintr_cancel(struct clockintr *cl) { - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; mtx_enter(&cq->cq_mtx); clockintr_cancel_locked(cl); @@ -327,7 +327,7 @@ clockintr_cancel(struct clockintr *cl) void clockintr_cancel_locked(struct clockintr *cl) { - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; int was_next; MUTEX_ASSERT_LOCKED(&cq->cq_mtx); @@ -350,7 +350,7 @@ void clockintr_bind(struct clockintr *cl, struct cpu_info *ci, void (*func)(struct clockrequest *, void *, void *), void *arg) { - struct clockintr_queue *cq = &ci->ci_queue; + struct clockqueue *cq = &ci->ci_queue; splassert(IPL_NONE); KASSERT(cl->cl_queue == NULL); @@ -366,7 +366,7 @@ clockintr_bind(struct clockintr *cl, struct cpu_info *ci, void clockintr_unbind(struct clockintr *cl, uint32_t flags) { - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; KASSERT(!ISSET(flags, ~CL_FLAG_MASK)); @@ -390,7 +390,7 @@ clockintr_unbind(struct clockintr *cl, uint32_t flags) void clockintr_schedule(struct clockintr *cl, uint64_t expiration) { - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; mtx_enter(&cq->cq_mtx); clockintr_schedule_locked(cl, expiration); @@ -400,7 +400,7 @@ clockintr_schedule(struct clockintr *cl, uint64_t expiration) void clockintr_schedule_locked(struct clockintr *cl, uint64_t expiration) { - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; MUTEX_ASSERT_LOCKED(&cq->cq_mtx); @@ -421,7 +421,7 @@ void clockintr_stagger(struct clockintr *cl, uint64_t period, uint32_t numer, uint32_t denom) { - struct clockintr_queue *cq = cl->cl_queue; + struct clockqueue *cq = cl->cl_queue; KASSERT(numer < denom); @@ -443,7 +443,7 @@ clockintr_hardclock(struct clockrequest *cr, void *frame, void *arg) } void -clockqueue_init(struct clockintr_queue *cq) +clockqueue_init(struct clockqueue *cq) { if (ISSET(cq->cq_flags, CQ_INIT)) return; @@ -457,7 +457,7 @@ clockqueue_init(struct clockintr_queue *cq) } void -clockqueue_intrclock_install(struct clockintr_queue *cq, +clockqueue_intrclock_install(struct clockqueue *cq, const struct intrclock *ic) { mtx_enter(&cq->cq_mtx); @@ -469,14 +469,14 @@ clockqueue_intrclock_install(struct clockintr_queue *cq, } uint64_t -clockqueue_next(const struct clockintr_queue *cq) +clockqueue_next(const struct clockqueue *cq) { MUTEX_ASSERT_LOCKED(&cq->cq_mtx); return TAILQ_FIRST(&cq->cq_pend)->cl_expiration; } void -clockqueue_pend_delete(struct clockintr_queue *cq, struct clockintr *cl) +clockqueue_pend_delete(struct clockqueue *cq, struct clockintr *cl) { MUTEX_ASSERT_LOCKED(&cq->cq_mtx); KASSERT(ISSET(cl->cl_flags, CLST_PENDING)); @@ -486,7 +486,7 @@ clockqueue_pend_delete(struct clockintr_queue *cq, struct clockintr *cl) } void -clockqueue_pend_insert(struct clockintr_queue *cq, struct clockintr *cl, +clockqueue_pend_insert(struct clockqueue *cq, struct clockintr *cl, uint64_t expiration) { struct clockintr *elm; @@ -507,7 +507,7 @@ clockqueue_pend_insert(struct clockintr_queue *cq, struct clockintr *cl, } void -clockqueue_intrclock_reprogram(struct clockintr_queue *cq) +clockqueue_intrclock_reprogram(struct clockqueue *cq) { uint64_t exp, now; @@ -564,7 +564,7 @@ sysctl_clockintr(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { struct clockintr_stat sum, tmp; - struct clockintr_queue *cq; + struct clockqueue *cq; struct cpu_info *ci; CPU_INFO_ITERATOR cii; uint32_t gen; @@ -636,7 +636,7 @@ void db_show_clockintr_cpu(struct cpu_info *ci) { struct clockintr *elm; - struct clockintr_queue *cq = &ci->ci_queue; + struct clockqueue *cq = &ci->ci_queue; u_int cpu = CPU_INFO_UNIT(ci); if (cq->cq_running != NULL) diff --git a/sys/sys/clockintr.h b/sys/sys/clockintr.h index 976db0bd8c5..0ad3f14bfba 100644 --- a/sys/sys/clockintr.h +++ b/sys/sys/clockintr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: clockintr.h,v 1.28 2024/02/25 18:29:26 cheloha Exp $ */ +/* $OpenBSD: clockintr.h,v 1.29 2024/02/25 19:15:50 cheloha Exp $ */ /* * Copyright (c) 2020-2024 Scott Cheloha * @@ -35,8 +35,8 @@ struct clockintr_stat { #include #include +struct clockqueue; struct clockrequest; -struct clockintr_queue; struct cpu_info; /* @@ -63,7 +63,7 @@ struct clockintr { TAILQ_ENTRY(clockintr) cl_plink; /* [m] cq_pend glue */ void *cl_arg; /* [I] argument */ void (*cl_func)(struct clockrequest *, void*, void*); /* [I] callback */ - struct clockintr_queue *cl_queue; /* [I] parent queue */ + struct clockqueue *cl_queue; /* [I] parent queue */ uint32_t cl_flags; /* [m] CLST_* flags */ }; @@ -79,7 +79,7 @@ struct clockintr { */ struct clockrequest { uint64_t cr_expiration; /* [o] copy of dispatch time */ - struct clockintr_queue *cr_queue; /* [I] enclosing queue */ + struct clockqueue *cr_queue; /* [I] enclosing queue */ uint32_t cr_flags; /* [o] CR_* flags */ }; @@ -95,7 +95,7 @@ struct clockrequest { * m Per-queue mutex (cq_mtx). * o Owned by a single CPU. */ -struct clockintr_queue { +struct clockqueue { struct clockrequest cq_request; /* [o] callback request object */ struct mutex cq_mtx; /* [a] per-queue mutex */ uint64_t cq_uptime; /* [o] cached uptime */ @@ -136,7 +136,7 @@ void clockintr_stagger(struct clockintr *, uint64_t, uint32_t, uint32_t); void clockintr_unbind(struct clockintr *, uint32_t); uint64_t clockrequest_advance(struct clockrequest *, uint64_t); uint64_t clockrequest_advance_random(struct clockrequest *, uint64_t, uint32_t); -void clockqueue_init(struct clockintr_queue *); +void clockqueue_init(struct clockqueue *); int sysctl_clockintr(int *, u_int, void *, size_t *, void *, size_t); #endif /* _KERNEL */ -- 2.20.1