Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 NBPG -> PAGE_SIZE



details:   https://anonhg.NetBSD.org/src/rev/e19a62599599
branches:  trunk
changeset: 499239:e19a62599599
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Nov 14 22:55:05 2000 +0000

description:
NBPG -> PAGE_SIZE

diffstat:

 sys/arch/i386/i386/apm.c          |   4 +-
 sys/arch/i386/i386/bus_machdep.c  |   8 ++--
 sys/arch/i386/i386/db_memrw.c     |   4 +-
 sys/arch/i386/i386/kgdb_machdep.c |   4 +-
 sys/arch/i386/i386/machdep.c      |  40 +++++++++++++-------------
 sys/arch/i386/i386/mem.c          |  12 +++---
 sys/arch/i386/i386/pmap.c         |  59 +++++++++++++++++++-------------------
 sys/arch/i386/i386/vm_machdep.c   |  10 +++---
 8 files changed, 71 insertions(+), 70 deletions(-)

diffs (truncated from 501 to 300 lines):

diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/apm.c
--- a/sys/arch/i386/i386/apm.c  Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/apm.c  Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apm.c,v 1.53 2000/08/13 22:26:27 augustss Exp $ */
+/*     $NetBSD: apm.c,v 1.54 2000/11/14 22:55:05 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -959,7 +959,7 @@
        struct bioscallregs regs;
        int error, apm_data_seg_ok;
        u_int okbases[] = { 0, biosbasemem*1024 };
-       u_int oklimits[] = { NBPG, IOM_END};
+       u_int oklimits[] = { PAGE_SIZE, IOM_END};
        u_int i;
 #ifdef APMDEBUG
        char bits[128];
diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/bus_machdep.c
--- a/sys/arch/i386/i386/bus_machdep.c  Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/bus_machdep.c  Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_machdep.c,v 1.5 2000/09/07 17:20:59 thorpej Exp $  */
+/*     $NetBSD: bus_machdep.c,v 1.6 2000/11/14 22:55:05 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -292,7 +292,7 @@
 
        *bshp = (bus_space_handle_t)(va + (bpa & PGOFSET));
 
-       for (; pa < endpa; pa += NBPG, va += NBPG) {
+       for (; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) {
                pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE);
 
                /*
@@ -723,7 +723,7 @@
        for (curseg = 0; curseg < nsegs; curseg++) {
                for (addr = segs[curseg].ds_addr;
                    addr < (segs[curseg].ds_addr + segs[curseg].ds_len);
-                   addr += NBPG, va += NBPG, size -= NBPG) {
+                   addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
                        if (size == 0)
                                panic("_bus_dmamem_map: size botch");
                        pmap_enter(pmap_kernel(), va, addr,
@@ -845,7 +845,7 @@
                /*
                 * Compute the segment size, and adjust counts.
                 */
-               sgsize = NBPG - ((u_long)vaddr & PGOFSET);
+               sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
                if (buflen < sgsize)
                        sgsize = buflen;
 
diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/db_memrw.c
--- a/sys/arch/i386/i386/db_memrw.c     Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/db_memrw.c     Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_memrw.c,v 1.10 2000/09/24 23:46:37 itohy Exp $      */
+/*     $NetBSD: db_memrw.c,v 1.11 2000/11/14 22:55:05 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
                        limit = NBPD - ((vaddr_t)dst & (NBPD - 1));
                else
 #endif
-                       limit = NBPG - ((vaddr_t)dst & PGOFSET);
+                       limit = PAGE_SIZE - ((vaddr_t)dst & PGOFSET);
                if (limit > size)
                        limit = size;
                size -= limit;
diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/kgdb_machdep.c
--- a/sys/arch/i386/i386/kgdb_machdep.c Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/kgdb_machdep.c Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kgdb_machdep.c,v 1.9 2000/10/06 18:37:39 thorpej Exp $ */
+/*     $NetBSD: kgdb_machdep.c,v 1.10 2000/11/14 22:55:05 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -117,7 +117,7 @@
                        va = (va & PG_LGFRAME) + NBPD;
                else
 #endif
-                       va += NBPG;
+                       va += PAGE_SIZE;
        } while (va < last_va);
 
        return (1);
diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/machdep.c      Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.413 2000/11/13 16:40:40 jdolecek Exp $   */
+/*     $NetBSD: machdep.c,v 1.414 2000/11/14 22:55:05 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -327,8 +327,8 @@
 
        /* msgbuf_paddr was init'd in pmap */
        for (x = 0; x < btoc(MSGBUFSIZE); x++)
-               pmap_kenter_pa((vaddr_t)msgbuf_vaddr + x * NBPG,
-                   msgbuf_paddr + x * NBPG, VM_PROT_READ|VM_PROT_WRITE);
+               pmap_kenter_pa((vaddr_t)msgbuf_vaddr + x * PAGE_SIZE,
+                   msgbuf_paddr + x * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE);
 
        initmsgbuf((caddr_t)msgbuf_vaddr, round_page(MSGBUFSIZE));
 
@@ -435,7 +435,7 @@
         */
        format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free - bufpages));
        printf("avail memory = %s\n", pbuf);
-       format_bytes(pbuf, sizeof(pbuf), bufpages * NBPG);
+       format_bytes(pbuf, sizeof(pbuf), bufpages * PAGE_SIZE);
        printf("using %d buffers containing %s of memory\n", nbuf, pbuf);
 
 #if NBIOSCALL > 0
@@ -444,9 +444,9 @@
         * in case someone tries to fake it out...
         */
 #ifdef DIAGNOSTIC
-       if (biostramp_image_size > NBPG)
+       if (biostramp_image_size > PAGE_SIZE)
            panic("biostramp_image_size too big: %x vs. %x\n",
-                 biostramp_image_size, NBPG);
+                 biostramp_image_size, PAGE_SIZE);
 #endif
        pmap_kenter_pa((vaddr_t)BIOSTRAMP_BASE, /* virtual */
                       (paddr_t)BIOSTRAMP_BASE, /* physical */
@@ -512,7 +512,7 @@
                 * "base" pages for the rest.
                 */
                curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
-               curbufsize = NBPG * ((i < residual) ? (base+1) : base);
+               curbufsize = PAGE_SIZE * ((i < residual) ? (base+1) : base);
 
                while (curbufsize) {
                        /*
@@ -1462,7 +1462,7 @@
 
 /*
  * This is called by main to set dumplo and dumpsize.
- * Dumps always skip the first NBPG of disk space
+ * Dumps always skip the first PAGE_SIZE 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.
@@ -1509,7 +1509,7 @@
  * getting on the dump stack, either when called above, or by
  * the auto-restart code.
  */
-#define BYTES_PER_DUMP  NBPG   /* must be a multiple of pagesize XXX small */
+#define BYTES_PER_DUMP  PAGE_SIZE /* must be a multiple of pagesize XXX small */
 static vaddr_t dumpspace;
 
 vaddr_t
@@ -1772,14 +1772,6 @@
 
        consinit();     /* XXX SHOULD NOT BE DONE HERE */
 
-#if NBIOSCALL > 0
-       avail_start = 3*NBPG;   /* save us a page for trampoline code and
-                                  one additional PT page! */
-#else
-       avail_start = NBPG;     /* BIOS leaves data in low memory */
-                               /* and VM system doesn't work with phys 0 */
-#endif
-
        /*
         * Initailize PAGE_SIZE-dependent variables.
         */
@@ -1791,6 +1783,14 @@
        if (PAGE_SIZE != NBPG)
                panic("init386: PAGE_SIZE != NBPG");
 
+#if NBIOSCALL > 0
+       avail_start = 3*PAGE_SIZE; /* save us a page for trampoline code and
+                                     one additional PT page! */
+#else
+       avail_start = PAGE_SIZE; /* BIOS leaves data in low memory */
+                                /* and VM system doesn't work with phys 0 */
+#endif
+
        /*
         * Call pmap initialization to make new kernel address space.
         * We must do this before loading pages into the VM system.
@@ -2109,9 +2109,9 @@
 
 #if NBIOSCALL > 0
        /* install page 2 (reserved above) as PT page for first 4M */
-       pmap_enter(pmap_kernel(), (vaddr_t)vtopte(0), 2*NBPG,
+       pmap_enter(pmap_kernel(), (vaddr_t)vtopte(0), 2*PAGE_SIZE,
            VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED|VM_PROT_READ|VM_PROT_WRITE);
-       memset(vtopte(0), 0, NBPG);  /* make sure it is clean before using */
+       memset(vtopte(0), 0, PAGE_SIZE);/* make sure it is clean before using */
 #endif
 
        pmap_enter(pmap_kernel(), idt_vaddr, idt_paddr,
@@ -2403,7 +2403,7 @@
         * Try to cause a triple fault and watchdog reset by unmapping the
         * entire address space and doing a TLB flush.
         */
-       memset((caddr_t)PTD, 0, NBPG);
+       memset((caddr_t)PTD, 0, PAGE_SIZE);
        pmap_update(); 
 #endif
 
diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/mem.c
--- a/sys/arch/i386/i386/mem.c  Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/mem.c  Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mem.c,v 1.46 2000/06/29 08:44:52 mrg Exp $     */
+/*     $NetBSD: mem.c,v 1.47 2000/11/14 22:55:06 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -143,10 +143,10 @@
                        pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
                            trunc_page(v), prot, PMAP_WIRED|prot);
                        o = uio->uio_offset & PGOFSET;
-                       c = min(uio->uio_resid, (int)(NBPG - o));
+                       c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
                        error = uiomove((caddr_t)vmmap + o, c, uio);
                        pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
-                           (vaddr_t)vmmap + NBPG);
+                           (vaddr_t)vmmap + PAGE_SIZE);
                        break;
 
 /* minor device 1 is kernel memory */
@@ -173,10 +173,10 @@
                        }
                        if (zeropage == NULL) {
                                zeropage = (caddr_t)
-                                   malloc(NBPG, M_TEMP, M_WAITOK);
-                               memset(zeropage, 0, NBPG);
+                                   malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
+                               memset(zeropage, 0, PAGE_SIZE);
                        }
-                       c = min(iov->iov_len, NBPG);
+                       c = min(iov->iov_len, PAGE_SIZE);
                        error = uiomove(zeropage, c, uio);
                        break;
 
diff -r 297bf98fb61c -r e19a62599599 sys/arch/i386/i386/pmap.c
--- a/sys/arch/i386/i386/pmap.c Tue Nov 14 22:37:58 2000 +0000
+++ b/sys/arch/i386/i386/pmap.c Tue Nov 14 22:55:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.109 2000/10/08 22:59:38 thorpej Exp $       */
+/*     $NetBSD: pmap.c,v 1.110 2000/11/14 22:55:06 thorpej Exp $       */
 
 /*
  *
@@ -137,7 +137,7 @@
  *
  * [A] new process' page directory page (PDP)
  *     - plan 1: done at pmap_pinit() we use
- *       uvm_km_alloc(kernel_map, NBPG)  [fka kmem_alloc] to do this
+ *       uvm_km_alloc(kernel_map, PAGE_SIZE)  [fka kmem_alloc] to do this
  *       allocation.
  *
  * if we are low in free physical memory then we sleep in
@@ -646,7 +646,7 @@
  * => no need to lock anything
  * => caller must dispose of any vm_page mapped in the va range
  * => note: not an inline function
- * => we assume the va is page aligned and the len is a multiple of NBPG
+ * => we assume the va is page aligned and the len is a multiple of PAGE_SIZE
  * => we assume kernel only unmaps valid addresses and thus don't bother
  *    checking the valid bit before doing TLB flushing
  */
@@ -659,7 +659,7 @@
        pt_entry_t *pte;
 
        len >>= PAGE_SHIFT;
-       for ( /* null */ ; len ; len--, va += NBPG) {
+       for ( /* null */ ; len ; len--, va += PAGE_SIZE) {
                if (va < VM_MIN_KERNEL_ADDRESS)
                        pte = vtopte(va);
                else
@@ -704,7 +704,7 @@
 #endif
 
        for (lcv = 0 ; lcv < npgs ; lcv++) {
-               tva = va + lcv * NBPG;
+               tva = va + lcv * PAGE_SIZE;
                if (va < VM_MIN_KERNEL_ADDRESS)
                        pte = vtopte(tva);
                else
@@ -821,7 +821,7 @@
 
                /* add PG_G attribute to already mapped kernel pages */
                for (kva = VM_MIN_KERNEL_ADDRESS ; kva < virtual_avail ;
-                    kva += NBPG)
+                    kva += PAGE_SIZE)
                        if (pmap_valid_entry(PTE_BASE[i386_btop(kva)]))
                                PTE_BASE[i386_btop(kva)] |= PG_G;
        }
@@ -875,33 +875,33 @@



Home | Main Index | Thread Index | Old Index