Module Name: src
Committed By: msaitoh
Date: Thu May 26 13:02:04 UTC 2022
Modified Files:
src/sys/dev/tprof: tprof_x86_intel.c
Log Message:
Use CPUID_PERF_* macros defined in specialreg.h. No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_x86_intel.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_x86_intel.c
diff -u src/sys/dev/tprof/tprof_x86_intel.c:1.3 src/sys/dev/tprof/tprof_x86_intel.c:1.4
--- src/sys/dev/tprof/tprof_x86_intel.c:1.3 Fri Jun 14 11:50:35 2019
+++ src/sys/dev/tprof/tprof_x86_intel.c Thu May 26 13:02:04 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $ */
+/* $NetBSD: tprof_x86_intel.c,v 1.4 2022/05/26 13:02:04 msaitoh Exp $ */
/*
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.4 2022/05/26 13:02:04 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,10 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: tprof_x86_in
#define PERFEVTSEL_INV __BIT(23)
#define PERFEVTSEL_COUNTER_MASK __BITS(24, 31)
-#define CPUID_0A_VERSION __BITS(0, 7)
-#define CPUID_0A_NCOUNTERS __BITS(8, 15)
-#define CPUID_0A_BITWIDTH __BITS(16, 23)
-
static uint64_t counter_bitwidth;
static uint64_t counter_val = 5000000;
static uint64_t counter_reset_val;
@@ -195,14 +191,14 @@ tprof_intel_ident(void)
return TPROF_IDENT_NONE;
}
x86_cpuid(0x0A, descs);
- if ((descs[0] & CPUID_0A_VERSION) == 0) {
+ if ((descs[0] & CPUID_PERF_VERSION) == 0) {
return TPROF_IDENT_NONE;
}
- if ((descs[0] & CPUID_0A_NCOUNTERS) == 0) {
+ if ((descs[0] & CPUID_PERF_NGPPC) == 0) {
return TPROF_IDENT_NONE;
}
- counter_bitwidth = __SHIFTOUT(descs[0], CPUID_0A_BITWIDTH);
+ counter_bitwidth = __SHIFTOUT(descs[0], CPUID_PERF_NBWGPPC);
return TPROF_IDENT_INTEL_GENERIC;
}