Fri Jan 6 08:03:16 2012 UTC ()
Style.


(skrll)
diff -r1.89 -r1.90 src/sys/arch/hppa/hppa/pmap.c

cvs diff -r1.89 -r1.90 src/sys/arch/hppa/hppa/pmap.c (expand / switch to unified diff)

--- src/sys/arch/hppa/hppa/pmap.c 2012/01/06 07:59:07 1.89
+++ src/sys/arch/hppa/hppa/pmap.c 2012/01/06 08:03:16 1.90
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $ */ 1/* $NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matthew Fredette. 8 * by Matthew Fredette.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -55,27 +55,27 @@ @@ -55,27 +55,27 @@
55 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 55 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
56 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 56 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
57 * THE POSSIBILITY OF SUCH DAMAGE. 57 * THE POSSIBILITY OF SUCH DAMAGE.
58 */ 58 */
59/* 59/*
60 * References: 60 * References:
61 * 1. PA7100LC ERS, Hewlett-Packard, March 30 1999, Public version 1.0 61 * 1. PA7100LC ERS, Hewlett-Packard, March 30 1999, Public version 1.0
62 * 2. PA7300LC ERS, Hewlett-Packard, March 18 1996, Version 1.0 62 * 2. PA7300LC ERS, Hewlett-Packard, March 18 1996, Version 1.0
63 * 3. PA-RISC 1.1 Architecture and Instruction Set Reference Manual, 63 * 3. PA-RISC 1.1 Architecture and Instruction Set Reference Manual,
64 * Hewlett-Packard, February 1994, Third Edition 64 * Hewlett-Packard, February 1994, Third Edition
65 */ 65 */
66 66
67#include <sys/cdefs.h> 67#include <sys/cdefs.h>
68__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $"); 68__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $");
69 69
70#include "opt_cputype.h" 70#include "opt_cputype.h"
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/systm.h> 73#include <sys/systm.h>
74#include <sys/malloc.h> 74#include <sys/malloc.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/mutex.h> 76#include <sys/mutex.h>
77 77
78#include <uvm/uvm.h> 78#include <uvm/uvm.h>
79 79
80#include <machine/reg.h> 80#include <machine/reg.h>
81#include <machine/psl.h> 81#include <machine/psl.h>
@@ -585,31 +585,33 @@ pmap_pv_enter(struct vm_page *pg, struct @@ -585,31 +585,33 @@ pmap_pv_enter(struct vm_page *pg, struct
585 pve->pv_next = md->pvh_list; 585 pve->pv_next = md->pvh_list;
586 md->pvh_list = pve; 586 md->pvh_list = pve;
587} 587}
588 588
589static inline struct pv_entry * 589static inline struct pv_entry *
590pmap_pv_remove(struct vm_page *pg, pmap_t pmap, vaddr_t va) 590pmap_pv_remove(struct vm_page *pg, pmap_t pmap, vaddr_t va)
591{ 591{
592 struct vm_page_md * const md = VM_PAGE_TO_MD(pg); 592 struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
593 struct pv_entry **pve, *pv; 593 struct pv_entry **pve, *pv;
594 594
595 KASSERT(pmap == pmap_kernel() || uvm_page_locked_p(pg)); 595 KASSERT(pmap == pmap_kernel() || uvm_page_locked_p(pg));
596 596
597 for (pv = *(pve = &md->pvh_list); 597 for (pv = *(pve = &md->pvh_list);
598 pv; pv = *(pve = &(*pve)->pv_next)) 598 pv; pv = *(pve = &(*pve)->pv_next)) {
599 if (pv->pv_pmap == pmap && (pv->pv_va & PV_VAMASK) == va) { 599 if (pv->pv_pmap == pmap && (pv->pv_va & PV_VAMASK) == va) {
600 *pve = pv->pv_next; 600 *pve = pv->pv_next;
601 break; 601 break;
602 } 602 }
 603 }
 604
603 return (pv); 605 return (pv);
604} 606}
605 607
606#define FIRST_16M atop(16 * 1024 * 1024) 608#define FIRST_16M atop(16 * 1024 * 1024)
607 609
608static void 610static void
609pmap_page_physload(paddr_t spa, paddr_t epa) 611pmap_page_physload(paddr_t spa, paddr_t epa)
610{ 612{
611 613
612 if (spa < FIRST_16M && epa <= FIRST_16M) { 614 if (spa < FIRST_16M && epa <= FIRST_16M) {
613 DPRINTF(PDB_INIT, ("%s: phys segment 0x%05lx 0x%05lx\n", 615 DPRINTF(PDB_INIT, ("%s: phys segment 0x%05lx 0x%05lx\n",
614 __func__, spa, epa)); 616 __func__, spa, epa));
615 617