Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/atari Update pmap_check_wiring(). Also attach...



details:   https://anonhg.NetBSD.org/src/rev/08a62b1290bc
branches:  trunk
changeset: 473761:08a62b1290bc
user:      leo <leo%NetBSD.org@localhost>
date:      Fri Jun 18 07:13:16 1999 +0000

description:
Update pmap_check_wiring(). Also attach TNF copyright because of the
pmap_remove_mapping() changes.

diffstat:

 sys/arch/atari/atari/pmap.c |  67 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 57 insertions(+), 10 deletions(-)

diffs (95 lines):

diff -r 2e5973239b61 -r 08a62b1290bc sys/arch/atari/atari/pmap.c
--- a/sys/arch/atari/atari/pmap.c       Fri Jun 18 06:32:05 1999 +0000
+++ b/sys/arch/atari/atari/pmap.c       Fri Jun 18 07:13:16 1999 +0000
@@ -1,4 +1,40 @@
-/*     $NetBSD: pmap.c,v 1.48 1999/06/17 19:23:23 thorpej Exp $        */
+/*     $NetBSD: pmap.c,v 1.49 1999/06/18 07:13:16 leo Exp $    */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
 
 /* 
  * Copyright (c) 1991 Regents of the University of California.
@@ -2552,29 +2588,40 @@
        printf("\n");
 }
 
+/*
+ * pmap_check_wiring:
+ *
+ *     Count the number of valid mappings in the specified PT page,
+ *     and ensure that it is consistent with the number of wirings
+ *     to that page that the VM system has.
+ */
 static void
 pmap_check_wiring(str, va)
        char *str;
        vaddr_t va;
 {
-       vm_map_entry_t entry;
-       register int count, *pte;
+       pt_entry_t *pte;
+       paddr_t pa;
+       vm_page_t m;
+       int count;
 
-       va = trunc_page(va);
        if (!pmap_ste_v(pmap_kernel(), va) ||
            !pmap_pte_v(pmap_pte(pmap_kernel(), va)))
                return;
 
-       if (!uvm_map_lookup_entry(pt_map, va, &entry)) {
-               printf("wired_check: entry for %lx not found\n", va);
+       pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
+       m = PHYS_TO_VM_PAGE(pa);
+       if (m->wire_count < 1) {
+               printf("*%s*: 0x%lx: wire count %d\n", str, va, m->wire_count);
                return;
        }
+
        count = 0;
-       for (pte = (int *)va; pte < (int *)(va+PAGE_SIZE); pte++)
+       for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
                if (*pte)
                        count++;
-       if (entry->wired_count != count)
-               printf("*%s*: %lx: w%d/a%d\n",
-                      str, va, entry->wired_count, count);
+       if ((m->wire_count - 1) != count)
+               printf("*%s*: 0x%lx: w%d/a%d\n",
+                      str, va, (m->wire_count - 1), count);
 }
 #endif



Home | Main Index | Thread Index | Old Index