Source-Changes-HG archive

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

[src/trunk]: src/sys Add a new `access type' argument to pmap_enter(). This ...



details:   https://anonhg.NetBSD.org/src/rev/2c4b72069613
branches:  trunk
changeset: 467637:2c4b72069613
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Fri Mar 26 21:58:39 1999 +0000

description:
Add a new `access type' argument to pmap_enter().  This indicates what type of
memory access a mapping was caused by.  This is passed through from uvm_fault()
and udv_fault(), and in most other cases is 0.
The pmap module may use this to preset R/M information.  On MMUs which require
R/M emulation, the implementation may preset the bits and avoid taking another
fault.  On MMUs which keep R/M information in hardware, the implementation may
preset its cached bits to speed up the next call to pmap_is_modified() or
pmap_is_referenced().

diffstat:

 sys/uvm/uvm_device.c |   5 +++--
 sys/uvm/uvm_fault.c  |  13 +++++++------
 sys/uvm/uvm_glue.c   |   4 ++--
 sys/uvm/uvm_km.c     |   6 +++---
 sys/uvm/uvm_page.c   |   5 +++--
 sys/uvm/uvm_pager.c  |   4 ++--
 sys/vm/pmap.h        |   4 ++--
 7 files changed, 22 insertions(+), 19 deletions(-)

diffs (174 lines):

diff -r e1e3ce4be05a -r 2c4b72069613 sys/uvm/uvm_device.c
--- a/sys/uvm/uvm_device.c      Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/uvm/uvm_device.c      Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_device.c,v 1.14 1999/03/25 18:48:50 mrg Exp $      */
+/*     $NetBSD: uvm_device.c,v 1.15 1999/03/26 21:58:39 mycroft Exp $  */
 
 /*
  *
@@ -476,7 +476,8 @@
                UVMHIST_LOG(maphist,
                    "  MAPPING: device: pm=0x%x, va=0x%x, pa=0x%x, at=%d",
                    ufi->orig_map->pmap, curr_va, (int)paddr, access_type);
-               pmap_enter(ufi->orig_map->pmap, curr_va, paddr, access_type, 0);
+               pmap_enter(ufi->orig_map->pmap, curr_va, paddr, access_type, 0,
+                   access_type);
 
        }
 
diff -r e1e3ce4be05a -r 2c4b72069613 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/uvm/uvm_fault.c       Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.c,v 1.22 1999/03/26 17:34:16 chs Exp $       */
+/*     $NetBSD: uvm_fault.c,v 1.23 1999/03/26 21:58:39 mycroft Exp $   */
 
 /*
  *
@@ -648,7 +648,7 @@
                         * ensure that we pmap_enter page R/O since
                         * needs_copy is still true
                         */
-                       enter_prot = enter_prot & ~VM_PROT_WRITE; 
+                       enter_prot &= ~VM_PROT_WRITE; 
 
                }
        }
@@ -819,7 +819,7 @@
                        pmap_enter(ufi.orig_map->pmap, currva,
                            VM_PAGE_TO_PHYS(anon->u.an_page),
                            (anon->an_ref > 1) ? VM_PROT_READ : enter_prot, 
-                           (ufi.entry->wired_count != 0));
+                           (ufi.entry->wired_count != 0), 0);
                }
                simple_unlock(&anon->an_lock);
        }
@@ -947,7 +947,8 @@
                                pmap_enter(ufi.orig_map->pmap, currva,
                                    VM_PAGE_TO_PHYS(pages[lcv]),
                                    UVM_ET_ISCOPYONWRITE(ufi.entry) ?
-                                   VM_PROT_READ : enter_prot, wired);
+                                   VM_PROT_READ : enter_prot, wired,
+                                   access_type);
 
                                /* 
                                 * NOTE: page can't be PG_WANTED or PG_RELEASED
@@ -1202,7 +1203,7 @@
        UVMHIST_LOG(maphist, "  MAPPING: anon: pm=0x%x, va=0x%x, pg=0x%x",
            ufi.orig_map->pmap, ufi.orig_rvaddr, pg, 0);
        pmap_enter(ufi.orig_map->pmap, ufi.orig_rvaddr, VM_PAGE_TO_PHYS(pg),
-           enter_prot, wired);
+           enter_prot, wired, access_type);
 
        /*
         * ... and update the page queues.
@@ -1630,7 +1631,7 @@
            "  MAPPING: case2: pm=0x%x, va=0x%x, pg=0x%x, promote=%d",
            ufi.orig_map->pmap, ufi.orig_rvaddr, pg, promote);
        pmap_enter(ufi.orig_map->pmap, ufi.orig_rvaddr, VM_PAGE_TO_PHYS(pg),
-           enter_prot, wired);
+           enter_prot, wired, access_type);
 
        uvm_lock_pageq();
 
diff -r e1e3ce4be05a -r 2c4b72069613 sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c        Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/uvm/uvm_glue.c        Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_glue.c,v 1.17 1999/03/25 18:48:51 mrg Exp $        */
+/*     $NetBSD: uvm_glue.c,v 1.18 1999/03/26 21:58:39 mycroft Exp $    */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -211,7 +211,7 @@
                pa = pmap_extract(pmap_kernel(), sva|1);
                if (pa == 0)
                        panic("chgkprot: invalid page");
-               pmap_enter(pmap_kernel(), sva, pa&~1, prot, TRUE);
+               pmap_enter(pmap_kernel(), sva, pa&~1, prot, TRUE, 0);
        }
 }
 #endif
diff -r e1e3ce4be05a -r 2c4b72069613 sys/uvm/uvm_km.c
--- a/sys/uvm/uvm_km.c  Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/uvm/uvm_km.c  Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_km.c,v 1.21 1999/03/26 17:34:16 chs Exp $  */
+/*     $NetBSD: uvm_km.c,v 1.22 1999/03/26 21:58:39 mycroft Exp $      */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -732,7 +732,7 @@
                pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg), VM_PROT_ALL);
 #else
                pmap_enter(map->pmap, loopva, VM_PAGE_TO_PHYS(pg),
-                   UVM_PROT_ALL, TRUE);
+                   UVM_PROT_ALL, TRUE, 0);
 #endif
                loopva += PAGE_SIZE;
                offset += PAGE_SIZE;
@@ -865,7 +865,7 @@
                pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg), UVM_PROT_ALL);
 #else
                pmap_enter(map->pmap, loopva, VM_PAGE_TO_PHYS(pg),
-                   UVM_PROT_ALL, TRUE);
+                   UVM_PROT_ALL, TRUE, 0);
 #endif
                loopva += PAGE_SIZE;
                offset += PAGE_SIZE;
diff -r e1e3ce4be05a -r 2c4b72069613 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/uvm/uvm_page.c        Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.16 1999/03/25 18:48:53 mrg Exp $        */
+/*     $NetBSD: uvm_page.c,v 1.17 1999/03/26 21:58:39 mycroft Exp $    */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -426,7 +426,8 @@
                pmap_kenter_pa(vaddr, paddr, VM_PROT_READ|VM_PROT_WRITE);
 #else
                pmap_enter(pmap_kernel(), vaddr, paddr,
-                   VM_PROT_READ|VM_PROT_WRITE, FALSE);
+                   VM_PROT_READ|VM_PROT_WRITE, FALSE,
+                   VM_PROT_READ|VM_PROT_WRITE);
 #endif
 
        }
diff -r e1e3ce4be05a -r 2c4b72069613 sys/uvm/uvm_pager.c
--- a/sys/uvm/uvm_pager.c       Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/uvm/uvm_pager.c       Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pager.c,v 1.15 1999/03/25 18:48:55 mrg Exp $       */
+/*     $NetBSD: uvm_pager.c,v 1.16 1999/03/26 21:58:39 mycroft Exp $   */
 
 /*
  *
@@ -185,7 +185,7 @@
 #endif
 
                pmap_enter(vm_map_pmap(pager_map), cva, VM_PAGE_TO_PHYS(pp),
-                   VM_PROT_DEFAULT, TRUE);
+                   VM_PROT_DEFAULT, TRUE, 0);
        }
 
 #endif /* PMAP_NEW */
diff -r e1e3ce4be05a -r 2c4b72069613 sys/vm/pmap.h
--- a/sys/vm/pmap.h     Fri Mar 26 21:18:49 1999 +0000
+++ b/sys/vm/pmap.h     Fri Mar 26 21:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.28 1999/01/16 20:00:28 chuck Exp $  */
+/*     $NetBSD: pmap.h,v 1.29 1999/03/26 21:58:39 mycroft Exp $        */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -143,7 +143,7 @@
 #endif
 void            pmap_destroy __P((pmap_t));
 void            pmap_enter __P((pmap_t,
-                   vaddr_t, paddr_t, vm_prot_t, boolean_t));
+                   vaddr_t, paddr_t, vm_prot_t, boolean_t, vm_prot_t));
 paddr_t                pmap_extract __P((pmap_t, vaddr_t));
 #if defined(PMAP_NEW) && defined(PMAP_GROWKERNEL)
 void            pmap_growkernel __P((vaddr_t));



Home | Main Index | Thread Index | Old Index