Fix recent bugs seen on Performa 4400 macppc's by

Makoto Fujiwara <makoto@ki.nu> and Manuel Bouyer <bouyer@netbsd.org>.
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).
This commit is contained in:
wrstuden 2002-06-19 17:01:18 +00:00
parent 9be14081f9
commit 2eb3dc82d8
3 changed files with 17 additions and 6 deletions

View File

@ -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. * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -306,6 +306,7 @@ initppc(startkernel, endkernel, args)
#endif /* DDB || IPKDB || KGDB */ #endif /* DDB || IPKDB || KGDB */
} }
cpu_probe_cache();
/* /*
* external interrupt handler install * external interrupt handler install
*/ */

View File

@ -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. * Copyright (c) 2001 Matt Thomas.
@ -87,6 +87,11 @@ cpu_probe_cache(void)
curcpu()->ci_ci.icache_size = 32 K; curcpu()->ci_ci.icache_size = 32 K;
assoc = 8; assoc = 8;
break; break;
case MPC603:
curcpu()->ci_ci.dcache_size = 8 K;
curcpu()->ci_ci.icache_size = 8 K;
assoc = 2;
break;
case MPC603e: case MPC603e:
case MPC603ev: case MPC603ev:
case MPC604: case MPC604:
@ -100,8 +105,8 @@ cpu_probe_cache(void)
assoc = 4; assoc = 4;
break; break;
default: default:
curcpu()->ci_ci.dcache_size = PAGE_SIZE; curcpu()->ci_ci.dcache_size = NBPG;
curcpu()->ci_ci.icache_size = PAGE_SIZE; curcpu()->ci_ci.icache_size = NBPG;
assoc = 1; assoc = 1;
#undef K #undef K
} }

View File

@ -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. * Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -71,7 +71,7 @@
*/ */
#include <sys/cdefs.h> #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" #include "opt_uvmhist.h"
@ -866,6 +866,11 @@ uvm_page_recolor(int newncolors)
if (newncolors <= uvmexp.ncolors) if (newncolors <= uvmexp.ncolors)
return; return;
if (uvm.page_init_done == FALSE) {
uvmexp.ncolors = newncolors;
return;
}
bucketcount = newncolors * VM_NFREELIST; bucketcount = newncolors * VM_NFREELIST;
bucketarray = malloc(bucketcount * sizeof(struct pgflbucket), bucketarray = malloc(bucketcount * sizeof(struct pgflbucket),
M_VMPAGE, M_NOWAIT); M_VMPAGE, M_NOWAIT);