diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2024-01-24 19:23:40 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2024-01-24 19:23:40 +0000 |
commit | 8cb898c555527cf989801c7e83938ec6f7e32288 (patch) | |
tree | 32acb5bd373d406406213baca20ec260702dce12 /sys/arch/arm | |
parent | 3dee2e31d0d48fb3d7aab4917b155daa51330768 (diff) |
clockintr: switch from callee- to caller-allocated clockintr structs
Currently, clockintr_establish() calls malloc(9) to allocate a
clockintr struct on behalf of the caller. mpi@ says this behavior is
incompatible with dt(4). In particular, calling malloc(9) during the
initialization of a PCB outside of dt_pcb_alloc() is (a) awkward and
(b) may conflict with future changes/optimizations to PCB allocation.
To side-step the problem, this patch changes the clockintr subsystem
to use caller-allocated clockintr structs instead of callee-allocated
structs.
clockintr_establish() is named after softintr_establish(), which uses
malloc(9) internally to create softintr objects. The clockintr subsystem
is no longer using malloc(9), so the "establish" naming is no longer apt.
To avoid confusion, this patch also renames "clockintr_establish" to
"clockintr_bind".
Requested by mpi@. Tweaked by mpi@.
Thread: https://marc.info/?l=openbsd-tech&m=170597126103504&w=2
ok claudio@ mlarkin@ mpi@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/include/cpu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/arm/include/cpu.h b/sys/arch/arm/include/cpu.h index 1ced238694e..aa02a42fc2d 100644 --- a/sys/arch/arm/include/cpu.h +++ b/sys/arch/arm/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.64 2023/08/23 01:55:46 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.65 2024/01/24 19:23:39 cheloha Exp $ */ /* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */ /* @@ -198,7 +198,7 @@ struct cpu_info { #ifdef GPROF struct gmonparam *ci_gmon; - struct clockintr *ci_gmonclock; + struct clockintr ci_gmonclock; #endif struct clockintr_queue ci_queue; char ci_panicbuf[512]; |