summaryrefslogtreecommitdiff
path: root/sys/arch/pmax
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/pmax')
-rw-r--r--sys/arch/pmax/include/mips_param.h4
-rw-r--r--sys/arch/pmax/include/param.h6
-rw-r--r--sys/arch/pmax/include/vmparam.h92
-rw-r--r--sys/arch/pmax/pmax/machdep.c28
-rw-r--r--sys/arch/pmax/pmax/mem.c8
-rw-r--r--sys/arch/pmax/pmax/trap.c4
-rw-r--r--sys/arch/pmax/pmax/vm_machdep.c4
7 files changed, 28 insertions, 118 deletions
diff --git a/sys/arch/pmax/include/mips_param.h b/sys/arch/pmax/include/mips_param.h
index 7c89ca5acc2..90cf8159203 100644
--- a/sys/arch/pmax/include/mips_param.h
+++ b/sys/arch/pmax/include/mips_param.h
@@ -22,10 +22,10 @@
#define SEGSHIFT 22 /* LOG2(NBSEG) */
/*
- * Size of kernel malloc arena in CLBYTES-sized logical pages
+ * Size of kernel malloc arena in logical pages
*/
#ifndef NKMEMCLUSTERS
-#define NKMEMCLUSTERS (6*1024*1024/CLBYTES)
+#define NKMEMCLUSTERS (6*1024*1024/PAGE_SIZE)
#endif
/* pages ("clicks") (4096 bytes) to disk blocks */
diff --git a/sys/arch/pmax/include/param.h b/sys/arch/pmax/include/param.h
index 810769255c2..b98847c8b33 100644
--- a/sys/arch/pmax/include/param.h
+++ b/sys/arch/pmax/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.10 2000/12/28 22:21:46 miod Exp $ */
+/* $OpenBSD: param.h,v 1.11 2001/05/05 20:56:48 art Exp $ */
/* $NetBSD: param.h,v 1.18 1997/02/26 01:45:41 jonathan Exp $ */
/*
@@ -68,10 +68,6 @@
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 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 */
diff --git a/sys/arch/pmax/include/vmparam.h b/sys/arch/pmax/include/vmparam.h
index 1e7cc3c2dd3..dfe1cbcfc09 100644
--- a/sys/arch/pmax/include/vmparam.h
+++ b/sys/arch/pmax/include/vmparam.h
@@ -111,18 +111,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;
@@ -138,86 +126,10 @@
* 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
-
#define mapin(pte, v, pfnum, prot) \
(*(int *)(pte) = ((pfnum) << PG_SHIFT) | (prot), MachTLBFlushAddr(v))
@@ -234,8 +146,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)
/* pcb base */
#define pcbb(p) ((u_int)(p)->p_addr)
diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c
index 0177cba9783..aba014f8295 100644
--- a/sys/arch/pmax/pmax/machdep.c
+++ b/sys/arch/pmax/pmax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.26 2000/11/08 14:38:23 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.27 2001/05/05 20:56:49 art Exp $ */
/* $NetBSD: machdep.c,v 1.67 1996/10/23 20:04:40 mhitch Exp $ */
/*
@@ -734,10 +734,10 @@ mach_init(argc, argv, code, cv)
*/
if (bufpages == 0) {
if (physmem < btoc(2 * 1024 * 1024))
- bufpages = physmem / (10 * CLSIZE);
+ bufpages = physmem / 10;
else
bufpages = (btoc(2 * 1024 * 1024) + physmem) *
- BUFCACHEPERCENT / (100 * CLSIZE);
+ BUFCACHEPERCENT / 100;
}
if (nbuf == 0) {
nbuf = bufpages;
@@ -752,8 +752,8 @@ mach_init(argc, argv, code, cv)
MAXBSIZE * 7 / 10;
/* More buffer pages than fits into the buffers is senseless. */
- if (bufpages > nbuf * MAXBSIZE / CLBYTES)
- bufpages = nbuf * MAXBSIZE / CLBYTES;
+ if (bufpages > nbuf * MAXBSIZE / PAGE_SIZE)
+ bufpages = nbuf * MAXBSIZE / PAGE_SIZE;
if (nswbuf == 0) {
nswbuf = (nbuf / 2) &~ 1; /* force even */
@@ -821,9 +821,9 @@ cpu_startup()
panic("startup: cannot allocate buffers");
base = bufpages / nbuf;
residual = bufpages % nbuf;
- if (base >= MAXBSIZE / CLBYTES) {
+ if (base >= MAXBSIZE / PAGE_SIZE) {
/* don't want to alloc more physical mem than needed */
- base = MAXBSIZE / CLBYTES;
+ base = MAXBSIZE / PAGE_SIZE;
residual = 0;
}
@@ -839,7 +839,7 @@ cpu_startup()
* but has no physical memory allocated for it.
*/
curbuf = (vm_offset_t)buffers + i * MAXBSIZE;
- curbufsize = CLBYTES * (i < residual ? base+1 : base);
+ curbufsize = PAGE_SIZE * (i < residual ? base+1 : base);
vm_map_pageable(buffer_map, curbuf, curbuf+curbufsize, FALSE);
vm_map_simplify(buffer_map, curbuf);
}
@@ -859,9 +859,9 @@ cpu_startup()
* Finally, allocate mbuf pool. Since mclrefcnt is an off-size
* we use the more space efficient malloc in place of kmem_alloc.
*/
- mclrefcnt = (char *)malloc(NMBCLUSTERS+CLBYTES/MCLBYTES,
+ mclrefcnt = (char *)malloc(NMBCLUSTERS+PAGE_SIZE/MCLBYTES,
M_MBUF, M_NOWAIT);
- bzero(mclrefcnt, NMBCLUSTERS+CLBYTES/MCLBYTES);
+ bzero(mclrefcnt, NMBCLUSTERS+PAGE_SIZE/MCLBYTES);
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
@@ -874,7 +874,7 @@ cpu_startup()
#endif
printf("avail mem = %d\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
- nbuf, bufpages * CLBYTES);
+ nbuf, bufpages * PAGE_SIZE);
/*
* Set up buffers, so they can be used to read disk labels.
@@ -1188,11 +1188,11 @@ dumpconf()
dumplo = nblks - btodb(ctob(physmem));
}
/*
- * Don't dump on the first CLBYTES (why CLBYTES?)
+ * Don't dump on the first block
* in case the dump device includes a disk label.
*/
- if (dumplo < btodb(CLBYTES))
- dumplo = btodb(CLBYTES);
+ if (dumplo < btodb(PAGE_SIZE))
+ dumplo = btodb(PAGE_SIZE);
}
/*
diff --git a/sys/arch/pmax/pmax/mem.c b/sys/arch/pmax/pmax/mem.c
index 9bcf627a429..f7dca1a5295 100644
--- a/sys/arch/pmax/pmax/mem.c
+++ b/sys/arch/pmax/pmax/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.10 2001/01/31 22:39:43 jason Exp $ */
+/* $OpenBSD: mem.c,v 1.11 2001/05/05 20:56:49 art Exp $ */
/* $NetBSD: mem.c,v 1.7 1995/09/29 21:53:29 jonathan Exp $ */
/*
@@ -154,10 +154,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/pmax/pmax/trap.c b/sys/arch/pmax/pmax/trap.c
index 1a5cba2b292..8e64b1b87a2 100644
--- a/sys/arch/pmax/pmax/trap.c
+++ b/sys/arch/pmax/pmax/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.23 2001/04/03 20:25:35 art Exp $ */
+/* $OpenBSD: trap.c,v 1.24 2001/05/05 20:56:49 art Exp $ */
/* $NetBSD: trap.c,v 1.50 1996/10/13 21:37:49 jonathan Exp $ */
/*
@@ -574,7 +574,7 @@ trap(statusReg, causeReg, vadr, pc, args)
if (rv == KERN_SUCCESS) {
unsigned nss;
- nss = clrnd(btoc(USRSTACK-(unsigned)va));
+ nss = btoc(USRSTACK-(unsigned)va);
if (nss > vm->vm_ssize)
vm->vm_ssize = nss;
} else if (rv == KERN_PROTECTION_FAILURE)
diff --git a/sys/arch/pmax/pmax/vm_machdep.c b/sys/arch/pmax/pmax/vm_machdep.c
index fc80ee5f7bc..dfc7b97508e 100644
--- a/sys/arch/pmax/pmax/vm_machdep.c
+++ b/sys/arch/pmax/pmax/vm_machdep.c
@@ -254,8 +254,10 @@ pagemove(from, to, size)
{
register pt_entry_t *fpte, *tpte;
- if (size % CLBYTES)
+#ifdef DIAGNOSTIC
+ if ((size & PAGE_MASK) != 0)
panic("pagemove");
+#endif
fpte = kvtopte(from);
tpte = kvtopte(to);
while (size > 0) {