Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/riscv/riscv Attach the clock event counter for each...



details:   https://anonhg.NetBSD.org/src/rev/900038c6c187
branches:  trunk
changeset: 378197:900038c6c187
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Jul 26 06:13:44 2023 +0000

description:
Attach the clock event counter for each cpu^Whart.

diffstat:

 sys/arch/riscv/riscv/clock_machdep.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 4c1daa2e6a9c -r 900038c6c187 sys/arch/riscv/riscv/clock_machdep.c
--- a/sys/arch/riscv/riscv/clock_machdep.c      Wed Jul 26 03:41:57 2023 +0000
+++ b/sys/arch/riscv/riscv/clock_machdep.c      Wed Jul 26 06:13:44 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock_machdep.c,v 1.5 2023/06/12 19:04:14 skrll Exp $  */
+/*     $NetBSD: clock_machdep.c,v 1.6 2023/07/26 06:13:44 skrll Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,10 +31,11 @@
 
 #include <sys/cdefs.h>
 
-__RCSID("$NetBSD: clock_machdep.c,v 1.5 2023/06/12 19:04:14 skrll Exp $");
+__RCSID("$NetBSD: clock_machdep.c,v 1.6 2023/07/26 06:13:44 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
+#include <sys/device.h>
 #include <sys/systm.h>
 #include <sys/timetc.h>
 
@@ -90,6 +91,9 @@ riscv_timer_init(void)
 {
        struct cpu_info * const ci = curcpu();
 
+       evcnt_attach_dynamic(&ci->ci_ev_timer, EVCNT_TYPE_INTR,
+           NULL, device_xname(ci->ci_dev), "timer");
+
        ci->ci_lastintr = csr_time_read();
        uint64_t next = ci->ci_lastintr + timer_ticks_per_hz;
        ci->ci_lastintr_scheduled = next;



Home | Main Index | Thread Index | Old Index