git: f64845598eb5 - stable/13 - riscv timer: provide a function for cpu_ticks

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Mon, 04 Jul 2022 16:40:08 UTC
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=f64845598eb5dd648e9a840e59cb1cc1896c5691

commit f64845598eb5dd648e9a840e59cb1cc1896c5691
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-06-21 16:23:31 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-07-04 16:37:05 +0000

    riscv timer: provide a function for cpu_ticks
    
    This is cheaper than the default of tc_cpu_ticks().
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D35462
    
    (cherry picked from commit 33734a1f765f8d0ca6214918c3051d88b7b98764)
---
 sys/riscv/riscv/timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/riscv/riscv/timer.c b/sys/riscv/riscv/timer.c
index c75350f4aac5..d1b61db78a86 100644
--- a/sys/riscv/riscv/timer.c
+++ b/sys/riscv/riscv/timer.c
@@ -241,6 +241,8 @@ riscv_timer_attach(device_t dev)
 	sc->et.et_priv = sc;
 	et_register(&sc->et);
 
+	set_cputicker(get_timecount, sc->clkfreq, false);
+
 	return (0);
 }