diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-05-05 20:57:05 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-05-05 20:57:05 +0000 |
commit | 368552036fe6029364e1abc2351955db681286fc (patch) | |
tree | b3e9a57702ccbbcd0869d57d84ba28c1e1033e05 /sys/arch/mac68k | |
parent | e64b8c0b9c88452904cfa97be25cfec4e21e04ce (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/mac68k')
-rw-r--r-- | sys/arch/mac68k/include/param.h | 6 | ||||
-rw-r--r-- | sys/arch/mac68k/include/vmparam.h | 88 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/machdep.c | 20 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/mem.c | 8 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/trap.c | 4 |
5 files changed, 22 insertions, 104 deletions
diff --git a/sys/arch/mac68k/include/param.h b/sys/arch/mac68k/include/param.h index c73f5ac21b3..9fc0fa2bbe9 100644 --- a/sys/arch/mac68k/include/param.h +++ b/sys/arch/mac68k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.10 2000/02/22 19:27:51 deraadt Exp $ */ +/* $OpenBSD: param.h,v 1.11 2001/05/05 20:56:40 art Exp $ */ /* $NetBSD: param.h,v 1.28 1997/03/01 06:57:45 scottr Exp $ */ /* @@ -104,10 +104,10 @@ #define NPTEPG (NBPG/(sizeof (pt_entry_t))) /* - * Size of kernel malloc arena in CLBYTES-sized logical pages + * Size of kernel malloc arena in logical pages */ #ifndef NKMEMCLUSTERS -#define NKMEMCLUSTERS (2048 * 1024 / CLBYTES) +#define NKMEMCLUSTERS (2048 * 1024 / PAGE_SIZE) #endif #define MSGBUFSIZE 4096 diff --git a/sys/arch/mac68k/include/vmparam.h b/sys/arch/mac68k/include/vmparam.h index 5f0d3e75d64..732a11f93d8 100644 --- a/sys/arch/mac68k/include/vmparam.h +++ b/sys/arch/mac68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.4 1997/11/30 06:10:37 gene Exp $ */ +/* $OpenBSD: vmparam.h,v 1.5 2001/05/05 20:56:41 art Exp $ */ /* $NetBSD: vmparam.h,v 1.8 1996/11/15 14:21:00 briggs Exp $ */ /* @@ -153,18 +153,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; @@ -180,79 +168,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 3600 - -/* - * 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. - */ - -#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) - -/* - * 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 - * Are these still valid in 1995? - */ -#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 */ @@ -266,8 +184,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) #define MACHINE_NONCONTIG /* VM <=> pmap interface modifier */ diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index d002aee2cef..505f56d1cef 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.67 2000/04/11 02:44:28 pjanzen Exp $ */ +/* $OpenBSD: machdep.c,v 1.68 2001/05/05 20:56:41 art Exp $ */ /* $NetBSD: machdep.c,v 1.134 1997/02/14 06:15:30 scottr Exp $ */ /* @@ -130,7 +130,7 @@ void netintr __P((void)); -#define MAXMEM 64*1024*CLSIZE /* XXX - from cmap.h */ +#define MAXMEM 64*1024 /* XXX - from cmap.h */ #include <vm/vm_param.h> #include <vm/pmap.h> #include <vm/vm_map.h> @@ -387,9 +387,9 @@ again: */ if (bufpages == 0) { if (physmem < btoc(2 * 1024 * 1024)) - bufpages = physmem / 10 / CLSIZE; + bufpages = physmem / 10; else - bufpages = (btoc(2 * 1024 * 1024) + physmem) / 20 / CLSIZE; + bufpages = (btoc(2 * 1024 * 1024) + physmem) / 20; } bufpages = min(NKMEMCLUSTERS * 2 / 5, bufpages); @@ -451,7 +451,7 @@ again: * 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); } @@ -472,9 +472,9 @@ again: * 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); @@ -485,7 +485,7 @@ again: printf("avail mem = %ld\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. @@ -731,7 +731,7 @@ long dumplo = 0; /* blocks */ /* * This is called by main to set dumplo and dumpsize. - * Dumps always skip the first CLBYTES of disk space in + * Dumps always skip the first block of disk space in * case there might be a disk label stored there. If there * is extra space, put dump at the end to reduce the chance * that swapping trashes it. @@ -764,7 +764,7 @@ dumpconf() /* * Check to see if we will fit. Note we always skip the - * first CLBYTES in case there is a disk label there. + * first block in case there is a disk label there. */ if (nblks < (ctod(dumpsize) + chdrsize + ctod(1))) { dumpsize = 0; diff --git a/sys/arch/mac68k/mac68k/mem.c b/sys/arch/mac68k/mac68k/mem.c index 6e69548de49..189648ab39a 100644 --- a/sys/arch/mac68k/mac68k/mem.c +++ b/sys/arch/mac68k/mac68k/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.9 1999/11/22 19:21:59 matthieu Exp $ */ +/* $OpenBSD: mem.c,v 1.10 2001/05/05 20:56:42 art Exp $ */ /* $NetBSD: mem.c,v 1.11 1996/05/05 06:18:41 briggs Exp $ */ /* @@ -165,10 +165,10 @@ mmrw(dev, uio, flags) } if (devzeropage == NULL) { devzeropage = (caddr_t) - malloc(CLBYTES, M_TEMP, M_WAITOK); - bzero(devzeropage, CLBYTES); + malloc(PAGE_SIZE, M_TEMP, M_WAITOK); + bzero(devzeropage, PAGE_SIZE); } - c = min(iov->iov_len, CLBYTES); + c = min(iov->iov_len, PAGE_SIZE); error = uiomove(devzeropage, c, uio); continue; diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c index 6ce1934a8df..31ac320e38b 100644 --- a/sys/arch/mac68k/mac68k/trap.c +++ b/sys/arch/mac68k/mac68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.18 2000/11/10 18:15:39 art Exp $ */ +/* $OpenBSD: trap.c,v 1.19 2001/05/05 20:56:42 art Exp $ */ /* $NetBSD: trap.c,v 1.46 1997/04/07 22:54:44 scottr Exp $ */ /* @@ -603,7 +603,7 @@ copyfault: 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) |