summaryrefslogtreecommitdiff
path: root/sys/arch/octeon
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2022-12-11 05:31:06 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2022-12-11 05:31:06 +0000
commit1b084eb60ddf75951c7941c72a36b1d2887a0f1e (patch)
treeb75987be76419452f4f935e7501bb91e459d023f /sys/arch/octeon
parent24238eeeaf65eb48cfdd188b94ba120d61e5e928 (diff)
Use evcount_percpu() with platform interrupt counters on octeon.
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r--sys/arch/octeon/dev/octcit.c7
-rw-r--r--sys/arch/octeon/dev/octciu.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/arch/octeon/dev/octcit.c b/sys/arch/octeon/dev/octcit.c
index 111c2b353b9..9926bd7ace9 100644
--- a/sys/arch/octeon/dev/octcit.c
+++ b/sys/arch/octeon/dev/octcit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octcit.c,v 1.13 2022/08/22 00:35:07 cheloha Exp $ */
+/* $OpenBSD: octcit.c,v 1.14 2022/12/11 05:31:05 visa Exp $ */
/*
* Copyright (c) 2017, 2019 Visa Hankala
@@ -24,7 +24,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/atomic.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/evcount.h>
@@ -281,6 +280,7 @@ octcit_intr_establish_intsn(int intsn, int level, int flags,
ih->ih_flags = flags;
ih->ih_intsn = intsn;
evcount_attach(&ih->ih_count, name, &ih->ih_intsn);
+ evcount_percpu(&ih->ih_count);
s = splhigh();
@@ -452,8 +452,7 @@ octcit_intr(uint32_t hwpend, struct trapframe *frame)
if (ret != 0) {
handled = 1;
- atomic_inc_long(
- (unsigned long *)&ih->ih_count.ec_count);
+ evcount_inc(&ih->ih_count);
}
/*
diff --git a/sys/arch/octeon/dev/octciu.c b/sys/arch/octeon/dev/octciu.c
index 8e7a5afb72e..018d3e17269 100644
--- a/sys/arch/octeon/dev/octciu.c
+++ b/sys/arch/octeon/dev/octciu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octciu.c,v 1.18 2022/08/22 00:35:07 cheloha Exp $ */
+/* $OpenBSD: octciu.c,v 1.19 2022/12/11 05:31:05 visa Exp $ */
/*
* Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se)
@@ -35,7 +35,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/atomic.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/evcount.h>
@@ -271,6 +270,7 @@ octciu_intr_establish(int irq, int level, int (*ih_fun)(void *),
ih->ih_irq = irq;
ih->ih_cpuid = cpuid;
evcount_attach(&ih->ih_count, ih_what, &ih->ih_irq);
+ evcount_percpu(&ih->ih_count);
s = splhigh();
@@ -520,8 +520,7 @@ octciu_intr_bank(struct octciu_softc *sc, struct intrbank *bank,
#endif
if ((*ih->ih_fun)(ih->ih_arg) != 0) {
handled = 1;
- atomic_inc_long(
- (unsigned long *)&ih->ih_count.ec_count);
+ evcount_inc(&ih->ih_count);
}
#ifdef MULTIPROCESSOR
if (need_lock)