add new version of non contiguous memory code, written by chuck cranor,

called "MACHINE_NEW_NONCONGIG".  this is required for UVM, the new VM
system (also written by chuck) that is coming soon.  adds new functions:
	vm_page_physload() -- tell the VM system about an area of memory.
	vm_physseg_find() -- returns index in vm_physmem array that this
		address is in.
and several new versions of old functions/macros defined in vm_page.h.


this is the sparc portion.
This commit is contained in:
mrg 1998-01-08 11:39:30 +00:00
parent a20d56e92e
commit c599e7d439
3 changed files with 52 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */
/* $NetBSD: vmparam.h,v 1.14 1998/01/08 11:39:30 mrg Exp $ */
/*
* Copyright (c) 1992, 1993
@ -131,7 +131,24 @@
#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES)
#if defined(MACHINE_NEW_NONCONTIG)
#define VM_PHYSSEG_MAX 32 /* we only have one "hole" */
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
/*
* pmap specific data stored in the vm_physmem[] array
*/
struct pmap_physseg {
/* NULL */
};
#else
#define MACHINE_NONCONTIG /* VM <=> pmap interface modifier */
#endif
#if defined (_KERNEL) && !defined(_LOCORE)
struct vm_map;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.95 1997/12/23 23:57:24 tv Exp $ */
/* $NetBSD: machdep.c,v 1.96 1998/01/08 11:39:32 mrg Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -215,7 +215,7 @@ cpu_startup()
*/
printf(version);
/*identifycpu();*/
#ifndef MACHINE_NONCONTIG
#if !defined(MACHINE_NEW_NONCONTIG) && !defined(MACHINE_NONCONTIG)
physmem = btoc(avail_end);
#endif
printf("real mem = %d\n", ctob(physmem));

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.104 1998/01/02 22:57:56 thorpej Exp $ */
/* $NetBSD: pmap.c,v 1.105 1998/01/08 11:39:35 mrg Exp $ */
/*
* Copyright (c) 1996
@ -3026,6 +3026,37 @@ pmap_bootstrap4_4c(nctx, nregion, nsegment)
for (p = (caddr_t)trapbase; p < etext; p += NBPG)
setpte4(p, getpte4(p) & mask);
}
#if defined(MACHINE_NEW_NONCONTIG)
while (1) {
if (avail_next >=
pmemarr[cpmemarr].addr + pmemarr[cpmemarr].len) {
if (++cpmemarr == npmemarr)
break; /* DONE */
if (avail_next < pmemarr[cpmemarr].addr)
avail_next = pmemarr[cpmemarr].addr;
continue;
}
if (avail_next == unavail_start) {
avail_next = unavail_end;
continue;
}
#if defined(DIAGNOSTIC)
if (avail_next >= avail_end)
panic("pmap: too much memory!?");
#endif
vm_page_physload(
atop(avail_next),
atop(pmemarr[cpmemarr].addr) + atop(pmemarr[cpmemarr].len),
atop(avail_next),
atop(pmemarr[cpmemarr].addr) + atop(pmemarr[cpmemarr].len));
avail_next = pmemarr[cpmemarr].addr + pmemarr[cpmemarr].len;
}
#endif
}
#endif
@ -5055,7 +5086,6 @@ pmap_changeprot4m(pm, va, prot, wired)
setpgt4m(&sp->sg_pte[VA_SUN4M_VPG(va)],
(pte & ~SRMMU_PROT_MASK) | newprot);
out:
setcontext4m(ctx);
splx(s);