From 1b084eb60ddf75951c7941c72a36b1d2887a0f1e Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Sun, 11 Dec 2022 05:31:06 +0000 Subject: Use evcount_percpu() with platform interrupt counters on octeon. --- sys/arch/octeon/dev/octcit.c | 7 +++---- sys/arch/octeon/dev/octciu.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'sys/arch/octeon') 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 #include -#include #include #include #include @@ -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 #include -#include #include #include #include @@ -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) -- cgit v1.2.3