Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 pmap_page_remove: simply and reduce...



details:   https://anonhg.NetBSD.org/src/rev/bbb8a7215716
branches:  trunk
changeset: 985886:bbb8a7215716
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Sep 12 08:23:57 2021 +0000

description:
pmap_page_remove: simply and reduce the code size slightly.

diffstat:

 sys/arch/aarch64/aarch64/pmap.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r e7f14aa77d1a -r bbb8a7215716 sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Sun Sep 12 08:03:48 2021 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Sun Sep 12 08:23:57 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.110 2021/09/09 08:12:27 skrll Exp $ */
+/*     $NetBSD: pmap.c,v 1.111 2021/09/12 08:23:57 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 2021/09/09 08:12:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.111 2021/09/12 08:23:57 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -2213,19 +2213,19 @@
                        continue;
                }
                opte = atomic_swap_64(pv->pv_ptep, 0);
+               const vaddr_t va = trunc_page(pv->pv_va);
                if (lxpde_valid(opte)) {
-                       _pmap_pdp_delref(pv->pv_pmap,
+                       _pmap_pdp_delref(pm,
                            AARCH64_KVA_TO_PA(trunc_page(
                            (vaddr_t)pv->pv_ptep)), false);
-                       AARCH64_TLBI_BY_ASID_VA(pv->pv_pmap->pm_asid,
-                           trunc_page(pv->pv_va), true);
+                       AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true);
 
                        if ((opte & LX_BLKPAG_OS_WIRED) != 0) {
-                               _pmap_adj_wired_count(pv->pv_pmap, -1);
+                               _pmap_adj_wired_count(pm, -1);
                        }
-                       _pmap_adj_resident_count(pv->pv_pmap, -1);
+                       _pmap_adj_resident_count(pm, -1);
                }
-               pvtmp = _pmap_remove_pv(pp, pm, trunc_page(pv->pv_va), opte);
+               pvtmp = _pmap_remove_pv(pp, pm, va, opte);
                if (pvtmp == NULL) {
                        KASSERT(pv == &pp->pp_pv);
                } else {



Home | Main Index | Thread Index | Old Index