Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/macppc call cpu_topology_set() with adjustme...



details:   https://anonhg.NetBSD.org/src/rev/3071cf9e5a77
branches:  trunk
changeset: 847171:3071cf9e5a77
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Dec 13 23:01:41 2019 +0000

description:
call cpu_topology_set() with adjustments for 970MP CPUs

diffstat:

 sys/arch/macppc/macppc/cpu.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (51 lines):

diff -r 0eaaa9c09aa3 -r 3071cf9e5a77 sys/arch/macppc/macppc/cpu.c
--- a/sys/arch/macppc/macppc/cpu.c      Fri Dec 13 22:12:41 2019 +0000
+++ b/sys/arch/macppc/macppc/cpu.c      Fri Dec 13 23:01:41 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.67 2018/05/17 19:08:51 macallan Exp $        */
+/*     $NetBSD: cpu.c,v 1.68 2019/12/13 23:01:41 macallan Exp $        */
 
 /*-
  * Copyright (c) 2001 Tsubai Masanari.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.67 2018/05/17 19:08:51 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.68 2019/12/13 23:01:41 macallan Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_multiprocessor.h"
@@ -45,6 +45,7 @@
 #include <sys/device.h>
 #include <sys/types.h>
 #include <sys/lwp.h>
+#include <sys/cpu.h>
 
 #include <dev/ofw/openfirm.h>
 #include <powerpc/oea/hid.h>
@@ -159,12 +160,23 @@
 {
        struct cpu_info *ci;
        struct confargs *ca = aux;
-       int id = ca->ca_reg[0];
+       int id = ca->ca_reg[0], vers, package, core;
 
        ci = cpu_attach_common(self, id);
        if (ci == NULL)
                return;
 
+       package = id;
+       core = 0;
+
+       vers = (mfpvr() >> 16) & 0xffff;
+       
+       if (vers == IBM970MP) {
+               core = package & 1;
+               package >>= 1;
+       }
+       cpu_topology_set(ci, package, core, 0);
+
        if (ci->ci_khz == 0) {
                cpu_OFgetspeed(self, ci);
        }



Home | Main Index | Thread Index | Old Index