Module Name: src
Committed By: skrll
Date: Fri Dec 3 08:02:52 UTC 2021
Modified Files:
src/sys/dev/tprof: tprof_armv8.c
Log Message:
Add a comment and simplify the code ever so slightly.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/tprof/tprof_armv8.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/tprof/tprof_armv8.c
diff -u src/sys/dev/tprof/tprof_armv8.c:1.11 src/sys/dev/tprof/tprof_armv8.c:1.12
--- src/sys/dev/tprof/tprof_armv8.c:1.11 Fri Dec 3 08:00:13 2021
+++ src/sys/dev/tprof/tprof_armv8.c Fri Dec 3 08:02:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_armv8.c,v 1.11 2021/12/03 08:00:13 skrll Exp $ */
+/* $NetBSD: tprof_armv8.c,v 1.12 2021/12/03 08:02:52 skrll Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.11 2021/12/03 08:00:13 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.12 2021/12/03 08:02:52 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -57,6 +57,7 @@ armv8_pmu_event_implemented(uint16_t eve
eid[0] = reg_pmceid0_el0_read();
eid[1] = reg_pmceid1_el0_read();
+ /* The low 32bits of PMCEID[01]_EL0 contain the commmon events 0 to n */
const u_int idx = event / 32;
const u_int bit = event % 32;
@@ -222,9 +223,7 @@ armv8_pmu_init_cpu(void *arg1, void *arg
int
armv8_pmu_init(void)
{
- uint64_t xc;
-
- xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
+ uint64_t xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
xc_wait(xc);
return tprof_backend_register("tprof_armv8", &tprof_armv8_pmu_ops,