Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/pmax Add a second memory free list, which holds the...
details: https://anonhg.NetBSD.org/src/rev/199ee0627c01
branches: trunk
changeset: 472797:199ee0627c01
user: thorpej <thorpej%NetBSD.org@localhost>
date: Fri May 07 18:04:36 1999 +0000
description:
Add a second memory free list, which holds the first 8M of RAM. This is
so that devices which must allocate DMA memory in this range (e.g.
PixelStamp graphics boards) have a better chance of doing so, without
an awful hack.
diffstat:
sys/arch/pmax/include/vmparam.h | 9 ++++++---
sys/arch/pmax/pmax/machdep.c | 19 +++++++++++++++----
2 files changed, 21 insertions(+), 7 deletions(-)
diffs (67 lines):
diff -r ff6945b77dd5 -r 199ee0627c01 sys/arch/pmax/include/vmparam.h
--- a/sys/arch/pmax/include/vmparam.h Fri May 07 17:38:41 1999 +0000
+++ b/sys/arch/pmax/include/vmparam.h Fri May 07 18:04:36 1999 +0000
@@ -1,14 +1,17 @@
-/* $NetBSD: vmparam.h,v 1.8 1998/07/08 04:43:19 thorpej Exp $ */
+/* $NetBSD: vmparam.h,v 1.9 1999/05/07 18:04:37 thorpej Exp $ */
#include <mips/vmparam.h>
/*
* DECstation has one physical memory segment.
*/
-#define VM_PHYSSEG_MAX 1
+#define VM_PHYSSEG_MAX 2 /* 2 free lists */
+#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
+#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
-#define VM_NFREELIST 1
+#define VM_NFREELIST 2
#define VM_FREELIST_DEFAULT 0
+#define VM_FREELIST_FIRST8 1
/* pcb base */
/*#define pcbb(p) ((u_int)(p)->p_addr) */
diff -r ff6945b77dd5 -r 199ee0627c01 sys/arch/pmax/pmax/machdep.c
--- a/sys/arch/pmax/pmax/machdep.c Fri May 07 17:38:41 1999 +0000
+++ b/sys/arch/pmax/pmax/machdep.c Fri May 07 18:04:36 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.139 1999/04/26 09:23:26 nisimura Exp $ */
+/* $NetBSD: machdep.c,v 1.140 1999/05/07 18:04:36 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.139 1999/04/26 09:23:26 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.140 1999/05/07 18:04:36 thorpej Exp $");
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@@ -439,11 +439,22 @@
/*
* Load the rest of the available pages into the VM system.
+ * Put the first 8M of RAM onto a lower-priority free list, since
+ * some TC boards (e.g. PixelStamp boards) are only able to DMA
+ * into this region, and we want them to have a fighting chance of
+ * allocating their DMA memory during autoconfiguratoin.
*/
first = round_page(MIPS_KSEG0_TO_PHYS(kernend));
last = mem_clusters[0].start + mem_clusters[0].size;
- uvm_page_physload(atop(first), atop(last), atop(first), atop(last),
- VM_FREELIST_DEFAULT);
+ if (last <= (8 * 1024 * 1024)) {
+ uvm_page_physload(atop(first), atop(last), atop(first),
+ atop(last), VM_FREELIST_DEFAULT);
+ } else {
+ uvm_page_physload(atop(first), atop(8 * 1024 * 1024),
+ atop(first), atop(8 * 1024 * 1024), VM_FREELIST_FIRST8);
+ uvm_page_physload(atop(8 * 1024 * 1024), atop(last),
+ atop(8 * 1024 * 1024), atop(last), VM_FREELIST_DEFAULT);
+ }
/*
* Initialize error message buffer (at end of core).
Home |
Main Index |
Thread Index |
Old Index