Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern NBPG -> PAGE_SIZE



details:   https://anonhg.NetBSD.org/src/rev/56a70842ecb7
branches:  trunk
changeset: 499233:56a70842ecb7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Nov 14 22:16:38 2000 +0000

description:
NBPG -> PAGE_SIZE

diffstat:

 sys/kern/sysv_shm.c |   6 ++++--
 sys/kern/tty.c      |   4 ++--
 sys/kern/vfs_bio.c  |  20 ++++++++++++--------
 3 files changed, 18 insertions(+), 12 deletions(-)

diffs (106 lines):

diff -r b13431940dbe -r 56a70842ecb7 sys/kern/sysv_shm.c
--- a/sys/kern/sysv_shm.c       Tue Nov 14 22:14:53 2000 +0000
+++ b/sys/kern/sysv_shm.c       Tue Nov 14 22:16:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysv_shm.c,v 1.59 2000/09/13 15:00:25 thorpej Exp $    */
+/*     $NetBSD: sysv_shm.c,v 1.60 2000/11/14 22:16:38 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -80,6 +80,8 @@
 #include <sys/mount.h>         /* XXX for <sys/syscallargs.h> */
 #include <sys/syscallargs.h>
 
+#include <uvm/uvm_extern.h>
+
 struct shmid_ds *shm_find_segment_by_shmid __P((int));
 
 /*
@@ -566,7 +568,7 @@
 {
        int i;
 
-       shminfo.shmmax *= NBPG;
+       shminfo.shmmax *= PAGE_SIZE;
 
        for (i = 0; i < shminfo.shmmni; i++) {
                shmsegs[i].shm_perm.mode = SHMSEG_FREE;
diff -r b13431940dbe -r 56a70842ecb7 sys/kern/tty.c
--- a/sys/kern/tty.c    Tue Nov 14 22:14:53 2000 +0000
+++ b/sys/kern/tty.c    Tue Nov 14 22:16:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.122 2000/11/05 15:37:09 jdolecek Exp $       */
+/*     $NetBSD: tty.c,v 1.123 2000/11/14 22:17:49 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1991, 1993
@@ -2021,7 +2021,7 @@
                ttyprintf(tp, "%ld.%02lds ", (long int)stime.tv_sec,
                    (long int)stime.tv_usec / 10000);
 
-#define        pgtok(a)        (((u_long) ((a) * NBPG) / 1024))
+#define        pgtok(a)        (((u_long) ((a) * PAGE_SIZE) / 1024))
                /* Print percentage cpu. */
                tmp = (pick->p_pctcpu * 10000 + FSCALE / 2) >> FSHIFT;
                ttyprintf(tp, "%d%% ", tmp / 100);
diff -r b13431940dbe -r 56a70842ecb7 sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Tue Nov 14 22:14:53 2000 +0000
+++ b/sys/kern/vfs_bio.c        Tue Nov 14 22:16:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.70 2000/11/08 14:28:13 ad Exp $  */
+/*     $NetBSD: vfs_bio.c,v 1.71 2000/11/14 22:22:02 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -59,6 +59,8 @@
 #include <sys/resourcevar.h>
 #include <sys/conf.h>
 
+#include <uvm/uvm_extern.h>
+
 #include <miscfs/specfs/specdev.h>
 
 /* Macros to clear/set/test flags. */
@@ -170,9 +172,9 @@
                LIST_INIT(&bp->b_dep);
                bp->b_data = buffers + i * MAXBSIZE;
                if (i < residual)
-                       bp->b_bufsize = (base + 1) * NBPG;
+                       bp->b_bufsize = (base + 1) * PAGE_SIZE;
                else
-                       bp->b_bufsize = base * NBPG;
+                       bp->b_bufsize = base * PAGE_SIZE;
                bp->b_flags = B_INVAL;
                dp = bp->b_bufsize ? &bufqueues[BQ_AGE] : &bufqueues[BQ_EMPTY];
                binsheadfree(bp, dp);
@@ -996,23 +998,25 @@
        int s, i, j, count;
        struct buf *bp;
        struct bqueues *dp;
-       int counts[MAXBSIZE/NBPG+1];
+       int *counts;
        static char *bname[BQUEUES] = { "LOCKED", "LRU", "AGE", "EMPTY" };
 
+       counts = alloca((MAXBSIZE / PAGE_SIZE) + 1);
+
        for (dp = bufqueues, i = 0; dp < &bufqueues[BQUEUES]; dp++, i++) {
                count = 0;
-               for (j = 0; j <= MAXBSIZE/NBPG; j++)
+               for (j = 0; j <= MAXBSIZE/PAGE_SIZE; j++)
                        counts[j] = 0;
                s = splbio();
                for (bp = dp->tqh_first; bp; bp = bp->b_freelist.tqe_next) {
-                       counts[bp->b_bufsize/NBPG]++;
+                       counts[bp->b_bufsize/PAGE_SIZE]++;
                        count++;
                }
                splx(s);
                printf("%s: total-%d", bname[i], count);
-               for (j = 0; j <= MAXBSIZE/NBPG; j++)
+               for (j = 0; j <= MAXBSIZE/PAGE_SIZE; j++)
                        if (counts[j] != 0)
-                               printf(", %d-%d", j * NBPG, counts[j]);
+                               printf(", %d-%d", j * PAGE_SIZE, counts[j]);
                printf("\n");
        }
 }



Home | Main Index | Thread Index | Old Index