tech-kern archive

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

patch: move PMAP_KMPAGE into flags



Hi!

Attached is a patch which moves PMAP_KMPAGE into the
flags argument of pmap_kenter_pa.

Any comments?

Christoph

Index: sys/arch/arm/arm32/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/arm32/pmap.c,v
retrieving revision 1.212
diff -u -p -r1.212 pmap.c
--- sys/arch/arm/arm32/pmap.c   15 Feb 2010 07:55:33 -0000      1.212
+++ sys/arch/arm/arm32/pmap.c   13 May 2010 15:28:45 -0000
@@ -3318,7 +3318,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
        struct l2_bucket *l2b;
        pt_entry_t *ptep, opte;
 #ifdef PMAP_CACHE_VIVT
-       struct vm_page *pg = (prot & PMAP_KMPAGE) ? PHYS_TO_VM_PAGE(pa) : NULL;
+       struct vm_page *pg = (flags & PMAP_KMPAGE) ? PHYS_TO_VM_PAGE(pa) : NULL;
 #endif
 #ifdef PMAP_CACHE_VIPT
        struct vm_page *pg = PHYS_TO_VM_PAGE(pa);
@@ -3346,7 +3346,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
                if (opg) {
                        KASSERT(opg != pg);
                        KASSERT((opg->mdpage.pvh_attrs & PVF_KMPAGE) == 0);
-                       KASSERT((prot & PMAP_KMPAGE) == 0);
+                       KASSERT((flags & PMAP_KMPAGE) == 0);
                        simple_lock(&opg->mdpage.pvh_slock);
                        pv = pmap_kremove_pg(opg, va);
                        simple_unlock(&opg->mdpage.pvh_slock);
@@ -3366,7 +3366,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
        PTE_SYNC(ptep);
 
        if (pg) {
-               if (prot & PMAP_KMPAGE) {
+               if (flags & PMAP_KMPAGE) {
                        simple_lock(&pg->mdpage.pvh_slock);
                        KASSERT(pg->mdpage.urw_mappings == 0);
                        KASSERT(pg->mdpage.uro_mappings == 0);
@@ -4769,7 +4769,7 @@ pmap_grow_map(vaddr_t va, pt_entry_t cac
                 */
                KASSERT(SLIST_EMPTY(&pg->mdpage.pvh_list));
                pmap_kenter_pa(va, pa,
-                   VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
+                   VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
 #endif
        }
 
@@ -5457,7 +5457,7 @@ pmap_postinit(void)
                        paddr_t pa = VM_PAGE_TO_PHYS(m);
 
                        pmap_kenter_pa(va, pa,
-                           VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
+                           VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
 
                        /*
                         * Make sure the L1 descriptor table is mapped
Index: sys/kern/kern_malloc_debug.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_malloc_debug.c,v
retrieving revision 1.22
diff -u -p -r1.22 kern_malloc_debug.c
--- sys/kern/kern_malloc_debug.c        7 Nov 2009 07:27:49 -0000       1.22
+++ sys/kern/kern_malloc_debug.c        13 May 2010 15:28:52 -0000
@@ -156,7 +156,7 @@ debug_malloc(unsigned long size, struct 
        splx(s);
 
        pmap_kenter_pa(md->md_va, md->md_pa,
-           VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
+           VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
        pmap_update(pmap_kernel());
 
        md->md_size = size;
Index: sys/uvm/uvm_km.c
===================================================================
RCS file: /cvsroot/src/sys/uvm/uvm_km.c,v
retrieving revision 1.105
diff -u -p -r1.105 uvm_km.c
--- sys/uvm/uvm_km.c    8 Feb 2010 19:02:33 -0000       1.105
+++ sys/uvm/uvm_km.c    13 May 2010 15:28:53 -0000
@@ -626,7 +626,7 @@ uvm_km_alloc(struct vm_map *map, vsize_t
                 */
 
                pmap_kenter_pa(loopva, VM_PAGE_TO_PHYS(pg),
-                   prot | PMAP_KMPAGE, 0);
+                   prot, PMAP_KMPAGE);
                loopva += PAGE_SIZE;
                offset += PAGE_SIZE;
                loopsize -= PAGE_SIZE;
@@ -711,7 +711,7 @@ again:
                }
        }
        pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
-           VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
+           VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
        pmap_update(pmap_kernel());
 
        return va;
Index: sys/uvm/uvm_kmguard.c
===================================================================
RCS file: /cvsroot/src/sys/uvm/uvm_kmguard.c,v
retrieving revision 1.2
diff -u -p -r1.2 uvm_kmguard.c
--- sys/uvm/uvm_kmguard.c       7 Nov 2009 07:27:49 -0000       1.2
+++ sys/uvm/uvm_kmguard.c       13 May 2010 15:28:53 -0000
@@ -150,7 +150,7 @@ uvm_kmguard_alloc(struct uvm_kmguard *kg
        pg->flags &= ~PG_BUSY;  /* new page */
        UVM_PAGE_OWN(pg, NULL);
        pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
-           VM_PROT_READ | VM_PROT_WRITE | PMAP_KMPAGE, 0);
+           VM_PROT_READ | VM_PROT_WRITE, PMAP_KMPAGE);
                pmap_update(pmap_kernel());
 
        /*
Index: sys/uvm/uvm_map.c
===================================================================
RCS file: /cvsroot/src/sys/uvm/uvm_map.c,v
retrieving revision 1.290
diff -u -p -r1.290 uvm_map.c
--- sys/uvm/uvm_map.c   21 Feb 2010 13:17:50 -0000      1.290
+++ sys/uvm/uvm_map.c   13 May 2010 15:28:53 -0000
@@ -4729,7 +4729,7 @@ again:
        va = args.uma_start;
 
        pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
-           VM_PROT_READ|VM_PROT_WRITE|PMAP_KMPAGE, 0);
+           VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE);
        pmap_update(vm_map_pmap(map));
 
 #endif


Home | Main Index | Thread Index | Old Index