summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2022-12-05 08:59:29 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2022-12-05 08:59:29 +0000
commit29adffd60c4ff830062f0fc806be52c09160bc74 (patch)
treee316d10860d32a85c27e4533d9ba64ae6a47a8e3 /sys
parentff8961577bb357d87f650f10d134fb87be091402 (diff)
Use evcount_percpu() with mips64 clock and ipi interrupt counters.
OK jca@ cheloha@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/clock.c6
-rw-r--r--sys/arch/mips64/mips64/ipifuncs.c6
2 files changed, 6 insertions, 6 deletions
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 <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
-#include <sys/atomic.h>
#include <sys/clockintr.h>
#include <sys/device.h>
#include <sys/evcount.h>
@@ -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);
}
}
}