Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 As the XXX implicitly suggests, this line i...



details:   https://anonhg.NetBSD.org/src/rev/140dac2fa24e
branches:  trunk
changeset: 821629:140dac2fa24e
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Feb 11 13:22:58 2017 +0000

description:
As the XXX implicitly suggests, this line is wrong. Many other families
support PMCs (like my 10h amd). While here, put a warning in a comment.

diffstat:

 sys/arch/x86/x86/tprof_amdpmi.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r 1e4fac1903fd -r 140dac2fa24e sys/arch/x86/x86/tprof_amdpmi.c
--- a/sys/arch/x86/x86/tprof_amdpmi.c   Sat Feb 11 10:33:44 2017 +0000
+++ b/sys/arch/x86/x86/tprof_amdpmi.c   Sat Feb 11 13:22:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tprof_amdpmi.c,v 1.5 2017/01/31 17:38:54 maxv Exp $    */
+/*     $NetBSD: tprof_amdpmi.c,v 1.6 2017/02/11 13:22:58 maxv Exp $    */
 
 /*-
  * Copyright (c)2008,2009 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi.c,v 1.5 2017/01/31 17:38:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi.c,v 1.6 2017/02/11 13:22:58 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,7 +86,10 @@
 #define DC_refills_sys__EVENT  0x43
 #define DC_refills_sys__UNIT   0x1E
 
-/* Hardcode your counter here */
+/*
+ * Hardcode your counter here. There is no detection, so make sure it is
+ * supported by your CPU family.
+ */
 static uint32_t event = CPU_clocks__EVENT;
 static uint32_t unit = CPU_clocks__UNIT;
 static int ctrno = 0;
@@ -180,11 +183,9 @@
 static int
 tprof_amdpmi_start(tprof_backend_cookie_t *cookie)
 {
-       struct cpu_info * const ci = curcpu();
        uint64_t xc;
 
-       if (!(cpu_vendor == CPUVENDOR_AMD) ||
-           CPUID_TO_FAMILY(ci->ci_signature) != 0xf) { /* XXX */
+       if (cpu_vendor != CPUVENDOR_AMD) {
                return ENOTSUP;
        }
 



Home | Main Index | Thread Index | Old Index