Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hppa/hppa Simplify code a little.
details: https://anonhg.NetBSD.org/src/rev/a95e9c07efc4
branches: trunk
changeset: 772494:a95e9c07efc4
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Jan 06 08:32:08 2012 +0000
description:
Simplify code a little.
diffstat:
sys/arch/hppa/hppa/pmap.c | 42 ++++++++++++++++++++----------------------
1 files changed, 20 insertions(+), 22 deletions(-)
diffs (80 lines):
diff -r 56016cfe9d37 -r a95e9c07efc4 sys/arch/hppa/hppa/pmap.c
--- a/sys/arch/hppa/hppa/pmap.c Fri Jan 06 08:03:16 2012 +0000
+++ b/sys/arch/hppa/hppa/pmap.c Fri Jan 06 08:32:08 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.91 2012/01/06 08:32:08 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.91 2012/01/06 08:32:08 skrll Exp $");
#include "opt_cputype.h"
@@ -1698,6 +1698,7 @@
{
volatile pt_entry_t *pde;
pt_entry_t pte, opte;
+ struct vm_page *pg;
#ifdef PMAPDEBUG
int opmapdebug = pmapdebug;
@@ -1727,28 +1728,23 @@
if (opte)
pmap_pte_flush(pmap_kernel(), va, opte);
- if (pmap_initialized) {
- struct vm_page *pg;
+
+ pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL;
+ if (pg != NULL) {
+ KASSERT(pa < HPPA_IOBEGIN);
- pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte));
- if (pg != NULL) {
- KASSERT(pa < HPPA_IOBEGIN);
+ struct pv_entry *pve;
- struct pv_entry *pve;
-
- pve = pmap_pv_alloc();
- if (!pve)
- panic("%s: no pv entries available",
- __func__);
- DPRINTF(PDB_FOLLOW|PDB_ENTER,
- ("%s(%lx, %lx, %x) TLB_KENTER\n", __func__,
- va, pa, pte));
+ pve = pmap_pv_alloc();
+ if (!pve)
+ panic("%s: no pv entries available", __func__);
+ DPRINTF(PDB_FOLLOW|PDB_ENTER, ("%s(%lx, %lx, %x) TLB_KENTER\n",
+ _func__, va, pa, pte));
- if (pmap_check_alias(pg, va, pte))
- pmap_page_remove(pg);
- pmap_pv_enter(pg, pve, pmap_kernel(), va, NULL,
- PV_KENTER);
- }
+ if (pmap_check_alias(pg, va, pte))
+ pmap_page_remove(pg);
+
+ pmap_pv_enter(pg, pve, pmap_kernel(), va, NULL, PV_KENTER);
}
pmap_pte_set(pde, va, pte);
@@ -1815,7 +1811,9 @@
pmap_pte_flush(pmap, va, pte);
pmap_pte_set(pde, va, 0);
- if (pmap_initialized && (pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte)))) {
+
+ pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL;
+ if (pg != NULL) {
pve = pmap_pv_remove(pg, pmap, va);
if (pve != NULL)
Home |
Main Index |
Thread Index |
Old Index