Move allocsys() back to cpu_startup(). We're no longer allocating it from

the locked 4MB TLB entry, but it solves the problem where large memory machines
overflow the 4MB TLB entry.
This commit is contained in:
eeh 1998-11-22 23:38:53 +00:00
parent cecf78e09d
commit 4cf9a921c9
2 changed files with 21 additions and 31 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.22 1998/11/16 06:51:36 eeh Exp $ */
/* $NetBSD: machdep.c,v 1.23 1998/11/22 23:38:53 eeh Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -192,7 +192,9 @@ void stackdump __P((void));
void
cpu_startup()
{
register unsigned i;
unsigned i;
caddr_t v;
int sz;
int base, residual;
#ifdef DEBUG
extern int pmapdebug;
@ -218,6 +220,22 @@ cpu_startup()
#endif
printf("real mem = %ld\n", (long)ctob(physmem));
/*
* Find out how much space we need, allocate it,
* and then give everything true virtual addresses.
*/
sz = (int)allocsys((caddr_t)0);
#if defined(UVM)
if ((v = (caddr_t)uvm_km_alloc(kernel_map, round_page(sz))) == 0)
panic("startup: no room for tables");
#else
if ((v = (caddr_t)kmem_alloc(kernel_map, round_page(sz))) == 0)
panic("startup: no room for tables");
#endif
if (allocsys(v) - v != sz)
panic("startup: table size inconsistency");
#if defined(UVM)
/*
* allocate virtual and physical memory for the buffers.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.17 1998/11/22 17:22:50 eeh Exp $ */
/* $NetBSD: pmap.c,v 1.18 1998/11/22 23:38:53 eeh Exp $ */
/* #define NO_VCACHE /* Don't forget the locked TLB in dostart */
#define HWREF
/* #define BOOT_DEBUG */
@ -658,34 +658,6 @@ pmap_bootstrap(kernelstart, kernelend, maxctx)
valloc(ctxbusy, paddr_t, CTXSIZE);
bzero((caddr_t)ctxbusy, CTXSIZE);
{
caddr_t v;
extern caddr_t allocsys __P((caddr_t));
/*
* from cpu_startup():
*
* Find out how much space we need, allocate it,
* and then give everything true virtual addresses.
*/
sz = (size_t)allocsys((caddr_t)0);
#ifdef BOOT1_DEBUG
prom_printf("allocsys needs %08lx bytes RAM...", (u_long)sz);
#endif
valloc(v, void, sz);
if (allocsys(v) - v != sz) {
prom_printf("startup: table size inconsistency");
OF_exit();
}
/* Need to zero this out or we have problems w/swbufs and physio hangs */
bzero(v, sz);
#ifdef BOOT1_DEBUG
prom_printf("got it\r\n");
#endif
}
/*
* Allocate our TSB.
*