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 Fix build... wire_count probably do...



details:   https://anonhg.NetBSD.org/src/rev/3f98bd89e4ad
branches:  trunk
changeset: 967549:3f98bd89e4ad
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Dec 14 13:48:09 2019 +0000

description:
Fix build... wire_count probably doesn't need atomics

diffstat:

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

diffs (74 lines):

diff -r fb083ef003af -r 3f98bd89e4ad sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Sat Dec 14 13:36:14 2019 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Sat Dec 14 13:48:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.52 2019/12/13 08:11:12 skrll Exp $  */
+/*     $NetBSD: pmap.c,v 1.53 2019/12/14 13:48:09 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.52 2019/12/13 08:11:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.53 2019/12/14 13:48:09 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -655,7 +655,7 @@
                /* unlink from parent */
                opte = atomic_swap_64(ptep_in_parent, 0);
                KASSERT(lxpde_valid(opte));
-               wirecount = atomic_add_16_nv(&pg->wire_count, -1); /* 1 -> 0 */
+               wirecount = atomic_add_32_nv(&pg->wire_count, -1); /* 1 -> 0 */
                KASSERT(wirecount == 0);
                pmap_free_pdp(pm, pg);
                nsweep++;
@@ -670,7 +670,7 @@
                KASSERTMSG(pg->wire_count >= 1,
                    "wire_count=%d", pg->wire_count);
                /* decrement wire_count of parent */
-               wirecount = atomic_add_16_nv(&pg->wire_count, -1);
+               wirecount = atomic_add_32_nv(&pg->wire_count, -1);
                KASSERTMSG(pg->wire_count <= (Ln_ENTRIES + 1),
                    "pm=%p[%d], pg=%p, wire_count=%d",
                    pm, pm->pm_asid, pg, pg->wire_count);
@@ -1443,8 +1443,8 @@
                pg = PHYS_TO_VM_PAGE(pdppa);
        KASSERT(pg != NULL);
 
-       CTASSERT(sizeof(pg->wire_count) == sizeof(uint16_t));
-       atomic_add_16(&pg->wire_count, 1);
+       CTASSERT(sizeof(pg->wire_count) == sizeof(uint32_t));
+       atomic_add_32(&pg->wire_count, 1);
 
        KASSERTMSG(pg->wire_count <= (Ln_ENTRIES + 1),
            "pg=%p, wire_count=%d", pg, pg->wire_count);
@@ -1473,7 +1473,7 @@
        pg = PHYS_TO_VM_PAGE(pdppa);
        KASSERT(pg != NULL);
 
-       wirecount = atomic_add_16_nv(&pg->wire_count, -1);
+       wirecount = atomic_add_32_nv(&pg->wire_count, -1);
 
        if (!do_free_pdp) {
                /*
@@ -1501,7 +1501,7 @@
                /* unlink from parent */
                opte = atomic_swap_64(ptep_in_parent, 0);
                KASSERT(lxpde_valid(opte));
-               wirecount = atomic_add_16_nv(&pg->wire_count, -1); /* 1 -> 0 */
+               wirecount = atomic_add_32_nv(&pg->wire_count, -1); /* 1 -> 0 */
                KASSERT(wirecount == 0);
                pmap_free_pdp(pm, pg);
                removed = true;
@@ -1516,7 +1516,7 @@
                KASSERTMSG(pg->wire_count >= 1,
                    "wire_count=%d", pg->wire_count);
                /* decrement wire_count of parent */
-               wirecount = atomic_add_16_nv(&pg->wire_count, -1);
+               wirecount = atomic_add_32_nv(&pg->wire_count, -1);
                KASSERTMSG(pg->wire_count <= (Ln_ENTRIES + 1),
                    "pm=%p[%d], pg=%p, wire_count=%d",
                    pm, pm->pm_asid, pg, pg->wire_count);



Home | Main Index | Thread Index | Old Index