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/mvme88k | |
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/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/include/param.h | 14 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/vmparam.h | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 26 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/mem.c | 12 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/trap.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/vm_machdep.c | 4 |
6 files changed, 32 insertions, 36 deletions
diff --git a/sys/arch/mvme88k/include/param.h b/sys/arch/mvme88k/include/param.h index 6f229547d5c..1611c25078d 100644 --- a/sys/arch/mvme88k/include/param.h +++ b/sys/arch/mvme88k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.15 2001/03/09 05:44:40 smurph Exp $ */ +/* $OpenBSD: param.h,v 1.16 2001/05/05 20:56:46 art Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1988 University of Utah. @@ -40,7 +40,7 @@ * from: Utah $Hdr: machparam.h 1.11 89/08/14$ * * @(#)param.h 7.8 (Berkeley) 6/28/91 - * $Id: param.h,v 1.15 2001/03/09 05:44:40 smurph Exp $ + * $Id: param.h,v 1.16 2001/05/05 20:56:46 art Exp $ */ #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ @@ -95,10 +95,6 @@ #define BLKDEV_IOSIZE 2048 /* Should this be changed? XXX */ #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 */ #define USPACE ctob(UPAGES) @@ -116,7 +112,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. @@ -135,10 +131,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 #define MSGBUFSIZE 4096 diff --git a/sys/arch/mvme88k/include/vmparam.h b/sys/arch/mvme88k/include/vmparam.h index e6fbbe5e2b0..d4d294c63fe 100644 --- a/sys/arch/mvme88k/include/vmparam.h +++ b/sys/arch/mvme88k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.9 2001/03/07 23:37:17 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.10 2001/05/05 20:56:46 art Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -175,8 +175,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) /* * Conversion between MACHINE pages and VM pages diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 04ef80e3cd8..ebb42aab866 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.32 2001/04/29 19:00:03 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.33 2001/05/05 20:56:47 art Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -675,7 +675,7 @@ cpu_startup() * "base" pages for the rest. */ curbuf = (vm_offset_t) buffers + (i * MAXBSIZE); - curbufsize = CLBYTES * ((i < residual) ? (base+1) : base); + curbufsize = PAGE_SIZE * ((i < residual) ? (base+1) : base); while (curbufsize) { pg = uvm_pagealloc(NULL, 0, NULL, 0); @@ -700,7 +700,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); /* this faults in the required physical pages */ vm_map_pageable(buffer_map, curbuf, curbuf+curbufsize, FALSE); vm_map_simplify(buffer_map, curbuf); @@ -759,9 +759,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); #if defined(UVM) mb_map = uvm_km_suballoc(kernel_map, (vaddr_t *)&mbutl, &maxaddr, VM_MBUF_SIZE, VM_MAP_INTRSAFE, FALSE, NULL); @@ -782,7 +782,7 @@ cpu_startup() ptoa(cnt.v_free_count)/NBPG); #endif printf("using %d buffers containing %d bytes of memory\n", nbuf, - bufpages * CLBYTES); + bufpages * PAGE_SIZE); #if 0 /* #ifdef MFS */ /* @@ -876,10 +876,10 @@ allocsys(v) */ 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; @@ -894,8 +894,8 @@ allocsys(v) 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 */ @@ -1318,11 +1318,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/mvme88k/mvme88k/mem.c b/sys/arch/mvme88k/mvme88k/mem.c index ce3a74820f0..2e5ed3764ca 100644 --- a/sys/arch/mvme88k/mvme88k/mem.c +++ b/sys/arch/mvme88k/mvme88k/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.7 2001/01/31 22:39:42 jason Exp $ */ +/* $OpenBSD: mem.c,v 1.8 2001/05/05 20:56:47 art Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -164,9 +164,9 @@ mmrw(dev, uio, flags) if (uio->uio_rw == UIO_READ) { if (zeropage == NULL) { zeropage = (caddr_t) - malloc(CLBYTES, M_TEMP, + malloc(PAGE_SIZE, M_TEMP, M_WAITOK); - bzero(zeropage, CLBYTES); + bzero(zeropage, PAGE_SIZE); } c = min(c, NBPG - (int)v); v = (vm_offset_t)zeropage; @@ -193,10 +193,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/mvme88k/mvme88k/trap.c b/sys/arch/mvme88k/mvme88k/trap.c index 9ab88061096..cc53b35e162 100644 --- a/sys/arch/mvme88k/mvme88k/trap.c +++ b/sys/arch/mvme88k/mvme88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.15 2001/03/12 23:00:40 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.16 2001/05/05 20:56:47 art Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -517,7 +517,7 @@ outtahere: if ((caddr_t)va >= vm->vm_maxsaddr) { if (result == KERN_SUCCESS) { - nss = clrnd(btoc(USRSTACK - va));/* XXX check this */ + nss = btoc(USRSTACK - va);/* XXX check this */ if (nss > vm->vm_ssize) vm->vm_ssize = nss; } else if (result == KERN_PROTECTION_FAILURE) @@ -1082,7 +1082,7 @@ trap2(unsigned type, struct m88100_saved_state *frame) if ((caddr_t)va >= vm->vm_maxsaddr) { if (result == KERN_SUCCESS) { - nss = clrnd(btoc(USRSTACK - va));/* XXX check this */ + nss = btoc(USRSTACK - va);/* XXX check this */ if (nss > vm->vm_ssize) vm->vm_ssize = nss; } else if (result == KERN_PROTECTION_FAILURE) diff --git a/sys/arch/mvme88k/mvme88k/vm_machdep.c b/sys/arch/mvme88k/mvme88k/vm_machdep.c index 85d3d9e6128..e89a67773d9 100644 --- a/sys/arch/mvme88k/mvme88k/vm_machdep.c +++ b/sys/arch/mvme88k/mvme88k/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.21 2001/04/29 19:00:03 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.22 2001/05/05 20:56:47 art Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. @@ -508,7 +508,7 @@ pagemove(caddr_t from, caddr_t to, size_t size) register vm_offset_t pa; #ifdef DEBUG - if (size & CLOFSET) + if ((size & PAGE_MASK) != 0) panic("pagemove"); #endif while (size > 0) { |