summaryrefslogtreecommitdiff
path: root/sys/arch/mips
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-05-05 20:57:05 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-05-05 20:57:05 +0000
commit368552036fe6029364e1abc2351955db681286fc (patch)
treeb3e9a57702ccbbcd0869d57d84ba28c1e1033e05 /sys/arch/mips
parente64b8c0b9c88452904cfa97be25cfec4e21e04ce (diff)
Get rid of CLSIZE and all related stuff.
CLSIZE -> 1 CLBYTES -> PAGE_SIZE OLOFSET -> PAGE_MASK etc. At the same time some archs needed some cleaning in vmparam.h so that goes in at the same time.
Diffstat (limited to 'sys/arch/mips')
-rw-r--r--sys/arch/mips/include/param.h12
-rw-r--r--sys/arch/mips/include/vmparam.h95
-rw-r--r--sys/arch/mips/mips/mem.c8
-rw-r--r--sys/arch/mips/mips/vm_machdep.c6
4 files changed, 15 insertions, 106 deletions
diff --git a/sys/arch/mips/include/param.h b/sys/arch/mips/include/param.h
index 5368dca22ff..09d7aa991c8 100644
--- a/sys/arch/mips/include/param.h
+++ b/sys/arch/mips/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.2 1999/01/27 04:46:05 imp Exp $ */
+/* $OpenBSD: param.h,v 1.3 2001/05/05 20:56:42 art Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -84,10 +84,6 @@
/* XXX Maxphys temporary changed to 32K while SCSI driver is fixed. */
#define MAXPHYS (32 * 1024) /* max raw I/O transfer size */
-#define CLSIZE 1
-#define CLSIZELOG2 0
-
-/* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */
@@ -103,7 +99,7 @@
/*
* Constants related to network buffer management.
- * MCLBYTES must be no larger than CLBYTES (the software page size), and,
+ * MCLBYTES must be no larger than the software page size, and,
* on machines that exchange pages of input or output buffers with mbuf
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
* of the hardware page size.
@@ -121,10 +117,10 @@
#endif
/*
- * Size of kernel malloc arena in CLBYTES-sized logical pages
+ * Size of kernel malloc arena in logical pages
*/
#ifndef NKMEMCLUSTERS
-#define NKMEMCLUSTERS (4096*1024/CLBYTES)
+#define NKMEMCLUSTERS (4096*1024/PAGE_SIZE)
#endif
/* pages ("clicks") (4096 bytes) to disk blocks */
diff --git a/sys/arch/mips/include/vmparam.h b/sys/arch/mips/include/vmparam.h
index 1e4b31119be..f56fff906ed 100644
--- a/sys/arch/mips/include/vmparam.h
+++ b/sys/arch/mips/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.4 1999/01/27 04:46:06 imp Exp $ */
+/* $OpenBSD: vmparam.h,v 1.5 2001/05/05 20:56:43 art Exp $ */
/* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */
/*
@@ -108,18 +108,6 @@
#endif
/*
- * Boundary at which to place first MAPMEM segment if not explicitly
- * specified. Should be a power of two. This allows some slop for
- * the data segment to grow underneath the first mapped segment.
- */
-#define MMSEG 0x200000
-
-/*
- * The size of the clock loop.
- */
-#define LOOPPAGES (maxfree - firstfree)
-
-/*
* The time for a process to be blocked before being very swappable.
* This is a number of seconds which the system takes as being a non-trivial
* amount of real time. You probably shouldn't change this;
@@ -135,86 +123,9 @@
* by the page replacement algorithm. Basically this says that if you are
* swapped in you deserve some resources. We protect the last SAFERSS
* pages against paging and will just swap you out rather than paging you.
- * Note that each process has at least UPAGES+CLSIZE pages which are not
- * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
- * number just means a swapped in process is given around 25k bytes.
- * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
- * so we loan each swapped in process memory worth 100$, or just admit
- * that we don't consider it worthwhile and swap it out to disk which costs
- * $30/mb or about $0.75.
*/
#define SAFERSS 4 /* nominal ``small'' resident set size
protected against replacement */
-
-/*
- * DISKRPM is used to estimate the number of paging i/o operations
- * which one can expect from a single disk controller.
- */
-#define DISKRPM 60
-
-/*
- * Klustering constants. Klustering is the gathering
- * of pages together for pagein/pageout, while clustering
- * is the treatment of hardware page size as though it were
- * larger than it really is.
- *
- * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
- * units. Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h.
- * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c)
- * unless you like "big push" panics.
- */
-
-#ifdef notdef /* XXX */
-#define KLMAX (4/CLSIZE)
-#define KLSEQL (2/CLSIZE) /* in klust if vadvise(VA_SEQL) */
-#define KLIN (4/CLSIZE) /* default data/stack in klust */
-#define KLTXT (4/CLSIZE) /* default text in klust */
-#define KLOUT (4/CLSIZE)
-#else
-#define KLMAX (1/CLSIZE)
-#define KLSEQL (1/CLSIZE)
-#define KLIN (1/CLSIZE)
-#define KLTXT (1/CLSIZE)
-#define KLOUT (1/CLSIZE)
-#endif
-
-/*
- * KLSDIST is the advance or retard of the fifo reclaim for sequential
- * processes data space.
- */
-#define KLSDIST 3 /* klusters advance/retard for seq. fifo */
-
-/*
- * Paging thresholds (see vm_sched.c).
- * Strategy of 1/19/85:
- * lotsfree is 512k bytes, but at most 1/4 of memory
- * desfree is 200k bytes, but at most 1/8 of memory
- */
-#define LOTSFREE (512 * 1024)
-#define LOTSFREEFRACT 4
-#define DESFREE (200 * 1024)
-#define DESFREEFRACT 8
-
-/*
- * There are two clock hands, initially separated by HANDSPREAD bytes
- * (but at most all of user memory). The amount of time to reclaim
- * a page once the pageout process examines it increases with this
- * distance and decreases as the scan rate rises.
- */
-#define HANDSPREAD (2 * 1024 * 1024)
-
-/*
- * The number of times per second to recompute the desired paging rate
- * and poke the pagedaemon.
- */
-#define RATETOSCHEDPAGING 4
-
-/*
- * Believed threshold (in megabytes) for which interleaved
- * swapping area is desirable.
- */
-#define LOTSOFMEM 2
-
/*
* Mach derived constants
*/
@@ -230,8 +141,8 @@
/* virtual sizes (bytes) for various kernel submaps */
#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
-#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES)
-#define VM_PHYS_SIZE (USRIOSIZE*CLBYTES)
+#define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE)
+#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
struct vm_map;
diff --git a/sys/arch/mips/mips/mem.c b/sys/arch/mips/mips/mem.c
index 4f58f8d6920..819fad7ceea 100644
--- a/sys/arch/mips/mips/mem.c
+++ b/sys/arch/mips/mips/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.5 2001/01/31 22:39:42 jason Exp $ */
+/* $OpenBSD: mem.c,v 1.6 2001/05/05 20:56:43 art Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -159,10 +159,10 @@ mmrw(dev, uio, flags)
}
if (zeropage == NULL) {
zeropage = (caddr_t)
- malloc(CLBYTES, M_TEMP, M_WAITOK);
- bzero(zeropage, CLBYTES);
+ malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
+ bzero(zeropage, PAGE_SIZE);
}
- c = min(iov->iov_len, CLBYTES);
+ c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/mips/mips/vm_machdep.c b/sys/arch/mips/mips/vm_machdep.c
index 4324c12b546..e45e9869214 100644
--- a/sys/arch/mips/mips/vm_machdep.c
+++ b/sys/arch/mips/mips/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.11 2000/06/08 22:25:20 niklas Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.12 2001/05/05 20:56:43 art Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -252,8 +252,10 @@ pagemove(from, to, size)
{
pt_entry_t *fpte, *tpte;
- if (size % CLBYTES)
+#ifdef DIAGNOSTIC
+ if ((size & PAGE_MASK) != 0)
panic("pagemove");
+#endif
fpte = kvtopte(from);
tpte = kvtopte(to);
if(((int)from & CpuCacheAliasMask) != ((int)to & CpuCacheAliasMask)) {