From 4cf9a921c915e53315bbdf471b8eb47f07894559 Mon Sep 17 00:00:00 2001 From: eeh Date: Sun, 22 Nov 1998 23:38:53 +0000 Subject: [PATCH] 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. --- sys/arch/sparc64/sparc64/machdep.c | 22 ++++++++++++++++++++-- sys/arch/sparc64/sparc64/pmap.c | 30 +----------------------------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 0453c9e1b9e6..cdc0cec5f625 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -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. diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index 963e810b2db4..fde8efdc945e 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -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. *