-/* $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)
#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>
*/
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);
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 */
-/* $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 $ */
/*-
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);
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);
}
}
}