From: visa Date: Mon, 5 Dec 2022 08:59:28 +0000 (+0000) Subject: Use evcount_percpu() with mips64 clock and ipi interrupt counters. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a5b656f8bf06ee5a19bb4e5bcb940000e16a7391;p=openbsd Use evcount_percpu() with mips64 clock and ipi interrupt counters. OK jca@ cheloha@ --- diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c index d9a9be8c9a9..6ef31ff130e 100644 --- a/sys/arch/mips64/mips64/clock.c +++ b/sys/arch/mips64/mips64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.48 2022/11/19 16:23:48 cheloha Exp $ */ +/* $OpenBSD: clock.c,v 1.49 2022/12/05 08:59:28 visa Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -100,6 +99,7 @@ clockattach(struct device *parent, struct device *self, void *aux) */ set_intr(INTPRI_CLOCK, CR_INT_5, cp0_int5); evcount_attach(&cp0_clock_count, "clock", &cp0_clock_irq); + evcount_percpu(&cp0_clock_count); /* try to avoid getting clock interrupts early */ cp0_set_compare(cp0_get_count() - 1); @@ -121,7 +121,7 @@ cp0_int5(uint32_t mask, struct trapframe *tf) struct cpu_info *ci = curcpu(); int s; - atomic_inc_long((unsigned long *)&cp0_clock_count.ec_count); + evcount_inc(&cp0_clock_count); cp0_set_compare(cp0_get_count() - 1); /* clear INT5 */ diff --git a/sys/arch/mips64/mips64/ipifuncs.c b/sys/arch/mips64/mips64/ipifuncs.c index 8f915f6a703..6268bac71ae 100644 --- a/sys/arch/mips64/mips64/ipifuncs.c +++ b/sys/arch/mips64/mips64/ipifuncs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipifuncs.c,v 1.25 2022/04/10 13:23:14 visa Exp $ */ +/* $OpenBSD: ipifuncs.c,v 1.26 2022/12/05 08:59:28 visa Exp $ */ /* $NetBSD: ipifuncs.c,v 1.40 2008/04/28 20:23:10 martin Exp $ */ /*- @@ -84,6 +84,7 @@ mips64_ipi_init(void) if (!cpuid) { mtx_init(&smp_rv_mtx, IPL_HIGH); evcount_attach(&ipi_count, "ipi", &ipi_irq); + evcount_percpu(&ipi_count); } hw_ipi_intr_clear(cpuid); @@ -113,8 +114,7 @@ mips64_ipi_intr(void *arg) for (bit = 0; bit < MIPS64_NIPIS; bit++) { if (pending_ipis & (1UL << bit)) { (*ipifuncs[bit])(); - atomic_inc_long( - (unsigned long *)&ipi_count.ec_count); + evcount_inc(&ipi_count); } } }