Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm/pmap Rename pmap_segtab_t *stp to stb for consistenc...



details:   https://anonhg.NetBSD.org/src/rev/f669f444af69
branches:  trunk
changeset: 370710:f669f444af69
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Sep 25 06:21:58 2022 +0000

description:
Rename pmap_segtab_t *stp to stb for consistency with a future
pmap_pdetab_t *ptb. pmap_pdetab_t *ptp would be far too confusing.

NFC. Same code before and after.

diffstat:

 sys/arch/mips/mips/pmap_machdep.c   |   20 ++--
 sys/arch/powerpc/booke/booke_pmap.c |   12 +-
 sys/arch/powerpc/booke/trap.c       |   12 +-
 sys/uvm/pmap/pmap_segtab.c          |  132 ++++++++++++++++++------------------
 4 files changed, 88 insertions(+), 88 deletions(-)

diffs (truncated from 441 to 300 lines):

diff -r 8aea738430fb -r f669f444af69 sys/arch/mips/mips/pmap_machdep.c
--- a/sys/arch/mips/mips/pmap_machdep.c Sun Sep 25 00:48:37 2022 +0000
+++ b/sys/arch/mips/mips/pmap_machdep.c Sun Sep 25 06:21:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_machdep.c,v 1.36 2021/10/02 14:28:04 skrll Exp $  */
+/*     $NetBSD: pmap_machdep.c,v 1.37 2022/09/25 06:21:58 skrll Exp $  */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.36 2021/10/02 14:28:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.37 2022/09/25 06:21:58 skrll Exp $");
 
 /*
  *     Manages physical address maps.
@@ -444,23 +444,23 @@
        if (xsegs > 1) {
                printf("%s: %zu xsegs required for %zu pages\n",
                    __func__, xsegs, sysmap_size);
-               pmap_segtab_t *stp = (pmap_segtab_t *)
+               pmap_segtab_t *stb = (pmap_segtab_t *)
                    uvm_pageboot_alloc(sizeof(pmap_segtab_t) * (xsegs - 1));
-               for (size_t i = 1; i <= xsegs; i++, stp++) {
-                       pmap_kern_segtab.seg_seg[i] = stp;
+               for (size_t i = 1; i <= xsegs; i++, stb++) {
+                       pmap_kern_segtab.seg_seg[i] = stb;
                }
        }
-       pmap_segtab_t ** const xstp = pmap_kern_segtab.seg_seg;
+       pmap_segtab_t ** const xstb = pmap_kern_segtab.seg_seg;
 #else
        const size_t xsegs = 1;
-       pmap_segtab_t * const stp = &pmap_kern_segtab;
+       pmap_segtab_t * const stb = &pmap_kern_segtab;
 #endif
        KASSERT(curcpu()->ci_pmap_kern_segtab == &pmap_kern_segtab);
 
        for (size_t k = 0, i = 0; k < xsegs; k++) {
 #ifdef _LP64
-               pmap_segtab_t * const stp =
-                   xstp[(va >> XSEGSHIFT) & (NSEGPG - 1)];
+               pmap_segtab_t * const stb =
+                   xstb[(va >> XSEGSHIFT) & (NSEGPG - 1)];
 #endif
                bool done = false;
 
@@ -470,7 +470,7 @@
                        /*
                         * Now set the page table pointer...
                         */
-                       stp->seg_tab[j] = &sysmap[i];
+                       stb->seg_tab[j] = &sysmap[i];
 #ifdef _LP64
                        /*
                         * If we are at end of this XSEG, terminate the loop
diff -r 8aea738430fb -r f669f444af69 sys/arch/powerpc/booke/booke_pmap.c
--- a/sys/arch/powerpc/booke/booke_pmap.c       Sun Sep 25 00:48:37 2022 +0000
+++ b/sys/arch/powerpc/booke/booke_pmap.c       Sun Sep 25 06:21:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: booke_pmap.c,v 1.34 2021/10/02 14:28:04 skrll Exp $    */
+/*     $NetBSD: booke_pmap.c,v 1.35 2022/09/25 06:21:58 skrll Exp $    */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __PMAP_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.34 2021/10/02 14:28:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.35 2022/09/25 06:21:58 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -125,9 +125,9 @@
 
 #ifdef PMAP_MINIMALTLB
 static pt_entry_t *
-kvtopte(const pmap_segtab_t *stp, vaddr_t va)
+kvtopte(const pmap_segtab_t *stb, vaddr_t va)
 {
-       pt_entry_t * const ptep = stp->seg_tab[va >> SEGSHIFT];
+       pt_entry_t * const ptep = stb->seg_tab[va >> SEGSHIFT];
        if (ptep == NULL)
                return NULL;
        return &ptep[(va & SEGOFSET) >> PAGE_SHIFT];
@@ -136,9 +136,9 @@
 vaddr_t
 pmap_kvptefill(vaddr_t sva, vaddr_t eva, pt_entry_t pt_entry)
 {
-       pmap_segtab_t * const stp = &pmap_kern_segtab;
+       pmap_segtab_t * const stb = &pmap_kern_segtab;
        KASSERT(sva == trunc_page(sva));
-       pt_entry_t *ptep = kvtopte(stp, sva);
+       pt_entry_t *ptep = kvtopte(stb, sva);
        for (; sva < eva; sva += NBPG) {
                *ptep++ = pt_entry ? (sva | pt_entry) : 0;
        }
diff -r 8aea738430fb -r f669f444af69 sys/arch/powerpc/booke/trap.c
--- a/sys/arch/powerpc/booke/trap.c     Sun Sep 25 00:48:37 2022 +0000
+++ b/sys/arch/powerpc/booke/trap.c     Sun Sep 25 06:21:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.37 2021/03/06 08:08:19 rin Exp $    */
+/*     $NetBSD: trap.c,v 1.38 2022/09/25 06:21:58 skrll Exp $  */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.37 2021/03/06 08:08:19 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.38 2022/09/25 06:21:58 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -144,11 +144,11 @@
 static inline pt_entry_t *
 trap_pte_lookup(struct trapframe *tf, vaddr_t va, register_t psl_mask)
 {
-       pmap_segtab_t ** const stps = &curcpu()->ci_pmap_kern_segtab;
-       pmap_segtab_t * const stp = stps[(tf->tf_srr1 / psl_mask) & 1];
-       if (__predict_false(stp == NULL))
+       pmap_segtab_t ** const stbs = &curcpu()->ci_pmap_kern_segtab;
+       pmap_segtab_t * const stb = stbs[(tf->tf_srr1 / psl_mask) & 1];
+       if (__predict_false(stb == NULL))
                return NULL;
-       pt_entry_t * const ptep = stp->seg_tab[va >> SEGSHIFT];
+       pt_entry_t * const ptep = stb->seg_tab[va >> SEGSHIFT];
        if (__predict_false(ptep == NULL))
                return NULL;
        return ptep + ((va & SEGOFSET) >> PAGE_SHIFT);
diff -r 8aea738430fb -r f669f444af69 sys/uvm/pmap/pmap_segtab.c
--- a/sys/uvm/pmap/pmap_segtab.c        Sun Sep 25 00:48:37 2022 +0000
+++ b/sys/uvm/pmap/pmap_segtab.c        Sun Sep 25 06:21:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_segtab.c,v 1.27 2021/03/13 15:29:55 skrll Exp $   */
+/*     $NetBSD: pmap_segtab.c,v 1.28 2022/09/25 06:21:58 skrll Exp $   */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.27 2021/03/13 15:29:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.28 2022/09/25 06:21:58 skrll Exp $");
 
 /*
  *     Manages physical address maps.
@@ -134,7 +134,7 @@
 /*
  * Check that a seg_tab[] array is empty.
  *
- * This is used when allocating or freeing a pmap_segtab_t.  The stp
+ * This is used when allocating or freeing a pmap_segtab_t.  The stb
  * should be unused -- meaning, none of the seg_tab[] pointers are
  * not NULL, as it transitions from either freshly allocated segtab from
  * pmap pool, an unused allocated page segtab alloc from the SMP case,
@@ -143,23 +143,23 @@
  * also frees a freshly allocated but unused entry.
  */
 static void
-pmap_check_stp(pmap_segtab_t *stp, const char *caller, const char *why)
+pmap_check_stb(pmap_segtab_t *stb, const char *caller, const char *why)
 {
 #ifdef DEBUG
        for (size_t i = 0; i < PMAP_SEGTABSIZE; i++) {
-               if (stp->seg_tab[i] != NULL) {
+               if (stb->seg_tab[i] != NULL) {
 #define DEBUG_NOISY
 #ifdef DEBUG_NOISY
                        UVMHIST_FUNC(__func__);
-                       UVMHIST_CALLARGS(pmapsegtabhist, "stp=%#jx",
-                           (uintptr_t)stp, 0, 0, 0);
+                       UVMHIST_CALLARGS(pmapsegtabhist, "stb=%#jx",
+                           (uintptr_t)stb, 0, 0, 0);
                        for (size_t j = i; j < PMAP_SEGTABSIZE; j++)
-                               if (stp->seg_tab[j] != NULL)
-                                       printf("%s: stp->seg_tab[%zu] = %p\n",
-                                           caller, j, stp->seg_tab[j]);
+                               if (stb->seg_tab[j] != NULL)
+                                       printf("%s: stb->seg_tab[%zu] = %p\n",
+                                           caller, j, stb->seg_tab[j]);
 #endif
                        panic("%s: pm_segtab.seg_tab[%zu] != 0 (%p): %s",
-                           caller, i, stp->seg_tab[i], why);
+                           caller, i, stb->seg_tab[i], why);
                }
        }
 #endif
@@ -216,16 +216,16 @@
 static inline pt_entry_t *
 pmap_segmap(struct pmap *pmap, vaddr_t va)
 {
-       pmap_segtab_t *stp = pmap->pm_segtab;
+       pmap_segtab_t *stb = pmap->pm_segtab;
        KASSERTMSG(pmap != pmap_kernel() || !pmap_md_direct_mapped_vaddr_p(va),
            "pmap %p va %#" PRIxVADDR, pmap, va);
 #ifdef _LP64
-       stp = stp->seg_seg[(va >> XSEGSHIFT) & (NSEGPG - 1)];
-       if (stp == NULL)
+       stb = stb->seg_seg[(va >> XSEGSHIFT) & (NSEGPG - 1)];
+       if (stb == NULL)
                return NULL;
 #endif
 
-       return stp->seg_tab[(va >> SEGSHIFT) & (PMAP_SEGTABSIZE - 1)];
+       return stb->seg_tab[(va >> SEGSHIFT) & (PMAP_SEGTABSIZE - 1)];
 }
 
 pt_entry_t *
@@ -242,29 +242,29 @@
  * Insert the segtab into the segtab freelist.
  */
 static void
-pmap_segtab_free(pmap_segtab_t *stp)
+pmap_segtab_free(pmap_segtab_t *stb)
 {
        UVMHIST_FUNC(__func__);
 
-       UVMHIST_CALLARGS(pmapsegtabhist, "stp=%#jx", (uintptr_t)stp, 0, 0, 0);
+       UVMHIST_CALLARGS(pmapsegtabhist, "stb=%#jx", (uintptr_t)stb, 0, 0, 0);
 
        mutex_spin_enter(&pmap_segtab_lock);
-       stp->seg_seg[0] = pmap_segtab_info.free_segtab;
-       pmap_segtab_info.free_segtab = stp;
+       stb->seg_seg[0] = pmap_segtab_info.free_segtab;
+       pmap_segtab_info.free_segtab = stb;
        SEGTAB_ADD(nput, 1);
        mutex_spin_exit(&pmap_segtab_lock);
 }
 
 static void
-pmap_segtab_release(pmap_t pmap, pmap_segtab_t **stp_p, bool free_stp,
+pmap_segtab_release(pmap_t pmap, pmap_segtab_t **stb_p, bool free_stb,
        pte_callback_t callback, uintptr_t flags,
        vaddr_t va, vsize_t vinc)
 {
-       pmap_segtab_t *stp = *stp_p;
+       pmap_segtab_t *stb = *stb_p;
 
        UVMHIST_FUNC(__func__);
-       UVMHIST_CALLARGS(pmapsegtabhist, "pm=%#jx stpp=%#jx free=%jd",
-           (uintptr_t)pmap, (uintptr_t)stp_p, free_stp, 0);
+       UVMHIST_CALLARGS(pmapsegtabhist, "pm=%#jx stb_p=%#jx free=%jd",
+           (uintptr_t)pmap, (uintptr_t)stb_p, free_stb, 0);
        UVMHIST_LOG(pmapsegtabhist, " callback=%#jx flags=%#jx va=%#jx vinc=%#jx",
            (uintptr_t)callback, flags, (uintptr_t)va, (uintptr_t)vinc);
        for (size_t i = (va / vinc) & (PMAP_SEGTABSIZE - 1);
@@ -272,12 +272,12 @@
             i++, va += vinc) {
 #ifdef _LP64
                if (vinc > NBSEG) {
-                       if (stp->seg_seg[i] != NULL) {
+                       if (stb->seg_seg[i] != NULL) {
                                UVMHIST_LOG(pmapsegtabhist,
                                    " recursing %jd", i, 0, 0, 0);
-                               pmap_segtab_release(pmap, &stp->seg_seg[i],
+                               pmap_segtab_release(pmap, &stb->seg_seg[i],
                                    true, callback, flags, va, vinc / NSEGPG);
-                               KASSERT(stp->seg_seg[i] == NULL);
+                               KASSERT(stb->seg_seg[i] == NULL);
                        }
                        continue;
                }
@@ -285,7 +285,7 @@
                KASSERT(vinc == NBSEG);
 
                /* get pointer to segment map */
-               pt_entry_t *pte = stp->seg_tab[i];
+               pt_entry_t *pte = stb->seg_tab[i];
                if (pte == NULL)
                        continue;
                pmap_check_ptes(pte, __func__);
@@ -308,15 +308,15 @@
                uvm_pagefree(pg);
 #endif
 
-               stp->seg_tab[i] = NULL;
+               stb->seg_tab[i] = NULL;
                UVMHIST_LOG(pmapsegtabhist, " zeroing tab[%jd]", i, 0, 0, 0);
        }
 
-       if (free_stp) {
-               pmap_check_stp(stp, __func__,
+       if (free_stb) {
+               pmap_check_stb(stb, __func__,
                               vinc == NBSEG ? "release seg" : "release xseg");
-               pmap_segtab_free(stp);
-               *stp_p = NULL;
+               pmap_segtab_free(stb);
+               *stb_p = NULL;
        }
 }
 
@@ -335,26 +335,26 @@
 static pmap_segtab_t *



Home | Main Index | Thread Index | Old Index