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 Remove ci_max_ext_cpuid because it's th...



details:   https://anonhg.NetBSD.org/src/rev/bdf98dc64ea4
branches:  trunk
changeset: 1008936:bdf98dc64ea4
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Apr 06 09:46:21 2020 +0000

description:
Remove ci_max_ext_cpuid because it's the same as ci_cpuid_extlevel.

diffstat:

 usr.sbin/cpuctl/arch/i386.c |  20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diffs (69 lines):

diff -r 197b6beba4b5 -r bdf98dc64ea4 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Mon Apr 06 09:32:54 2020 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Mon Apr 06 09:46:21 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.108 2019/11/17 15:32:00 msaitoh Exp $       */
+/*     $NetBSD: i386.c,v 1.109 2020/04/06 09:46:21 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.108 2019/11/17 15:32:00 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.109 2020/04/06 09:46:21 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -119,7 +119,6 @@
        uint8_t         ci_coreid;
        uint8_t         ci_smtid;
        uint32_t        ci_initapicid;
-       uint32_t        ci_max_ext_cpuid;
 
        uint32_t        ci_cur_xsave;
        uint32_t        ci_max_xsave;
@@ -1944,7 +1943,7 @@
                x86_cpuid(1, descs);
                lp_max = __SHIFTOUT(descs[1], CPUID_HTT_CORES);
 
-               if (cpu_family >= 0x10 && ci->ci_max_ext_cpuid >= 0x8000008) {
+               if (cpu_family >= 0x10 && ci->ci_cpuid_extlevel >= 0x8000008) {
                        x86_cpuid(0x8000008, descs);
                        core_max = (descs[2] & 0xff) + 1;
                        n = (descs[2] >> 12) & 0x0f;
@@ -2288,21 +2287,16 @@
        }
 
        if (cpu_vendor == CPUVENDOR_AMD) {
-               x86_cpuid(0x80000000, descs);
-               if (descs[0] >= 0x80000000)
-                       ci->ci_max_ext_cpuid = descs[0];
-               else
-                       ci->ci_max_ext_cpuid = 0;
-               if (ci->ci_max_ext_cpuid >= 0x80000007)
+               if (ci->ci_cpuid_extlevel >= 0x80000007)
                        powernow_probe(ci);
 
-               if (ci->ci_max_ext_cpuid >= 0x80000008) {
+               if (ci->ci_cpuid_extlevel >= 0x80000008) {
                        x86_cpuid(0x80000008, descs);
                        print_bits(cpuname, "AMD Extended features",
                            CPUID_CAPEX_FLAGS, descs[1]);
                }
 
-               if ((ci->ci_max_ext_cpuid >= 0x8000000a)
+               if ((ci->ci_cpuid_extlevel >= 0x8000000a)
                    && (ci->ci_feat_val[3] & CPUID_SVM) != 0) {
                        x86_cpuid(0x8000000a, descs);
                        aprint_verbose("%s: SVM Rev. %d\n", cpuname,
@@ -2312,7 +2306,7 @@
                        print_bits(cpuname, "SVM features",
                            CPUID_AMD_SVM_FLAGS, descs[3]);
                }
-               if (ci->ci_max_ext_cpuid >= 0x8000001f) {
+               if (ci->ci_cpuid_extlevel >= 0x8000001f) {
                        x86_cpuid(0x8000001f, descs);
                        print_bits(cpuname, "Encrypted Memory features",
                            CPUID_AMD_ENCMEM_FLAGS, descs[0]);



Home | Main Index | Thread Index | Old Index