Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc use pmap_k{enter_pa, remove}() where app...



details:   https://anonhg.NetBSD.org/src/rev/7b7a3c187986
branches:  trunk
changeset: 515716:7b7a3c187986
user:      chs <chs%NetBSD.org@localhost>
date:      Wed Oct 03 09:40:12 2001 +0000

description:
use pmap_k{enter_pa,remove}() where appropriate.

diffstat:

 sys/arch/sparc/sparc/autoconf.c |   6 +++---
 sys/arch/sparc/sparc/cpu.c      |   6 ++----
 sys/arch/sparc/sparc/iommu.c    |   8 +++-----
 sys/arch/sparc/sparc/machdep.c  |  37 ++++++++++++++++---------------------
 4 files changed, 24 insertions(+), 33 deletions(-)

diffs (193 lines):

diff -r c532c690bafa -r 7b7a3c187986 sys/arch/sparc/sparc/autoconf.c
--- a/sys/arch/sparc/sparc/autoconf.c   Wed Oct 03 09:37:23 2001 +0000
+++ b/sys/arch/sparc/sparc/autoconf.c   Wed Oct 03 09:40:12 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.154 2001/09/28 11:59:53 chs Exp $ */
+/*     $NetBSD: autoconf.c,v 1.155 2001/10/03 09:40:12 chs Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -330,9 +330,9 @@
 
        if (CPU_ISSUN4OR4C) {
                /* Map Interrupt Enable Register */
-               pmap_enter(pmap_kernel(), INTRREG_VA,
+               pmap_kenter_pa(INTRREG_VA,
                    INT_ENABLE_REG_PHYSADR | PMAP_NC | PMAP_OBIO,
-                   VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
+                   VM_PROT_READ | VM_PROT_WRITE);
                pmap_update(pmap_kernel());
                /* Disable all interrupts */
                *((unsigned char *)INTRREG_VA) = 0;
diff -r c532c690bafa -r 7b7a3c187986 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Wed Oct 03 09:37:23 2001 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Wed Oct 03 09:40:12 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.123 2001/09/26 20:53:08 eeh Exp $ */
+/*     $NetBSD: cpu.c,v 1.124 2001/10/03 09:40:12 chs Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -202,9 +202,7 @@
        /* Map the pages */
        for (m = TAILQ_FIRST(&mlist); m != NULL; m = TAILQ_NEXT(m, pageq)) {
                paddr_t pa = VM_PAGE_TO_PHYS(m);
-               pmap_enter(pmap_kernel(), va, pa,
-                   VM_PROT_READ|VM_PROT_WRITE,
-                   VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
+               pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE);
                va += NBPG;
        }
        pmap_update(pmap_kernel());
diff -r c532c690bafa -r 7b7a3c187986 sys/arch/sparc/sparc/iommu.c
--- a/sys/arch/sparc/sparc/iommu.c      Wed Oct 03 09:37:23 2001 +0000
+++ b/sys/arch/sparc/sparc/iommu.c      Wed Oct 03 09:40:12 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.58 2001/09/28 11:59:53 chs Exp $ */
+/*     $NetBSD: iommu.c,v 1.59 2001/10/03 09:40:12 chs Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -259,8 +259,7 @@
        /* Map the pages */
        for (; m != NULL; m = TAILQ_NEXT(m,pageq)) {
                paddr_t pa = VM_PAGE_TO_PHYS(m);
-               pmap_enter(pmap_kernel(), va, pa | PMAP_NC,
-                   VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(va, pa | PMAP_NC, VM_PROT_READ | VM_PROT_WRITE);
                va += NBPG;
        }
        pmap_update(pmap_kernel());
@@ -838,8 +837,7 @@
                        panic("iommu_dmamem_map: size botch");
 
                addr = VM_PAGE_TO_PHYS(m);
-               pmap_enter(pmap_kernel(), va, addr | cbit,
-                   VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(va, addr | cbit, VM_PROT_READ | VM_PROT_WRITE);
 #if 0
                        if (flags & BUS_DMA_COHERENT)
                                /* XXX */;
diff -r c532c690bafa -r 7b7a3c187986 sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c    Wed Oct 03 09:37:23 2001 +0000
+++ b/sys/arch/sparc/sparc/machdep.c    Wed Oct 03 09:40:12 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.186 2001/10/03 09:37:23 chs Exp $ */
+/*     $NetBSD: machdep.c,v 1.187 2001/10/03 09:40:12 chs Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -238,20 +238,18 @@
 
        /* Map first 8192 */
        while (va < va0 + 8192) {
-               pmap_enter(pmap_kernel(), va, pa,
-                          VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE);
                pa += PAGE_SIZE;
                va += PAGE_SIZE;
        }
        pmap_update(pmap_kernel());
 
        /* Map the rest of the pages */
-       for (m = TAILQ_FIRST(&mlist); m != NULL; m = TAILQ_NEXT(m,pageq)) {
+       TAILQ_FOREACH(m, &mlist ,pageq) {
                if (va >= va0 + size)
                        panic("cpu_start: memory buffer size botch");
                pa = VM_PAGE_TO_PHYS(m);
-               pmap_enter(pmap_kernel(), va, pa,
-                          VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE);
                va += PAGE_SIZE;
        }
        pmap_update(pmap_kernel());
@@ -323,7 +321,7 @@
                                panic("cpu_startup: "
                                    "not enough RAM for buffer cache");
                        pmap_kenter_pa(curbuf, VM_PAGE_TO_PHYS(pg),
-                                  VM_PROT_READ|VM_PROT_WRITE);
+                           VM_PROT_READ | VM_PROT_WRITE);
                        curbuf += PAGE_SIZE;
                        curbufsize -= PAGE_SIZE;
                }
@@ -1514,6 +1512,7 @@
 
        for (; buflen > 0; ) {
                paddr_t pa;
+
                /*
                 * Get the physical address for this page.
                 */
@@ -1532,9 +1531,8 @@
                        pa |= PG_IOC;
 #endif
 #endif
-               pmap_enter(pmap_kernel(), dva,
-                          (pa & -pagesz) | PMAP_NC,
-                          VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(dva, (pa & -pagesz) | PMAP_NC,
+                   VM_PROT_READ | VM_PROT_WRITE);
 
                dva += pagesz;
                va += sgsize;
@@ -1603,9 +1601,8 @@
                        pa |= PG_IOC;
 #endif
 #endif
-               pmap_enter(pmap_kernel(), dva,
-                          (pa & -pagesz) | PMAP_NC,
-                          VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(dva, (pa & -pagesz) | PMAP_NC,
+                   VM_PROT_READ | VM_PROT_WRITE);
 
                dva += pagesz;
                sgsize -= pagesz;
@@ -1645,7 +1642,7 @@
                dva = segs[i].ds_addr & -PAGE_SIZE;
                len = segs[i]._ds_sgsize;
 
-               pmap_remove(pmap_kernel(), dva, dva + len);
+               pmap_kremove(dva, len);
 
                if ((flags & BUS_DMA_24BIT) != 0) {
                        s = splhigh();
@@ -1694,15 +1691,14 @@
        *kvap = (caddr_t)va;
 
        mlist = segs[0]._ds_mlist;
-       for (m = TAILQ_FIRST(mlist); m != NULL; m = TAILQ_NEXT(m,pageq)) {
+       TAILQ_FOREACH(m, mlist, pageq) {
                paddr_t pa;
 
                if (size == 0)
                        panic("sun4_dmamem_map: size botch");
 
                pa = VM_PAGE_TO_PHYS(m);
-               pmap_enter(pmap_kernel(), va, pa | PMAP_NC,
-                          VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(va, pa | PMAP_NC, VM_PROT_READ | VM_PROT_WRITE);
 
                va += PAGE_SIZE;
                size -= PAGE_SIZE;
@@ -1792,8 +1788,8 @@
        pmtype = PMAP_IOENC(iospace);
 
        do {
-               pmap_enter(pmap_kernel(), v, pa | pmtype | PMAP_NC,
-                          VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(v, pa | pmtype | PMAP_NC,
+                   VM_PROT_READ | VM_PROT_WRITE);
                v += PAGE_SIZE;
                pa += PAGE_SIZE;
        } while ((size -= PAGE_SIZE) > 0);
@@ -1808,9 +1804,8 @@
        bus_space_handle_t bh;
 {
        vaddr_t va = trunc_page((vaddr_t)bh);
-       vaddr_t endva = va + round_page(size);
 
-       pmap_remove(pmap_kernel(), va, endva);
+       pmap_kremove(va, round_page(size));
        pmap_update(pmap_kernel());
        return (0);
 }



Home | Main Index | Thread Index | Old Index