diff options
| author | leo <leo@NetBSD.org> | 1999-06-18 07:13:16 +0000 |
|---|---|---|
| committer | leo <leo@NetBSD.org> | 1999-06-18 07:13:16 +0000 |
| commit | bfdcd7d519859dcaf25cf181d43cf9481ff3c04b (patch) | |
| tree | 6844980638fb7859a9cd3f46760da84eb3429135 /sys | |
| parent | 88f71d9598074b13d7ca5a5b1765690c23dd439e (diff) | |
Update pmap_check_wiring(). Also attach TNF copyright because of the
pmap_remove_mapping() changes.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/atari/atari/pmap.c | 67 |
1 files changed, 57 insertions, 10 deletions
diff --git a/sys/arch/atari/atari/pmap.c b/sys/arch/atari/atari/pmap.c index df818efe1bb..ae542a6b9a1 100644 --- a/sys/arch/atari/atari/pmap.c +++ b/sys/arch/atari/atari/pmap.c @@ -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 @@ pmap_pvdump(pa) 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 |
