From owner-p4-projects@FreeBSD.ORG Sun Dec 17 02:18:16 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9986E16A416; Sun, 17 Dec 2006 02:18:16 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55F2616A40F for ; Sun, 17 Dec 2006 02:18:16 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24DEF43C9F for ; Sun, 17 Dec 2006 02:18:16 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBH2IGTf066204 for ; Sun, 17 Dec 2006 02:18:16 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBH2IFu3066201 for perforce@freebsd.org; Sun, 17 Dec 2006 02:18:15 GMT (envelope-from marcel@freebsd.org) Date: Sun, 17 Dec 2006 02:18:15 GMT Message-Id: <200612170218.kBH2IFu3066201@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 111830 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Dec 2006 02:18:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=111830 Change 111830 by marcel@marcel_nfs on 2006/12/17 02:17:28 The cpu nodes are under the cpus node, not the root node. Affected files ... .. //depot/projects/powerpc/sys/powerpc/powerpc/mp_machdep.c#6 edit Differences ... ==== //depot/projects/powerpc/sys/powerpc/powerpc/mp_machdep.c#6 (text+ko) ==== @@ -51,12 +51,18 @@ * device tree. */ root = OF_peer(0); - for (dev = OF_child(root); dev != 0; dev = OF_peer(dev)) { - res = OF_getprop(dev, "device_type", buf, sizeof(buf)); - if (res < 0) + dev = OF_child(root); + while (dev != 0) { + res = OF_getprop(dev, "name", buf, sizeof(buf)); + if (res < 0 || strcmp(buf, "cpus") != 0) { + dev = OF_peer(dev); continue; - if (strcmp(buf, "cpu") == 0) - mp_ncpus++; + } + for (dev = OF_child(dev); dev != 0; dev = OF_peer(dev)) { + res = OF_getprop(dev, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + mp_ncpus++; + } } /* Sanity. */ if (mp_ncpus == 0)