Source-Changes-HG archive

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

[src/trunk]: src/sys Fix recent bugs seen on Performa 4400 macppc's by



details:   https://anonhg.NetBSD.org/src/rev/b1db77c1de15
branches:  trunk
changeset: 533043:b1db77c1de15
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Wed Jun 19 17:01:18 2002 +0000

description:
Fix recent bugs seen on Performa 4400 macppc's by
Makoto Fujiwara <makoto%ki.nu@localhost> and Manuel Bouyer <bouyer%netbsd.org@localhost>.
Help from Allen Briggs, Jason Thorpe, and Matt Thomas.

We need to call cpu_cache_probe() early in boot (machdep.c).
Add 603 info for completeness, and use NBPG not PAGESIZE, as the
latter relies on uvm being setup (cpu_subr.c).
Let uvm_page_recolor() be called before uvm has been set up; just
note the page coloring value (uvm_page.c).

diffstat:

 sys/arch/macppc/macppc/machdep.c   |   3 ++-
 sys/arch/powerpc/mpc6xx/cpu_subr.c |  11 ++++++++---
 sys/uvm/uvm_page.c                 |   9 +++++++--
 3 files changed, 17 insertions(+), 6 deletions(-)

diffs (79 lines):

diff -r d7ad05824a80 -r b1db77c1de15 sys/arch/macppc/macppc/machdep.c
--- a/sys/arch/macppc/macppc/machdep.c  Wed Jun 19 16:42:09 2002 +0000
+++ b/sys/arch/macppc/macppc/machdep.c  Wed Jun 19 17:01:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.113 2002/05/13 06:05:33 matt Exp $       */
+/*     $NetBSD: machdep.c,v 1.114 2002/06/19 17:01:20 wrstuden Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -306,6 +306,7 @@
 #endif /* DDB || IPKDB || KGDB */
                }
 
+       cpu_probe_cache();
        /*
         * external interrupt handler install
         */
diff -r d7ad05824a80 -r b1db77c1de15 sys/arch/powerpc/mpc6xx/cpu_subr.c
--- a/sys/arch/powerpc/mpc6xx/cpu_subr.c        Wed Jun 19 16:42:09 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/cpu_subr.c        Wed Jun 19 17:01:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_subr.c,v 1.18 2002/06/17 21:28:48 matt Exp $       */
+/*     $NetBSD: cpu_subr.c,v 1.19 2002/06/19 17:01:20 wrstuden Exp $   */
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -87,6 +87,11 @@
                curcpu()->ci_ci.icache_size = 32 K;
                assoc = 8;
                break;
+       case MPC603:
+               curcpu()->ci_ci.dcache_size = 8 K;
+               curcpu()->ci_ci.icache_size = 8 K;
+               assoc = 2;
+               break;
        case MPC603e:
        case MPC603ev:
        case MPC604:
@@ -100,8 +105,8 @@
                assoc = 4;
                break;
        default:
-               curcpu()->ci_ci.dcache_size = PAGE_SIZE;
-               curcpu()->ci_ci.icache_size = PAGE_SIZE;
+               curcpu()->ci_ci.dcache_size = NBPG;
+               curcpu()->ci_ci.icache_size = NBPG;
                assoc = 1;
 #undef K
        }
diff -r d7ad05824a80 -r b1db77c1de15 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Wed Jun 19 16:42:09 2002 +0000
+++ b/sys/uvm/uvm_page.c        Wed Jun 19 17:01:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.76 2002/05/29 11:04:39 enami Exp $      */
+/*     $NetBSD: uvm_page.c,v 1.77 2002/06/19 17:01:18 wrstuden Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.76 2002/05/29 11:04:39 enami Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.77 2002/06/19 17:01:18 wrstuden Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -866,6 +866,11 @@
        if (newncolors <= uvmexp.ncolors)
                return;
 
+       if (uvm.page_init_done == FALSE) {
+               uvmexp.ncolors = newncolors;
+               return;
+       }
+
        bucketcount = newncolors * VM_NFREELIST;
        bucketarray = malloc(bucketcount * sizeof(struct pgflbucket),
            M_VMPAGE, M_NOWAIT);



Home | Main Index | Thread Index | Old Index