Don't need a separate flags variable in armv7 pmap_clean_page() -
authortom <tom@openbsd.org>
Mon, 18 Jul 2016 13:38:11 +0000 (13:38 +0000)
committertom <tom@openbsd.org>
Mon, 18 Jul 2016 13:38:11 +0000 (13:38 +0000)
just use the pv_flags.  ('Twas a copy-paste from arm's pmap_clean_page(),
which did need it.)

Also remove even less used flags variable from pmap_page_remove().

First part from a diff from aalm@ - thanks

ok kettenis@ "looks good" patrick@

sys/arch/arm/arm/pmap7.c

index eea49fe..64a9ddb 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pmap7.c,v 1.25 2016/06/07 06:23:19 dlg Exp $  */
+/*     $OpenBSD: pmap7.c,v 1.26 2016/07/18 13:38:11 tom Exp $  */
 /*     $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $   */
 
 /*
@@ -1071,7 +1071,6 @@ pmap_clean_page(struct vm_page *pg, int isync)
        pmap_t pm;
        struct pv_entry *pv;
        boolean_t wb = FALSE;
-       uint flags = 0;
 
        /*
         * To save time, we are only walking the pv list if an I$ invalidation
@@ -1088,8 +1087,6 @@ pmap_clean_page(struct vm_page *pg, int isync)
                        if (pv->pv_pmap != pmap_kernel() && pv->pv_pmap != pm)
                                continue;
 
-                       flags |= pv->pv_flags;
-
                        /*
                         * The page is mapped non-cacheable in 
                         * this map.  No need to flush the cache.
@@ -1097,7 +1094,7 @@ pmap_clean_page(struct vm_page *pg, int isync)
                        if (pv->pv_flags & PVF_NC) /* XXX ought to be pg attr */
                                break;
 
-                       if (PV_BEEN_EXECD(flags))
+                       if (PV_BEEN_EXECD(pv->pv_flags))
                                cpu_icache_sync_range(pv->pv_va, PAGE_SIZE);
 
                        /*
@@ -1144,7 +1141,6 @@ pmap_page_remove(struct vm_page *pg)
        pmap_t pm, curpm;
        pt_entry_t *ptep, pte;
        boolean_t flush;
-       u_int flags;
 
        NPDEBUG(PDB_FOLLOW,
            printf("pmap_page_remove: pg %p (0x%08lx)\n", pg, pg->phys_addr));
@@ -1154,7 +1150,6 @@ pmap_page_remove(struct vm_page *pg)
                return;
 
        flush = FALSE;
-       flags = 0;
        if (curproc)
                curpm = curproc->p_vmspace->vm_map.pmap;
        else
@@ -1195,8 +1190,6 @@ pmap_page_remove(struct vm_page *pg)
                        if (pv->pv_flags & PVF_WIRED)
                                --pm->pm_stats.wired_count;
 
-                       flags |= pv->pv_flags;
-
                        /*
                         * Invalidate the PTEs.
                         */