Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/cpuctl/arch Decode AMD's CPUID Fn8000_0008 %ebx.



details:   https://anonhg.NetBSD.org/src/rev/551cd1abb358
branches:  trunk
changeset: 1003088:551cd1abb358
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Aug 30 13:12:24 2019 +0000

description:
Decode AMD's CPUID Fn8000_0008 %ebx.

diffstat:

 usr.sbin/cpuctl/arch/i386.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r a5d273800a1d -r 551cd1abb358 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Fri Aug 30 13:11:28 2019 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Fri Aug 30 13:12:24 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.104 2019/07/26 10:03:40 msaitoh Exp $       */
+/*     $NetBSD: i386.c,v 1.105 2019/08/30 13:12:24 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.104 2019/07/26 10:03:40 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.105 2019/08/30 13:12:24 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -2292,10 +2292,16 @@
                        ci->ci_max_ext_cpuid = descs[0];
                else
                        ci->ci_max_ext_cpuid = 0;
-               if (descs[0] >= 0x80000007)
+               if (ci->ci_max_ext_cpuid >= 0x80000007)
                        powernow_probe(ci);
 
-               if ((descs[0] >= 0x8000000a)
+               if (ci->ci_max_ext_cpuid >= 0x80000008) {
+                       x86_cpuid(0x80000008, descs);
+                       print_bits(cpuname, "AMD Extended features",
+                           CPUID_CAPEX_FLAGS, descs[1]);
+               }
+
+               if ((ci->ci_max_ext_cpuid >= 0x8000000a)
                    && (ci->ci_feat_val[3] & CPUID_SVM) != 0) {
                        x86_cpuid(0x8000000a, descs);
                        aprint_verbose("%s: SVM Rev. %d\n", cpuname,



Home | Main Index | Thread Index | Old Index