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 CPUID tells the ApicIdCoreIdSize in bits.



details:   https://anonhg.NetBSD.org/src/rev/3c6bce9af9af
branches:  trunk
changeset: 829390:3c6bce9af9af
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jan 28 16:15:41 2018 +0000

description:
CPUID tells the ApicIdCoreIdSize in bits.

diffstat:

 sys/arch/x86/x86/cpu_topology.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 27ffe0f7a43c -r 3c6bce9af9af sys/arch/x86/x86/cpu_topology.c
--- a/sys/arch/x86/x86/cpu_topology.c   Sun Jan 28 16:12:41 2018 +0000
+++ b/sys/arch/x86/x86/cpu_topology.c   Sun Jan 28 16:15:41 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_topology.c,v 1.11 2018/01/28 15:00:42 mlelstv Exp $        */
+/*     $NetBSD: cpu_topology.c,v 1.12 2018/01/28 16:15:41 mlelstv Exp $        */
 
 /*-
  * Copyright (c) 2009 Mindaugas Rasiukevicius <rmind at NetBSD org>,
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.11 2018/01/28 15:00:42 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.12 2018/01/28 16:15:41 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -108,6 +108,7 @@
                        core_max = lp_max;
                        break;
                }
+
                /* Number of Cores (NC) per package (ecx[7:0]). */
                x86_cpuid(0x80000008, descs);
                core_max = (descs[2] & 0xff) + 1;
@@ -116,9 +117,9 @@
                if (n != 0) {
                        /*
                         * Extended Method.
-                        * core_bits = 2 ^ n (power of two)
+                        * core_max = 2 ^ n (power of two)
                         */
-                       core_bits = 1 << n;
+                       core_bits = n;
                }
                break;
        default:



Home | Main Index | Thread Index | Old Index