From 11e6c7e49469e887bd2bb071906c35300e98e6e7 Mon Sep 17 00:00:00 2001 From: jmatthew Date: Thu, 10 Nov 2022 07:08:01 +0000 Subject: [PATCH] Convert sparc64 clock event counter to per-cpu and increment using evcount_inc() rather than atomic operations. ok kettenis@ jca@ cheloha@ --- sys/arch/sparc64/sparc64/clock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c index f23a46dfb58..92c06d76ec6 100644 --- a/sys/arch/sparc64/sparc64/clock.c +++ b/sys/arch/sparc64/sparc64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.71 2021/10/24 17:05:04 mpi Exp $ */ +/* $OpenBSD: clock.c,v 1.72 2022/11/10 07:08:01 jmatthew Exp $ */ /* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */ /* @@ -603,6 +603,7 @@ cpu_initclocks(void) level0.ih_number = 1; strlcpy(level0.ih_name, "clock", sizeof(level0.ih_name)); intr_establish(10, &level0); + evcount_percpu(&level0.ih_count); /* We only have one timer so we have no statclock */ stathz = 0; @@ -758,7 +759,7 @@ tickintr(void *cap) while (ci->ci_tick < tick()) { ci->ci_tick += tick_increment; hardclock((struct clockframe *)cap); - atomic_add_long((unsigned long *)&level0.ih_count.ec_count, 1); + evcount_inc(&level0.ih_count); } /* Reset the interrupt. */ @@ -781,7 +782,7 @@ sys_tickintr(void *cap) while (ci->ci_tick < sys_tick()) { ci->ci_tick += tick_increment; hardclock((struct clockframe *)cap); - atomic_add_long((unsigned long *)&level0.ih_count.ec_count, 1); + evcount_inc(&level0.ih_count); } /* Reset the interrupt. */ @@ -804,7 +805,7 @@ stickintr(void *cap) while (ci->ci_tick < stick()) { ci->ci_tick += tick_increment; hardclock((struct clockframe *)cap); - atomic_add_long((unsigned long *)&level0.ih_count.ec_count, 1); + evcount_inc(&level0.ih_count); } /* Reset the interrupt. */ -- 2.20.1