Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/tprof If the hardware does not support PMU, return a...



details:   https://anonhg.NetBSD.org/src/rev/a34785f82758
branches:  trunk
changeset: 372294:a34785f82758
user:      ryo <ryo%NetBSD.org@localhost>
date:      Wed Nov 09 19:06:46 2022 +0000

description:
If the hardware does not support PMU, return an error instead of KASSERT.

diffstat:

 sys/dev/tprof/tprof_armv8.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r ff36e4f4e395 -r a34785f82758 sys/dev/tprof/tprof_armv8.c
--- a/sys/dev/tprof/tprof_armv8.c       Wed Nov 09 19:03:38 2022 +0000
+++ b/sys/dev/tprof/tprof_armv8.c       Wed Nov 09 19:06:46 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_armv8.c,v 1.14 2022/05/16 09:42:32 jmcneill Exp $ */
+/* $NetBSD: tprof_armv8.c,v 1.15 2022/11/09 19:06:46 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.14 2022/05/16 09:42:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.15 2022/11/09 19:06:46 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -233,7 +233,8 @@
 int
 armv8_pmu_init(void)
 {
-       KASSERT(armv8_pmu_detect());
+       if (!armv8_pmu_detect())
+               return ENOTSUP;
 
        uint64_t xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
        xc_wait(xc);



Home | Main Index | Thread Index | Old Index